com.intellij.openapi.vcs.CheckinProjectPanel Java Examples

The following examples show how to use com.intellij.openapi.vcs.CheckinProjectPanel. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SelectWorkItemsAction.java    From azure-devops-intellij with MIT License 6 votes vote down vote up
@Override
public void actionPerformed(AnActionEvent anActionEvent) {
    final DataContext dc = anActionEvent.getDataContext();
    final Project project = CommonDataKeys.PROJECT.getData(dc);
    final Refreshable panel = CheckinProjectPanel.PANEL_KEY.getData(dc);
    final CommitMessageI commitMessageI = (panel instanceof CommitMessageI) ? (CommitMessageI) panel : VcsDataKeys.COMMIT_MESSAGE_CONTROL.getData(dc);

    if (commitMessageI != null && project != null) {
        String commitMessage = "";
        // Attempt to append the message instead of overwriting it
        if (commitMessageI instanceof CommitChangeListDialog) {
            commitMessage = ((CommitChangeListDialog) commitMessageI).getCommitMessage();
        }

        SelectWorkItemsDialog dialog = new SelectWorkItemsDialog(project);
        if (dialog.showAndGet()) {
            if (StringUtils.isNotEmpty(commitMessage)) {
                commitMessage += "\n" + dialog.getComment();
            } else {
                commitMessage = dialog.getComment();
            }

            commitMessageI.setCommitMessage(commitMessage);
        }
    }
}
 
Example #2
Source File: P4CheckinEnvironment.java    From p4ic4idea with Apache License 2.0 6 votes vote down vote up
@Nullable
//@Override
@Deprecated
public RefreshableOnComponent createAdditionalOptionsPanel(CheckinProjectPanel panel, PairConsumer<Object, Object> additionalDataConsumer) {
    // #52 - we could be able to monitor panel.getCommitMessage(); to ensure
    // that there's a message, and when there isn't, disable the submit
    // button.
    // We can monitor the message (with a thread, disposing of it is
    // a bit of a bother, but it's doable).  However, disabling the button
    // currently requires:
    //  1. Grabbing the owning dialog object of the panel.
    //  2. Using reflection to make the protected "disableOKButton" method
    //     accessible and callable.
    // All of this means that this isn't a very good idea.
    // The panel has a "setWarning" method, but that doesn't do anything.

    return new P4OnCheckinPanel(project, panel, additionalDataConsumer);
}
 
Example #3
Source File: P4CheckinEnvironment.java    From p4ic4idea with Apache License 2.0 5 votes vote down vote up
P4OnCheckinPanel(@NotNull Project project, @NotNull CheckinProjectPanel panel,
        final PairConsumer<Object, Object> additionalDataConsumer) {
    this.parentPanel = panel;
    this.dataConsumer = additionalDataConsumer;
    this.model = new SubmitModel(project);
    this.panel = new SubmitPanel(model);
    this.root = new WrapperPanel(this.panel.getRoot(), false, false);
    model.setSelectedCurrentChanges(panel.getSelectedChanges());
}
 
Example #4
Source File: OptimizeOptionsCheckinHandlerFactory.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
@Nonnull
public CheckinHandler createHandler(final CheckinProjectPanel panel, CommitContext commitContext) {
  return new OptimizeImportsBeforeCheckinHandler(panel.getProject(), panel);
}
 
Example #5
Source File: TFSCheckinEnvironment.java    From azure-devops-intellij with MIT License 4 votes vote down vote up
@Nullable
    public RefreshableOnComponent createAdditionalOptionsPanel(final CheckinProjectPanel checkinProjectPanel,
                                                               PairConsumer<Object, Object> additionalDataConsumer) {
//        boolean isAffected = false;
//        for (File file : checkinProjectPanel.getFiles()) {
//            if (TFSVcs.isUnderTFS(VcsUtil.getFilePath(file), checkinProjectPanel.getProject())) {
//                isAffected = true;
//                break;
//            }
//        }
//        if (!isAffected) {
//            return null;
//        }
//
//        final JComponent panel = new JPanel();
//        panel.setLayout(new BorderLayout(5, 0));
//
//        myVcs.getCheckinData().messageLabel = new BoldLabel() {
//
//            @Override
//            public JToolTip createToolTip() {
//                JToolTip toolTip = new JToolTip() {{
//                    setUI(new MultiLineTooltipUI());
//                }};
//                toolTip.setComponent(this);
//                return toolTip;
//            }
//
//        };
//
//        panel.add(myVcs.getCheckinData().messageLabel, BorderLayout.WEST);
//
//        final JButton configureButton = new JButton("Configure...");
//        panel.add(configureButton, BorderLayout.EAST);
//
//        configureButton.addActionListener(new ActionListener() {
//
//            public void actionPerformed(final ActionEvent event) {
//                CheckinParameters copy = myVcs.getCheckinData().parameters.createCopy();
//
//                CheckinParametersDialog d = new CheckinParametersDialog(checkinProjectPanel.getProject(), copy);
//                if (d.showAndGet()) {
//                    myVcs.getCheckinData().parameters = copy;
//                    updateMessage(myVcs.getCheckinData());
//                }
//            }
//        });
//
//        return new TFSAdditionalOptionsPanel(panel, checkinProjectPanel, configureButton);
        return null;
    }
 
Example #6
Source File: TodoCheckinHandler.java    From consulo with Apache License 2.0 4 votes vote down vote up
public TodoCheckinHandler(CheckinProjectPanel checkinProjectPanel) {
  myProject = checkinProjectPanel.getProject();
  myCheckinProjectPanel = checkinProjectPanel;
  myConfiguration = VcsConfiguration.getInstance(myProject);
}
 
