use of com.intellij.ide.diff.BackgroundOperatingDiffElement in project intellij-community by JetBrains.
the class SynchronizeDiff method update.
@Override
public void update(AnActionEvent e) {
super.update(e);
if (e.getPresentation().isEnabled() && (getModel().getSourceDir() instanceof BackgroundOperatingDiffElement || getModel().getTargetDir() instanceof BackgroundOperatingDiffElement)) {
List<DirDiffElementImpl> elements = mySelectedOnly ? getModel().getSelectedElements() : getModel().getElements();
for (DirDiffElementImpl dirDiffElement : elements) {
if ((dirDiffElement.getSource() == null || dirDiffElement.getSource().isOperationsEnabled()) && (dirDiffElement.getTarget() == null || dirDiffElement.getTarget().isOperationsEnabled()) && (dirDiffElement.getOperation() == COPY_FROM || dirDiffElement.getOperation() == COPY_TO || dirDiffElement.getOperation() == DELETE)) {
e.getPresentation().setEnabled(true);
return;
}
}
e.getPresentation().setEnabled(false);
}
}
Aggregations