Search in sources :

Example 16 with Place

use of com.intellij.ui.navigation.Place in project intellij-community by JetBrains.

the class ModuleStructureConfigurable method selectOrderEntry.

public ActionCallback selectOrderEntry(@NotNull Module module, @Nullable OrderEntry orderEntry) {
    for (final ModuleStructureExtension extension : ModuleStructureExtension.EP_NAME.getExtensions()) {
        final ActionCallback callback = extension.selectOrderEntry(module, orderEntry);
        if (callback != null) {
            return callback;
        }
    }
    Place p = new Place();
    p.putPath(ProjectStructureConfigurable.CATEGORY, this);
    Runnable r = null;
    final MasterDetailsComponent.MyNode node = findModuleNode(module);
    if (node != null) {
        p.putPath(TREE_OBJECT, module);
        p.putPath(ModuleEditor.SELECTED_EDITOR_NAME, ClasspathEditor.NAME);
        r = () -> {
            if (orderEntry != null) {
                ModuleEditor moduleEditor = ((ModuleConfigurable) node.getConfigurable()).getModuleEditor();
                ModuleConfigurationEditor editor = moduleEditor.getEditor(ClasspathEditor.NAME);
                if (editor instanceof ClasspathEditor) {
                    ((ClasspathEditor) editor).selectOrderEntry(orderEntry);
                }
            }
        };
    }
    final ActionCallback result = ProjectStructureConfigurable.getInstance(myProject).navigateTo(p, true);
    return r != null ? result.doWhenDone(r) : result;
}
Also used : ActionCallback(com.intellij.openapi.util.ActionCallback) ClasspathEditor(com.intellij.openapi.roots.ui.configuration.ClasspathEditor) ModuleEditor(com.intellij.openapi.roots.ui.configuration.ModuleEditor) Place(com.intellij.ui.navigation.Place)

Aggregations

Place (com.intellij.ui.navigation.Place)16 ProjectStructureConfigurable (com.intellij.openapi.roots.ui.configuration.ProjectStructureConfigurable)4 Module (com.intellij.openapi.module.Module)3 NotNull (org.jetbrains.annotations.NotNull)3 FlexBuildConfiguration (com.intellij.lang.javascript.flex.projectStructure.model.FlexBuildConfiguration)2 CompositeConfigurable (com.intellij.lang.javascript.flex.projectStructure.ui.CompositeConfigurable)2 Library (com.intellij.openapi.roots.libraries.Library)2 DependenciesPerspectiveConfigurable (com.android.tools.idea.gradle.structure.configurables.DependenciesPerspectiveConfigurable)1 ProjectStructureConfigurable (com.android.tools.idea.structure.dialog.ProjectStructureConfigurable)1 LinkageType (com.intellij.flex.model.bc.LinkageType)1 Dependencies (com.intellij.lang.javascript.flex.projectStructure.model.Dependencies)1 DependencyEntry (com.intellij.lang.javascript.flex.projectStructure.model.DependencyEntry)1 ModuleLibraryEntry (com.intellij.lang.javascript.flex.projectStructure.model.ModuleLibraryEntry)1 FlexProjectConfigurationEditor (com.intellij.lang.javascript.flex.projectStructure.model.impl.FlexProjectConfigurationEditor)1 FlexBCConfigurable (com.intellij.lang.javascript.flex.projectStructure.ui.FlexBCConfigurable)1 LibraryOrderEntry (com.intellij.openapi.roots.LibraryOrderEntry)1 LibraryEx (com.intellij.openapi.roots.impl.libraries.LibraryEx)1 ClasspathEditor (com.intellij.openapi.roots.ui.configuration.ClasspathEditor)1 ModuleEditor (com.intellij.openapi.roots.ui.configuration.ModuleEditor)1 ModuleStructureConfigurable (com.intellij.openapi.roots.ui.configuration.projectRoot.ModuleStructureConfigurable)1