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);
}
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);
}
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());
}
}
Aggregations