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);
}
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();
}
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);
}
}
}
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;
}
Aggregations