void (@NotNull ChangesBrowserNodeRenderer nodeRenderer) { new TreeLinkMouseListener(nodeRenderer) { @Override protected int getRendererRelativeX(@NotNull MouseEvent e, @NotNull JTree tree, @NotNull TreePath path) { int x = super.getRendererRelativeX(e, tree, path); if (myShowCheckboxes && isIncludable(path)) { x -= myCheckboxWidth; } return x; } @Override public void mouseMoved(MouseEvent e) { if (!isEmpty()) { // apply only if tree is not empty - otherwise "getEmptyText()" should handle the case super.mouseMoved(e); } } }.installOn(this); }