From 3423dce4ee4b0ece70f3108fcc16353eac7dd30d Mon Sep 17 00:00:00 2001 From: "Denis.Zhdanov" Date: Wed, 12 Sep 2012 10:49:55 +0400 Subject: [PATCH] IDEA-91261 Code Style | Arrangement: grayed out modifiers are available for selection --- .../codeStyle/arrangement/ArrangementAtomNodeComponent.java | 4 ++++ .../options/codeStyle/arrangement/ArrangementRuleEditor.java | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/ArrangementAtomNodeComponent.java b/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/ArrangementAtomNodeComponent.java index ced6425cc4e4..733c143ac040 100644 --- a/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/ArrangementAtomNodeComponent.java +++ b/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/ArrangementAtomNodeComponent.java @@ -196,6 +196,10 @@ public class ArrangementAtomNodeComponent implements ArrangementNodeComponent { myBackgroundColor = myColorsService.getBackgroundColor(selected); } + public boolean isEnabled() { + return myEnabled; + } + /** * Instructs current component that it should {@link #getUiComponent() draw} itself according to the given 'enabled' state. * diff --git a/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/ArrangementRuleEditor.java b/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/ArrangementRuleEditor.java index 15478f572fb1..3301ec7adbfb 100644 --- a/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/ArrangementRuleEditor.java +++ b/platform/lang-impl/src/com/intellij/application/options/codeStyle/arrangement/ArrangementRuleEditor.java @@ -136,7 +136,7 @@ public class ArrangementRuleEditor extends JPanel { return; } ArrangementAtomNodeComponent clickedComponent = getNodeComponentAt(e.getLocationOnScreen()); - if (clickedComponent == null) { + if (clickedComponent == null || !clickedComponent.isEnabled()) { return; } ArrangementAtomMatchCondition chosenCondition = clickedComponent.getMatchCondition();