private static @Nullable OccurenceNavigator findNavigator(JComponent parent) {
    LinkedList<JComponent> queue = new LinkedList<>();
    queue.addLast(parent);
    while (!queue.isEmpty()) {
      JComponent component = queue.removeFirst();
      if (component instanceof OccurenceNavigator) {
        return (OccurenceNavigator)component;
      }
      if (component instanceof JTabbedPane) {
        JComponent selectedComponent = (JComponent)((JTabbedPane)component).getSelectedComponent();
        if (selectedComponent != null) {
          queue.addLast(selectedComponent);
        }
      }
      else if (component != null){
        for (int i = 0; i < component.getComponentCount(); i++) {
          Component child = component.getComponent(i);
          if (!(child instanceof JComponent)) {
            continue;
          }
          queue.addLast((JComponent)child);
        }
      }
    }
    return null;
  }
private static @Nullable OccurenceNavigator findNavigator(JComponent parent)