use of com.intellij.openapi.diff.impl.dir.DirDiffElementImpl 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);
}
}
use of com.intellij.openapi.diff.impl.dir.DirDiffElementImpl in project intellij-community by JetBrains.
the class SetNoOperation method update.
@Override
public final void update(AnActionEvent e) {
final DirDiffTableModel model = SetOperationToBase.getModel(e);
final JTable table = SetOperationToBase.getTable(e);
if (table != null && model != null) {
for (DirDiffElementImpl element : model.getSelectedElements()) {
if (element.getOperation() != DirDiffOperation.NONE) {
e.getPresentation().setEnabled(true);
return;
}
}
}
e.getPresentation().setEnabled(false);
}
use of com.intellij.openapi.diff.impl.dir.DirDiffElementImpl in project intellij-community by JetBrains.
the class SetOperationToBase method actionPerformed.
@Override
public void actionPerformed(AnActionEvent e) {
DirDiffOperation operation = getOperation();
boolean setToDefault = operation == DirDiffOperation.NONE;
final DirDiffTableModel model = getModel(e);
final JTable table = getTable(e);
assert model != null && table != null;
for (DirDiffElementImpl element : model.getSelectedElements()) {
if (isEnabledFor(element)) {
element.setOperation(setToDefault ? element.getDefaultOperation() : operation);
} else {
element.setOperation(DirDiffOperation.NONE);
}
}
table.repaint();
}
use of com.intellij.openapi.diff.impl.dir.DirDiffElementImpl in project intellij-community by JetBrains.
the class SetOperationToBase method update.
@Override
public final void update(AnActionEvent e) {
final DirDiffTableModel model = getModel(e);
final JTable table = getTable(e);
if (table != null && model != null) {
for (DirDiffElementImpl element : model.getSelectedElements()) {
if (isEnabledFor(element)) {
e.getPresentation().setEnabled(true);
return;
}
}
}
e.getPresentation().setEnabled(false);
}
use of com.intellij.openapi.diff.impl.dir.DirDiffElementImpl in project intellij-community by JetBrains.
the class SetNoOperation method actionPerformed.
@Override
public void actionPerformed(AnActionEvent e) {
final DirDiffTableModel model = SetOperationToBase.getModel(e);
final JTable table = SetOperationToBase.getTable(e);
assert model != null && table != null;
for (DirDiffElementImpl element : model.getSelectedElements()) {
element.setOperation(DirDiffOperation.NONE);
}
table.repaint();
}
Aggregations