Navigatable (@NotNull DefaultMutableTreeNode node, boolean allowRequestFocus) { Object userObject = node.getUserObject(); if (userObject instanceof Navigatable navigatable) { return navigatable.canNavigate() ? new Navigatable() { @Override public void navigate(boolean requestFocus) { if (Registry.is("ide.usages.next.previous.occurrence.only.show.in.preview") && isPreviewUsages() && myRootPanel.isShowing()) select(); else navigatable.navigate(allowRequestFocus && requestFocus); } @Override public boolean canNavigate() { return navigatable.canNavigate(); } @Override public boolean canNavigateToSource() { return navigatable.canNavigateToSource(); } } : null; } return null; }