private MyCheckboxTreeCellRenderer( final SelectionManager selectionManager, Map<VirtualFile, String> modulesSet, final Project project, final JTree tree, final Collection<VirtualFile> roots) { super(new BorderLayout()); mySelectionManager = selectionManager; myModulesSet = modulesSet; myRoots = roots; setBackground(tree.getBackground()); myColoredRenderer = new ColoredTreeCellRenderer() { @Override public void customizeCellRenderer( JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { append(value.toString()); } }; myFictive = new JBList(); myFictive.setBackground(tree.getBackground()); myFictive.setSelectionBackground(UIUtil.getListSelectionBackground()); myFictive.setSelectionForeground(UIUtil.getListSelectionForeground()); myTextRenderer = new WithModulesListCellRenderer(project, myModulesSet) { @Override protected void putParentPath(Object value, FilePath path, FilePath self) { if (myRoots.contains(self.getVirtualFile())) { super.putParentPath(value, path, self); } } }; myTextRenderer.setBackground(tree.getBackground()); myCheckbox = new JCheckBox(); myCheckbox.setBackground(tree.getBackground()); myEmpty = new JLabel(""); add(myCheckbox, BorderLayout.WEST); add(myTextRenderer, BorderLayout.CENTER); myCheckbox.setVisible(true); }