use of com.intellij.openapi.diff.impl.dir.DirDiffTableModel 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.DirDiffTableModel 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.DirDiffTableModel 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.DirDiffTableModel 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