private static @Nullable OccurenceNavigator getOccurenceNavigatorFromContext(@NotNull DataContext dataContext) {
    Project project = CommonDataKeys.PROJECT.getData(dataContext);
    Component component = PlatformCoreDataKeys.CONTEXT_COMPONENT.getData(dataContext);
    for (Component c = component; c != null; c = c.getParent()) {
      if (c instanceof OccurenceNavigator) {
        return (OccurenceNavigator)c;
      }
    }
    if (project == null) return null;

    for (ToolWindow toolWindow : JBIterable.of(PlatformDataKeys.LAST_ACTIVE_TOOL_WINDOWS.getData(dataContext))) {
      OccurenceNavigator navigator = findNavigator(toolWindow.getComponent());
      if (navigator != null) return navigator;
    }
    return null;
  }
private static @Nullable OccurenceNavigator getOccurenceNavigatorFromContext(@NotNull DataContext dataContext)