diff --git a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/inspectionsTree/InspectionsConfigTreeTable.java b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/inspectionsTree/InspectionsConfigTreeTable.java index 5a7fe8ef84c6..6dadf8cbee65 100644 --- a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/inspectionsTree/InspectionsConfigTreeTable.java +++ b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/inspectionsTree/InspectionsConfigTreeTable.java @@ -60,8 +60,8 @@ public class InspectionsConfigTreeTable extends TreeTable { final TableColumn isEnabledColumn = getColumnModel().getColumn(IS_ENABLED_COLUMN); isEnabledColumn.setMaxWidth(20); - isEnabledColumn.setCellRenderer(new ThreeStateCheckBoxRenderer()); - isEnabledColumn.setCellEditor(new ThreeStateCheckBoxRenderer()); + isEnabledColumn.setCellRenderer(new ThreeStateCheckBoxRenderer(false)); + isEnabledColumn.setCellEditor(new ThreeStateCheckBoxRenderer(true)); addMouseMotionListener(new MouseAdapter() { @Override diff --git a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/table/ScopesAndSeveritiesTable.java b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/table/ScopesAndSeveritiesTable.java index 19a5151defa8..3b2c36bf7d34 100644 --- a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/table/ScopesAndSeveritiesTable.java +++ b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/table/ScopesAndSeveritiesTable.java @@ -76,8 +76,8 @@ public class ScopesAndSeveritiesTable extends JBTable { final TableColumn scopeEnabledColumn = columnModel.getColumn(SCOPE_ENABLED_COLUMN); scopeEnabledColumn.setMaxWidth(30); - scopeEnabledColumn.setCellRenderer(new ThreeStateCheckBoxRenderer()); - scopeEnabledColumn.setCellEditor(new ThreeStateCheckBoxRenderer()); + scopeEnabledColumn.setCellRenderer(new ThreeStateCheckBoxRenderer(false)); + scopeEnabledColumn.setCellEditor(new ThreeStateCheckBoxRenderer(true)); final TableColumn severityColumn = columnModel.getColumn(SEVERITY_COLUMN); severityColumn.setCellRenderer(SeverityRenderer.create(tableSettings.getInspectionProfile())); diff --git a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/table/ThreeStateCheckBoxRenderer.java b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/table/ThreeStateCheckBoxRenderer.java index 7d8cfdfc9db5..c5e3a85d50d3 100644 --- a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/table/ThreeStateCheckBoxRenderer.java +++ b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/table/ThreeStateCheckBoxRenderer.java @@ -39,10 +39,22 @@ public class ThreeStateCheckBoxRenderer extends ThreeStateCheckBox implements Ta private final List myListeners = new SmartList(); - public ThreeStateCheckBoxRenderer() { + public ThreeStateCheckBoxRenderer(final boolean isEditor) { setThirdStateEnabled(false); setHorizontalAlignment(CENTER); setVerticalAlignment(CENTER); + if (isEditor) { + new ClickListener() { + @Override + public boolean onClick(@NotNull final MouseEvent event, final int clickCount) { + if (clickCount == 1) { + stopCellEditing(); + return true; + } + return false; + } + }.installOn(this); + } } @Override @@ -69,16 +81,6 @@ public class ThreeStateCheckBoxRenderer extends ThreeStateCheckBox implements Ta } else { setSelected((Boolean) value); } - new ClickListener() { - @Override - public boolean onClick(@NotNull final MouseEvent event, final int clickCount) { - if (clickCount == 1) { - stopCellEditing(); - return true; - } - return false; - } - }.installOn(this); return this; }