void (JTree treeView) { myTreeView = treeView; myTreeView.getSelectionModel().addTreeSelectionListener(new TreeSelectionListener() { @Override public void valueChanged(TreeSelectionEvent event) { selectionChanged(); } }); if (treeView instanceof BreakpointsCheckboxTree) { ((BreakpointsCheckboxTree)treeView).setDelegate(this); } myTreeView.setShowsRootHandles(!myGroupingRules.isEmpty()); }