Search in sources :

Example 1 with ArrangementSectionRulesControl

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

the class AddArrangementSectionRuleAction method update.

@Override
public void update(AnActionEvent e) {
    final ArrangementMatchingRulesControl control = getRulesControl(e);
    if (control == null || !(control instanceof ArrangementSectionRulesControl)) {
        e.getPresentation().setEnabledAndVisible(false);
        return;
    }
    e.getPresentation().setEnabledAndVisible(((ArrangementSectionRulesControl) control).getSectionRuleManager() != null);
}
Also used : ArrangementMatchingRulesControl(com.intellij.application.options.codeStyle.arrangement.match.ArrangementMatchingRulesControl) ArrangementSectionRulesControl(com.intellij.application.options.codeStyle.arrangement.match.ArrangementSectionRulesControl)

Example 2 with ArrangementSectionRulesControl

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

the class EditRuleAliasesDefinitionAction method update.

@Override
public void update(AnActionEvent e) {
    final ArrangementSectionRulesControl control = ArrangementSectionRulesControl.KEY.getData(e.getDataContext());
    if (control == null) {
        return;
    }
    e.getPresentation().setEnabledAndVisible(control.getRulesAliases() != null);
}
Also used : ArrangementSectionRulesControl(com.intellij.application.options.codeStyle.arrangement.match.ArrangementSectionRulesControl)

Example 3 with ArrangementSectionRulesControl

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

the class EditRuleAliasesDefinitionAction method actionPerformed.

@Override
public void actionPerformed(@NotNull AnActionEvent e) {
    ArrangementSectionRulesControl control = ArrangementSectionRulesControl.KEY.getData(e.getDataContext());
    if (control == null || control.getRulesAliases() == null) {
        return;
    }
    control.hideEditor();
    final ArrangementRuleAliasDialog dialog = control.createRuleAliasEditDialog();
    if (dialog.showAndGet() && dialog.isModified()) {
        control.setRulesAliases(dialog.getRuleAliases());
    }
}
Also used : ArrangementRuleAliasDialog(com.intellij.application.options.codeStyle.arrangement.match.tokens.ArrangementRuleAliasDialog) ArrangementSectionRulesControl(com.intellij.application.options.codeStyle.arrangement.match.ArrangementSectionRulesControl)

Aggregations

ArrangementSectionRulesControl (com.intellij.application.options.codeStyle.arrangement.match.ArrangementSectionRulesControl)3 ArrangementMatchingRulesControl (com.intellij.application.options.codeStyle.arrangement.match.ArrangementMatchingRulesControl)1 ArrangementRuleAliasDialog (com.intellij.application.options.codeStyle.arrangement.match.tokens.ArrangementRuleAliasDialog)1