mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Arrangement: add action should not be available outside of arrangement panel
This commit is contained in:
+6
@@ -38,6 +38,12 @@ public class AddArrangementRuleAction extends AbstractArrangementRuleAction impl
|
||||
setEnabledInModalContext(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(AnActionEvent e) {
|
||||
ArrangementMatchingRulesControl control = getRulesControl(e);
|
||||
e.getPresentation().setEnabled(control != null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void actionPerformed(AnActionEvent e) {
|
||||
ArrangementMatchingRulesControl control = getRulesControl(e);
|
||||
|
||||
+1
@@ -39,6 +39,7 @@ public class AddArrangementSectionRuleAction extends AddArrangementRuleAction {
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user