diff --git a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/BreakpointTree.java b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/BreakpointTree.java index c19c4122169c..0d1ee32f5d9b 100644 --- a/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/BreakpointTree.java +++ b/java/debugger/impl/src/com/intellij/debugger/ui/breakpoints/BreakpointTree.java @@ -613,7 +613,7 @@ public class BreakpointTree extends CheckboxTree { } private static class BreakpointTreeCellRenderer extends CheckboxTreeCellRenderer { - public void customizeCellRenderer(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { + public void customizeRenderer(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { // Fix GTK background if (UIUtil.isUnderGTKLookAndFeel()){ final Color background = selected ? UIUtil.getTreeSelectionBackground() : UIUtil.getTreeTextBackground(); diff --git a/java/idea-ui/src/com/intellij/facet/impl/autodetecting/facetsTree/DetectedFacetsTree.java b/java/idea-ui/src/com/intellij/facet/impl/autodetecting/facetsTree/DetectedFacetsTree.java index b52d6ada48ea..5516585d0a65 100644 --- a/java/idea-ui/src/com/intellij/facet/impl/autodetecting/facetsTree/DetectedFacetsTree.java +++ b/java/idea-ui/src/com/intellij/facet/impl/autodetecting/facetsTree/DetectedFacetsTree.java @@ -58,7 +58,7 @@ public class DetectedFacetsTree extends CheckboxTreeBase { } private static class FacetsCheckboxTreeCellRenderer extends CheckboxTreeCellRendererBase { - public void customizeCellRenderer(final JTree tree, + public void customizeRenderer(final JTree tree, final Object value, final boolean selected, final boolean expanded, final boolean leaf, final int row, final boolean hasFocus) { diff --git a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/libraryEditor/DetectedSourceRootsDialog.java b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/libraryEditor/DetectedSourceRootsDialog.java index 158839073ae1..4fdaaa18ba67 100644 --- a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/libraryEditor/DetectedSourceRootsDialog.java +++ b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/libraryEditor/DetectedSourceRootsDialog.java @@ -128,13 +128,14 @@ public class DetectedSourceRootsDialog extends DialogWrapper { */ private CheckboxTree createCheckboxTree() { CheckboxTree tree = new CheckboxTree(new CheckboxTree.CheckboxTreeCellRenderer(true) { - public void customizeCellRenderer(JTree tree, + public void customizeRenderer(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { + if (!(value instanceof CheckedTreeNode)) return; CheckedTreeNode node = (CheckedTreeNode)value; VirtualFile file = (VirtualFile)node.getUserObject(); String text; diff --git a/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/config/IntentionSettingsTree.java b/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/config/IntentionSettingsTree.java index a3a674d7b80a..d6425ac71087 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/config/IntentionSettingsTree.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/intention/impl/config/IntentionSettingsTree.java @@ -66,7 +66,8 @@ public abstract class IntentionSettingsTree { private void initTree() { myTree = new CheckboxTree(new CheckboxTree.CheckboxTreeCellRenderer(true) { - public void customizeCellRenderer(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { + public void customizeRenderer(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { + if (!(value instanceof CheckedTreeNode)) return; CheckedTreeNode node = (CheckedTreeNode)value; SimpleTextAttributes attributes = node.getUserObject() instanceof IntentionActionMetaData ? SimpleTextAttributes.REGULAR_ATTRIBUTES : SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES; final String text = getNodeText(node); diff --git a/platform/lang-impl/src/com/intellij/codeInsight/template/impl/TemplateListPanel.java b/platform/lang-impl/src/com/intellij/codeInsight/template/impl/TemplateListPanel.java index 87be6ec0dc1e..b7bbae32f277 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/template/impl/TemplateListPanel.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/template/impl/TemplateListPanel.java @@ -632,14 +632,14 @@ class TemplateListPanel extends JPanel { myTreeRoot = new CheckedTreeNode(null); myTree = new CheckboxTree(new CheckboxTree.CheckboxTreeCellRenderer(){ - public void customizeCellRenderer(final JTree tree, + public void customizeRenderer(final JTree tree, Object value, final boolean selected, final boolean expanded, final boolean leaf, final int row, final boolean hasFocus) { - + if (!(value instanceof DefaultMutableTreeNode)) return; value = ((DefaultMutableTreeNode)value).getUserObject(); // Fix GTK background if (UIUtil.isUnderGTKLookAndFeel()){ diff --git a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/InspectionsConfigTreeRenderer.java b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/InspectionsConfigTreeRenderer.java index f80f845ad3a5..904d101cf700 100644 --- a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/InspectionsConfigTreeRenderer.java +++ b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/InspectionsConfigTreeRenderer.java @@ -36,14 +36,14 @@ import java.awt.*; abstract class InspectionsConfigTreeRenderer extends CheckboxTree.CheckboxTreeCellRenderer { protected abstract String getFilter(); - public void customizeCellRenderer(final JTree tree, + public void customizeRenderer(final JTree tree, final Object value, final boolean selected, final boolean expanded, final boolean leaf, final int row, final boolean hasFocus) { - + if (!(value instanceof InspectionConfigTreeNode)) return; InspectionConfigTreeNode node = (InspectionConfigTreeNode)value; Object object = node.getUserObject(); diff --git a/platform/lang-impl/src/com/intellij/tools/ToolsPanel.java b/platform/lang-impl/src/com/intellij/tools/ToolsPanel.java index 797ab0b492e0..54357a22e216 100644 --- a/platform/lang-impl/src/com/intellij/tools/ToolsPanel.java +++ b/platform/lang-impl/src/com/intellij/tools/ToolsPanel.java @@ -77,13 +77,14 @@ class ToolsPanel extends JPanel { myTree = new CheckboxTree( new CheckboxTree.CheckboxTreeCellRenderer() { - public void customizeCellRenderer(final JTree tree, + public void customizeRenderer(final JTree tree, final Object value, final boolean selected, final boolean expanded, final boolean leaf, final int row, final boolean hasFocus) { + if (!(value instanceof CheckedTreeNode)) return; Object object = ((CheckedTreeNode)value).getUserObject(); // Fix GTK background if (UIUtil.isUnderGTKLookAndFeel()) { diff --git a/platform/platform-api/src/com/intellij/ui/CheckboxTreeBase.java b/platform/platform-api/src/com/intellij/ui/CheckboxTreeBase.java index e2de0a5bb4c1..6c2f259427ca 100644 --- a/platform/platform-api/src/com/intellij/ui/CheckboxTreeBase.java +++ b/platform/platform-api/src/com/intellij/ui/CheckboxTreeBase.java @@ -413,10 +413,10 @@ public class CheckboxTreeBase extends Tree { } public static class CheckPolicy { - boolean checkChildrenWithCheckedParent; - boolean uncheckChildrenWithUncheckedParent; - boolean checkParentWithCheckedChild; - boolean uncheckParentWithUncheckedChild; + final boolean checkChildrenWithCheckedParent; + final boolean uncheckChildrenWithUncheckedParent; + final boolean checkParentWithCheckedChild; + final boolean uncheckParentWithUncheckedChild; public CheckPolicy(final boolean checkChildrenWithCheckedParent, final boolean uncheckChildrenWithUncheckedParent, diff --git a/plugins/git4idea/src/git4idea/ui/GitRefspecAddRefsDialog.java b/plugins/git4idea/src/git4idea/ui/GitRefspecAddRefsDialog.java index edf6df5c248b..c854da849076 100644 --- a/plugins/git4idea/src/git4idea/ui/GitRefspecAddRefsDialog.java +++ b/plugins/git4idea/src/git4idea/ui/GitRefspecAddRefsDialog.java @@ -237,13 +237,14 @@ public class GitRefspecAddRefsDialog extends DialogWrapper { myTreeRoot = new CheckedTreeNode(""); myReferenceChooser = new CheckboxTree(new CheckboxTree.CheckboxTreeCellRenderer() { - public void customizeCellRenderer(final JTree tree, + public void customizeRenderer(final JTree tree, final Object value, final boolean selected, final boolean expanded, final boolean leaf, final int row, final boolean hasFocus) { + if (!(value instanceof CheckedTreeNode)) return; // Fix GTK background if (UIUtil.isUnderGTKLookAndFeel()) { final Color background = selected ? UIUtil.getTreeSelectionBackground() : UIUtil.getTreeTextBackground();