Search in sources :

Example 1 with DirDiffTableModel

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);
}
Also used : DirDiffTableModel(com.intellij.openapi.diff.impl.dir.DirDiffTableModel) DirDiffElementImpl(com.intellij.openapi.diff.impl.dir.DirDiffElementImpl)

Example 2 with DirDiffTableModel

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();
}
Also used : DirDiffTableModel(com.intellij.openapi.diff.impl.dir.DirDiffTableModel) DirDiffElementImpl(com.intellij.openapi.diff.impl.dir.DirDiffElementImpl) DirDiffOperation(com.intellij.ide.diff.DirDiffOperation)

Example 3 with DirDiffTableModel

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);
}
Also used : DirDiffTableModel(com.intellij.openapi.diff.impl.dir.DirDiffTableModel) DirDiffElementImpl(com.intellij.openapi.diff.impl.dir.DirDiffElementImpl)

Example 4 with DirDiffTableModel

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();
}
Also used : DirDiffTableModel(com.intellij.openapi.diff.impl.dir.DirDiffTableModel) DirDiffElementImpl(com.intellij.openapi.diff.impl.dir.DirDiffElementImpl)

Aggregations

DirDiffElementImpl (com.intellij.openapi.diff.impl.dir.DirDiffElementImpl)4 DirDiffTableModel (com.intellij.openapi.diff.impl.dir.DirDiffTableModel)4 DirDiffOperation (com.intellij.ide.diff.DirDiffOperation)1