Example #7
Source File: TodoCheckinHandlerFactory.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Nonnull
@Override
public CheckinHandler createHandler(CheckinProjectPanel panel, CommitContext commitContext) {
  return new TodoCheckinHandler(panel);
}
 
Example #8
Source File: ReformatBeforeCheckinHandler.java    From consulo with Apache License 2.0 4 votes vote down vote up
public ReformatBeforeCheckinHandler(final Project project, final CheckinProjectPanel panel) {
  myProject = project;
  myPanel = panel;
}
 
Example #9
Source File: ReformatCheckinHandlerFactory.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
@Nonnull
public CheckinHandler createHandler(final CheckinProjectPanel panel, CommitContext commitContext) {
  return new ReformatBeforeCheckinHandler(panel.getProject(), panel);
}
 
Example #10
Source File: OptimizeImportsBeforeCheckinHandler.java    From consulo with Apache License 2.0 4 votes vote down vote up
public OptimizeImportsBeforeCheckinHandler(final Project project, final CheckinProjectPanel panel) {
  myProject = project;
  myPanel = panel;
}
 
Example #11
Source File: CodeAnalysisBeforeCheckinHandler.java    From consulo with Apache License 2.0 4 votes vote down vote up
public CodeAnalysisBeforeCheckinHandler(final Project project, CheckinProjectPanel panel) {
  myProject = project;
  myCheckinPanel = panel;
}
 
Example #12
Source File: CodeAnalysisCheckinHandlerFactory.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
@Nonnull
public CheckinHandler createHandler(final CheckinProjectPanel panel, CommitContext commitContext) {
  return new CodeAnalysisBeforeCheckinHandler(panel.getProject(), panel);
}
 
Example #13
Source File: RearrangeBeforeCheckinHandler.java    From consulo with Apache License 2.0 4 votes vote down vote up
public RearrangeBeforeCheckinHandler(@Nonnull Project project, @Nonnull CheckinProjectPanel panel) {
  myProject = project;
  myPanel = panel;
}
 
Example #14
Source File: CodeCleanupCheckinHandlerFactory.java    From consulo with Apache License 2.0 4 votes vote down vote up
public CleanupCodeCheckinHandler(CheckinProjectPanel panel) {
  myProject = panel.getProject();
  myPanel = panel;
}
 
Example #15
Source File: CodeCleanupCheckinHandlerFactory.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
@Nonnull
public CheckinHandler createHandler(@Nonnull final CheckinProjectPanel panel, @Nonnull CommitContext commitContext) {
  return new CleanupCodeCheckinHandler(panel);
}
 
Example #16
Source File: RearrangeCheckinHandlerFactory.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
@Nonnull
public CheckinHandler createHandler(@Nonnull final CheckinProjectPanel panel, @Nonnull CommitContext commitContext) {
  return new RearrangeBeforeCheckinHandler(panel.getProject(), panel);
}
 
Example #17
Source File: VcsCheckinHandlerFactory.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Nonnull
protected abstract CheckinHandler createVcsHandler(CheckinProjectPanel panel);
 
Example #18
Source File: VcsCheckinHandlerFactory.java    From consulo with Apache License 2.0 4 votes vote down vote up
@javax.annotation.Nullable
@Override
public CheckinHandler createHandler(CheckinProjectPanel panel, CommitContext commitContext) {
  if (! panel.vcsIsAffected(myKey.getName())) return null;
  return createVcsHandler(panel);
}
 
Example #19
Source File: CheckinEnvironment.java    From consulo with Apache License 2.0 4 votes vote down vote up
@javax.annotation.Nullable
RefreshableOnComponent createAdditionalOptionsPanel(CheckinProjectPanel panel, PairConsumer<Object, Object> additionalDataConsumer);
 
Example #20
Source File: AmendComponent.java    From consulo with Apache License 2.0 4 votes vote down vote up
public AmendComponent(@Nonnull Project project,
                      @Nonnull RepositoryManager<? extends Repository> repoManager,
                      @Nonnull CheckinProjectPanel panel) {
  this(project, repoManager, panel, DvcsBundle.message("commit.amend"));
}
 
Example #21
Source File: CommitMessageValidationCheckinHandler.java    From GitToolBox with Apache License 2.0 4 votes vote down vote up
public CommitMessageValidationCheckinHandler(CheckinProjectPanel panel, String validationRegex) {
  this.panel = panel;
  this.validationRegex = validationRegex;
}
 
Example #22
Source File: BaseCheckinHandlerFactory.java    From consulo with Apache License 2.0 2 votes vote down vote up
/**
 * Creates a handler for a single Checkin Project or Checkin File operation.
 *
 *
 * @param panel the class which can be used to retrieve information about the files to be committed,
 *              and to get or set the commit message.
 * @param commitContext
 * @return the handler instance - null if not supported
 */
@javax.annotation.Nullable
CheckinHandler createHandler(final CheckinProjectPanel panel, CommitContext commitContext);
 
Example #23
Source File: CheckinHandlerFactory.java    From consulo with Apache License 2.0 2 votes vote down vote up
/**
 * Creates a handler for a single Checkin Project or Checkin File operation.
 *
 *
 * @param panel the class which can be used to retrieve information about the files to be committed,
 *              and to get or set the commit message.
 * @param commitContext
 * @return the handler instance.
 */
@Override
@javax.annotation.Nullable
public abstract CheckinHandler createHandler(final CheckinProjectPanel panel, CommitContext commitContext);