Search in sources :

Example 11 with Place

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

the class AddAsSwcLibDialog method openProjectStructure.

private void openProjectStructure(final Module module, final FlexBuildConfiguration bc) {
    ApplicationManager.getApplication().invokeLater(() -> {
        final ProjectStructureConfigurable configurable = ProjectStructureConfigurable.getInstance(myProject);
        ShowSettingsUtil.getInstance().editConfigurable(myProject, configurable, () -> {
            final Place place = FlexBuildConfigurationsExtension.getInstance().getConfigurator().getPlaceFor(module, bc.getName()).putPath(CompositeConfigurable.TAB_NAME, DependenciesConfigurable.TAB_NAME);
            configurable.navigateTo(place, true);
        });
    });
}
Also used : Place(com.intellij.ui.navigation.Place) ProjectStructureConfigurable(com.intellij.openapi.roots.ui.configuration.ProjectStructureConfigurable)

Example 12 with Place

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

the class FlashProjectStructureErrorsDialog method openProjectStructure.

private void openProjectStructure() {
    final TreePath selectionPath = myTree.getSelectionPath();
    DefaultMutableTreeNode node = selectionPath == null ? null : (DefaultMutableTreeNode) selectionPath.getLastPathComponent();
    Object userObject = node == null ? null : node.getUserObject();
    if (userObject == null)
        return;
    final Ref<Module> moduleRef = new Ref<>();
    final Ref<FlexBuildConfiguration> bcRef = new Ref<>();
    final Ref<FlashProjectStructureProblem> problemRef = new Ref<>();
    if (userObject instanceof FlashProjectStructureProblem) {
        problemRef.set((FlashProjectStructureProblem) userObject);
        node = (DefaultMutableTreeNode) node.getParent();
        userObject = node.getUserObject();
    }
    if (userObject instanceof FlexBuildConfiguration) {
        bcRef.set((FlexBuildConfiguration) userObject);
        node = (DefaultMutableTreeNode) node.getParent();
        userObject = node.getUserObject();
    }
    if (userObject instanceof Module) {
        moduleRef.set((Module) userObject);
    }
    close(CANCEL_EXIT_CODE);
    final ProjectStructureConfigurable configurable = ProjectStructureConfigurable.getInstance(myProject);
    ShowSettingsUtil.getInstance().editConfigurable(myProject, configurable, () -> {
        final Place place;
        if (problemRef.get() instanceof FlashProjectStructureProblem.FlexUnitOutputFolderProblem) {
            place = new Place().putPath(ProjectStructureConfigurable.CATEGORY, configurable.getProjectConfig());
        } else if (moduleRef.isNull()) {
            place = new Place().putPath(ProjectStructureConfigurable.CATEGORY, configurable.getModulesConfig());
        } else if (bcRef.isNull()) {
            place = new Place().putPath(ProjectStructureConfigurable.CATEGORY, configurable.getModulesConfig()).putPath(MasterDetailsComponent.TREE_OBJECT, moduleRef.get());
        } else {
            place = FlexBuildConfigurationsExtension.getInstance().getConfigurator().getPlaceFor(moduleRef.get(), bcRef.get().getName());
            if (!problemRef.isNull()) {
                place.putPath(CompositeConfigurable.TAB_NAME, problemRef.get().tabName);
                place.putPath(FlexBCConfigurable.LOCATION_ON_TAB, problemRef.get().locationOnTab);
            }
        }
        configurable.navigateTo(place, true);
    });
}
Also used : DefaultMutableTreeNode(javax.swing.tree.DefaultMutableTreeNode) FlexBuildConfiguration(com.intellij.lang.javascript.flex.projectStructure.model.FlexBuildConfiguration) ProjectStructureConfigurable(com.intellij.openapi.roots.ui.configuration.ProjectStructureConfigurable) Ref(com.intellij.openapi.util.Ref) TreePath(javax.swing.tree.TreePath) Module(com.intellij.openapi.module.Module) Place(com.intellij.ui.navigation.Place)

Example 13 with Place

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

the class DependenciesConfigurable method editLibrary.

private void editLibrary(final SharedLibraryItem item) {
    final Library liveLibrary = item.findLiveLibrary();
    if (liveLibrary != null) {
        final BaseLibrariesConfigurable librariesConfigurable = LibraryTablesRegistrar.APPLICATION_LEVEL.equals(liveLibrary.getTable().getTableLevel()) ? GlobalLibrariesConfigurable.getInstance(myProject) : ProjectLibrariesConfigurable.getInstance(myProject);
        final Place place = new Place().putPath(ProjectStructureConfigurable.CATEGORY, librariesConfigurable).putPath(MasterDetailsComponent.TREE_OBJECT, liveLibrary);
        ProjectStructureConfigurable.getInstance(myProject).navigateTo(place, true);
    }
}
Also used : Place(com.intellij.ui.navigation.Place)

Example 14 with Place

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

the class ProjectStructureConfigurable method select.

public ActionCallback select(@NotNull Sdk sdk, final boolean requestFocus) {
    Place place = createPlaceFor(myJdkListConfig);
    place.putPath(MasterDetailsComponent.TREE_NAME, sdk.getName());
    return navigateTo(place, requestFocus);
}
Also used : Place(com.intellij.ui.navigation.Place)

Example 15 with Place

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

the class ProjectStructureConfigurable method select.

public ActionCallback select(@NotNull LibraryOrderEntry libraryOrderEntry, final boolean requestFocus) {
    final Library lib = libraryOrderEntry.getLibrary();
    if (lib == null || lib.getTable() == null) {
        return selectOrderEntry(libraryOrderEntry.getOwnerModule(), libraryOrderEntry);
    }
    Place place = createPlaceFor(getConfigurableFor(lib));
    place.putPath(MasterDetailsComponent.TREE_NAME, libraryOrderEntry.getLibraryName());
    return navigateTo(place, requestFocus);
}
Also used : Library(com.intellij.openapi.roots.libraries.Library) 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