Search in sources :

Example 1 with NewChangelistDialog

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

the class AddChangeListAction method actionPerformed.

public void actionPerformed(AnActionEvent e) {
    Project project = e.getData(CommonDataKeys.PROJECT);
    NewChangelistDialog dlg = new NewChangelistDialog(project);
    dlg.show();
    if (dlg.getExitCode() == DialogWrapper.OK_EXIT_CODE) {
        String name = dlg.getName();
        if (name.length() == 0) {
            name = getUniqueName(project);
        }
        final LocalChangeList list = ChangeListManager.getInstance(project).addChangeList(name, dlg.getDescription());
        if (dlg.isNewChangelistActive()) {
            ChangeListManager.getInstance(project).setDefaultChangeList(list);
        }
        dlg.getPanel().changelistCreatedOrChanged(list);
    }
}
Also used : Project(com.intellij.openapi.project.Project) NewChangelistDialog(com.intellij.openapi.vcs.changes.ui.NewChangelistDialog) LocalChangeList(com.intellij.openapi.vcs.changes.LocalChangeList)

Aggregations

Project (com.intellij.openapi.project.Project)1 LocalChangeList (com.intellij.openapi.vcs.changes.LocalChangeList)1 NewChangelistDialog (com.intellij.openapi.vcs.changes.ui.NewChangelistDialog)1