Search in sources :

Example 6 with ArrangementMatchingRulesControl

use of com.intellij.application.options.codeStyle.arrangement.match.ArrangementMatchingRulesControl in project intellij-community by JetBrains.

the class EditArrangementRuleAction method update.

@Override
public void update(AnActionEvent e) {
    ArrangementMatchingRulesControl control = getRulesControl(e);
    e.getPresentation().setEnabled(control != null && control.getSelectedModelRows().size() == 1);
}
Also used : ArrangementMatchingRulesControl(com.intellij.application.options.codeStyle.arrangement.match.ArrangementMatchingRulesControl)

Example 7 with ArrangementMatchingRulesControl

use of com.intellij.application.options.codeStyle.arrangement.match.ArrangementMatchingRulesControl in project intellij-community by JetBrains.

the class RemoveArrangementRuleAction method update.

@Override
public void update(AnActionEvent e) {
    ArrangementMatchingRulesControl control = getRulesControl(e);
    e.getPresentation().setEnabled(control != null && !control.getSelectedModelRows().isEmpty() && control.getEditingRow() == -1);
}
Also used : ArrangementMatchingRulesControl(com.intellij.application.options.codeStyle.arrangement.match.ArrangementMatchingRulesControl)

Example 8 with ArrangementMatchingRulesControl

use of com.intellij.application.options.codeStyle.arrangement.match.ArrangementMatchingRulesControl in project intellij-community by JetBrains.

the class AddArrangementRuleAction method update.

@Override
public void update(AnActionEvent e) {
    ArrangementMatchingRulesControl control = getRulesControl(e);
    e.getPresentation().setEnabled(control != null);
}
Also used : ArrangementMatchingRulesControl(com.intellij.application.options.codeStyle.arrangement.match.ArrangementMatchingRulesControl)

Example 9 with ArrangementMatchingRulesControl

use of com.intellij.application.options.codeStyle.arrangement.match.ArrangementMatchingRulesControl in project intellij-community by JetBrains.

the class EditArrangementRuleAction method actionPerformed.

@Override
public void actionPerformed(AnActionEvent e) {
    ArrangementMatchingRulesControl control = getRulesControl(e);
    if (control == null) {
        return;
    }
    TIntArrayList rows = control.getSelectedModelRows();
    if (rows.size() != 1) {
        return;
    }
    final int row = rows.get(0);
    control.showEditor(row);
    scrollRowToVisible(control, row);
}
Also used : ArrangementMatchingRulesControl(com.intellij.application.options.codeStyle.arrangement.match.ArrangementMatchingRulesControl) TIntArrayList(gnu.trove.TIntArrayList)

Aggregations

ArrangementMatchingRulesControl (com.intellij.application.options.codeStyle.arrangement.match.ArrangementMatchingRulesControl)9 ArrangementMatchingRulesModel (com.intellij.application.options.codeStyle.arrangement.match.ArrangementMatchingRulesModel)3 TIntArrayList (gnu.trove.TIntArrayList)3 ArrayList (java.util.ArrayList)2 ArrangementSectionRulesControl (com.intellij.application.options.codeStyle.arrangement.match.ArrangementSectionRulesControl)1