Search in sources :

Example 1 with CommitMessageEditorDialog

use of org.eclipse.egit.ui.internal.rebase.CommitMessageEditorDialog in project egit by eclipse.

the class RewordHandler method promptCommitMessage.

private String promptCommitMessage(final Shell shell, RevCommit commit) {
    final String[] message = { commit.getFullMessage() };
    shell.getDisplay().syncExec(new Runnable() {

        @Override
        public void run() {
            CommitMessageEditorDialog dialog = new CommitMessageEditorDialog(shell, message[0]);
            if (dialog.open() == Window.OK)
                message[0] = dialog.getCommitMessage();
            else
                message[0] = null;
        }
    });
    return message[0];
}
Also used : CommitMessageEditorDialog(org.eclipse.egit.ui.internal.rebase.CommitMessageEditorDialog)

Example 2 with CommitMessageEditorDialog

use of org.eclipse.egit.ui.internal.rebase.CommitMessageEditorDialog in project egit by eclipse.

the class SquashHandler method promptCommitMessage.

private String promptCommitMessage(final Shell shell, final String message) {
    final String[] msg = { message };
    shell.getDisplay().syncExec(new Runnable() {

        @Override
        public void run() {
            CommitMessageEditorDialog dialog = new CommitMessageEditorDialog(shell, msg[0]);
            if (dialog.open() == Window.OK)
                msg[0] = dialog.getCommitMessage();
            else
                msg[0] = message;
        }
    });
    return msg[0];
}
Also used : CommitMessageEditorDialog(org.eclipse.egit.ui.internal.rebase.CommitMessageEditorDialog)

Example 3 with CommitMessageEditorDialog

use of org.eclipse.egit.ui.internal.rebase.CommitMessageEditorDialog in project egit by eclipse.

the class FeatureFinishHandler method rewordCommitMessage.

private void rewordCommitMessage(Shell activeShell, final GitFlowRepository gfRepo) throws CoreException, IOException {
    Repository repository = gfRepo.getRepository();
    CommitHelper commitHelper = new CommitHelper(repository);
    CommitMessageEditorDialog messageEditorDialog = new CommitMessageEditorDialog(activeShell, repository.readSquashCommitMsg(), UIText.FeatureFinishHandler_rewordSquashedCommitMessage);
    if (Window.OK == messageEditorDialog.open()) {
        String commitMessage = stripCommentLines(messageEditorDialog.getCommitMessage());
        CommitOperation commitOperation = new CommitOperation(repository, commitHelper.getAuthor(), commitHelper.getCommitter(), commitMessage);
        commitOperation.execute(null);
    }
}
Also used : GitFlowRepository(org.eclipse.egit.gitflow.GitFlowRepository) Repository(org.eclipse.jgit.lib.Repository) CommitMessageEditorDialog(org.eclipse.egit.ui.internal.rebase.CommitMessageEditorDialog) CommitOperation(org.eclipse.egit.core.op.CommitOperation) CommitHelper(org.eclipse.egit.ui.internal.commit.CommitHelper)

Aggregations

CommitMessageEditorDialog (org.eclipse.egit.ui.internal.rebase.CommitMessageEditorDialog)3 CommitOperation (org.eclipse.egit.core.op.CommitOperation)1 GitFlowRepository (org.eclipse.egit.gitflow.GitFlowRepository)1 CommitHelper (org.eclipse.egit.ui.internal.commit.CommitHelper)1 Repository (org.eclipse.jgit.lib.Repository)1