Search in sources :

Example 1 with SessionDialog

use of com.intellij.openapi.vcs.changes.ui.SessionDialog in project intellij-community by JetBrains.

the class CreatePatchFromChangesAction method createPatch.

public static void createPatch(Project project, String commitMessage, List<Change> changeCollection) {
    project = project == null ? ProjectManager.getInstance().getDefaultProject() : project;
    final CreatePatchCommitExecutor executor = CreatePatchCommitExecutor.getInstance(project);
    CommitSession commitSession = executor.createCommitSession();
    if (commitSession instanceof CommitSessionContextAware) {
        ((CommitSessionContextAware) commitSession).setContext(new CommitContext());
    }
    DialogWrapper sessionDialog = new SessionDialog(executor.getActionText(), project, commitSession, changeCollection, commitMessage);
    if (!sessionDialog.showAndGet()) {
        return;
    }
    preloadContent(project, changeCollection);
    commitSession.execute(changeCollection, commitMessage);
}
Also used : CreatePatchCommitExecutor(com.intellij.openapi.vcs.changes.patch.CreatePatchCommitExecutor) SessionDialog(com.intellij.openapi.vcs.changes.ui.SessionDialog) DialogWrapper(com.intellij.openapi.ui.DialogWrapper)

Aggregations

DialogWrapper (com.intellij.openapi.ui.DialogWrapper)1 CreatePatchCommitExecutor (com.intellij.openapi.vcs.changes.patch.CreatePatchCommitExecutor)1 SessionDialog (com.intellij.openapi.vcs.changes.ui.SessionDialog)1