Search in sources :

Example 16 with ChangeList

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

the class SvnEditCommitMessageAction method update.

@Override
public void update(AnActionEvent e) {
    final DataContext dc = e.getDataContext();
    final ChangeList[] lists = VcsDataKeys.CHANGE_LISTS.getData(dc);
    final boolean enabled = lists != null && lists.length == 1 && lists[0] instanceof SvnChangeList;
    boolean visible = enabled;
    Project project = CommonDataKeys.PROJECT.getData(dc);
    if (project == null) {
        visible = VcsDataKeys.REMOTE_HISTORY_LOCATION.getData(dc) instanceof SvnRepositoryLocation;
    } else {
        visible = ProjectLevelVcsManager.getInstance(project).checkVcsIsActive(SvnVcs.VCS_NAME);
    }
    e.getPresentation().setVisible(visible);
    e.getPresentation().setEnabled(enabled);
}
Also used : Project(com.intellij.openapi.project.Project) DataContext(com.intellij.openapi.actionSystem.DataContext) ChangeList(com.intellij.openapi.vcs.changes.ChangeList)

Example 17 with ChangeList

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

the class SelectedChangeListsChecker method checkSame.

private void checkSame() {
    final CheckSamePattern<SVNURL> sameBranch = new CheckSamePattern<>();
    final CheckSamePattern<VirtualFile> sameRoot = new CheckSamePattern<>();
    for (ChangeList changeList : myChangeListsList) {
        final SvnChangeList svnChangeList = (SvnChangeList) changeList;
        sameBranch.iterate(svnChangeList.getBranchUrl());
        sameRoot.iterate(svnChangeList.getRoot());
        if ((!sameBranch.isSame()) || (!sameRoot.isSame())) {
            break;
        }
    }
    isValid = sameBranch.isSame() && sameRoot.isSame();
    mySameBranch = sameBranch.getSameValue();
    myVcsRoot = sameRoot.getSameValue();
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) SvnChangeList(org.jetbrains.idea.svn.history.SvnChangeList) SvnChangeList(org.jetbrains.idea.svn.history.SvnChangeList) ChangeList(com.intellij.openapi.vcs.changes.ChangeList) CommittedChangeList(com.intellij.openapi.vcs.versionBrowser.CommittedChangeList) SVNURL(org.tmatesoft.svn.core.SVNURL)

Example 18 with ChangeList

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

the class AssociateWithTaskAction method setSelected.

@Override
public void setSelected(AnActionEvent e, boolean state) {
    ChangeList[] lists = e.getData(VcsDataKeys.CHANGE_LISTS);
    if (lists == null) {
        return;
    }
    Project project = e.getData(CommonDataKeys.PROJECT);
    TaskManager manager = TaskManager.getManager(project);
    for (ChangeList list : lists) {
        if (list instanceof LocalChangeList) {
            manager.trackContext((LocalChangeList) list);
        }
    }
}
Also used : Project(com.intellij.openapi.project.Project) TaskManager(com.intellij.tasks.TaskManager) LocalChangeList(com.intellij.openapi.vcs.changes.LocalChangeList) ChangeList(com.intellij.openapi.vcs.changes.ChangeList) LocalChangeList(com.intellij.openapi.vcs.changes.LocalChangeList)

Example 19 with ChangeList

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

the class AssociateWithTaskAction method isSelected.

@Override
public boolean isSelected(AnActionEvent e) {
    ChangeList[] lists = e.getData(VcsDataKeys.CHANGE_LISTS);
    if (lists == null) {
        return false;
    }
    Project project = e.getData(CommonDataKeys.PROJECT);
    TaskManager manager = TaskManager.getManager(project);
    for (ChangeList list : lists) {
        if (list instanceof LocalChangeList && manager.getAssociatedTask((LocalChangeList) list) == null) {
            return false;
        }
    }
    return true;
}
Also used : Project(com.intellij.openapi.project.Project) TaskManager(com.intellij.tasks.TaskManager) LocalChangeList(com.intellij.openapi.vcs.changes.LocalChangeList) ChangeList(com.intellij.openapi.vcs.changes.ChangeList) LocalChangeList(com.intellij.openapi.vcs.changes.LocalChangeList)

Aggregations

ChangeList (com.intellij.openapi.vcs.changes.ChangeList)19 Project (com.intellij.openapi.project.Project)11 CommittedChangeList (com.intellij.openapi.vcs.versionBrowser.CommittedChangeList)7 Change (com.intellij.openapi.vcs.changes.Change)6 LocalChangeList (com.intellij.openapi.vcs.changes.LocalChangeList)5 VirtualFile (com.intellij.openapi.vfs.VirtualFile)5 SvnChangeList (org.jetbrains.idea.svn.history.SvnChangeList)3 DataContext (com.intellij.openapi.actionSystem.DataContext)2 FilePath (com.intellij.openapi.vcs.FilePath)2 ChangeListManager (com.intellij.openapi.vcs.changes.ChangeListManager)2 ContentRevision (com.intellij.openapi.vcs.changes.ContentRevision)2 TaskManager (com.intellij.tasks.TaskManager)2 ArrayList (java.util.ArrayList)2 NotNull (org.jetbrains.annotations.NotNull)2 CompletionResultSet (com.intellij.codeInsight.completion.CompletionResultSet)1 CamelHumpMatcher (com.intellij.codeInsight.completion.impl.CamelHumpMatcher)1 LookupElementBuilder (com.intellij.codeInsight.lookup.LookupElementBuilder)1 AnAction (com.intellij.openapi.actionSystem.AnAction)1 AnActionEvent (com.intellij.openapi.actionSystem.AnActionEvent)1 Presentation (com.intellij.openapi.actionSystem.Presentation)1