void (final SimpleTree tree) { tree.setRootVisible(false); tree.setShowsRootHandles(true); MavenUIUtil.installCheckboxRenderer(tree, new MavenUIUtil.CheckboxHandler() { @Override public void toggle(TreePath treePath, InputEvent e) { SimpleNode node = tree.getNodeFor(treePath); if (node != null) { node.handleDoubleClickOrEnter(tree, e); } } @Override public boolean isVisible(Object userObject) { return userObject instanceof ProfileNode; } @Override public MavenUIUtil.CheckBoxState getState(Object userObject) { MavenProfileKind state = ((ProfileNode)userObject).getState(); return switch (state) { case NONE -> MavenUIUtil.CheckBoxState.UNCHECKED; case EXPLICIT -> MavenUIUtil.CheckBoxState.CHECKED; case IMPLICIT -> MavenUIUtil.CheckBoxState.PARTIAL; }; } }); }