private static @Nullable Object getElementFromStructureView(@NotNull Project project, @NotNull FileEditor editor, @NotNull StructureViewBuilder builder) {
    if (builder instanceof TreeBasedStructureViewBuilder) {
      return getElementFromStructureTreeView(editor, (TreeBasedStructureViewBuilder)builder);
    }
    else {
      if (!EDT.isCurrentThreadEdt()) {
        return null;
      }
      return getElementFromStructureViewComponent(project, editor, builder);
    }
  }
private static @Nullable Object getElementFromStructureView(@NotNull Project project, @NotNull FileEditor editor, @NotNull StructureViewBuilder builder)