Search in sources :

Example 1 with ProjectStructureConfigurable

use of com.intellij.openapi.roots.ui.configuration.ProjectStructureConfigurable in project intellij-community by JetBrains.

the class ExternalModuleStructureExtension method getModulesConfigurator.

@Nullable
private static ModulesConfigurator getModulesConfigurator(Project project) {
    if (ApplicationManager.getApplication().isHeadlessEnvironment())
        return null;
    final ProjectStructureConfigurable structureConfigurable = ProjectStructureConfigurable.getInstance(project);
    StructureConfigurableContext context = structureConfigurable.isUiInitialized() ? structureConfigurable.getContext() : null;
    return context != null ? context.getModulesConfigurator() : null;
}
Also used : StructureConfigurableContext(com.intellij.openapi.roots.ui.configuration.projectRoot.StructureConfigurableContext) ProjectStructureConfigurable(com.intellij.openapi.roots.ui.configuration.ProjectStructureConfigurable) Nullable(org.jetbrains.annotations.Nullable)

Example 2 with ProjectStructureConfigurable

use of com.intellij.openapi.roots.ui.configuration.ProjectStructureConfigurable in project intellij-community by JetBrains.

the class ModuleNameLocationComponent method validateExistingModuleName.

private void validateExistingModuleName() throws ConfigurationException {
    Project project = myWizardContext.getProject();
    if (project == null)
        return;
    final String moduleName = getModuleName();
    final Module module;
    final ProjectStructureConfigurable fromConfigurable = ProjectStructureConfigurable.getInstance(project);
    if (fromConfigurable != null) {
        module = fromConfigurable.getModulesConfig().getModule(moduleName);
    } else {
        module = ModuleManager.getInstance(project).findModuleByName(moduleName);
    }
    if (module != null) {
        throw new ConfigurationException("Module \'" + moduleName + "\' already exist in project. Please, specify another name.");
    }
}
Also used : Project(com.intellij.openapi.project.Project) ConfigurationException(com.intellij.openapi.options.ConfigurationException) Module(com.intellij.openapi.module.Module) ProjectStructureConfigurable(com.intellij.openapi.roots.ui.configuration.ProjectStructureConfigurable)

Example 3 with ProjectStructureConfigurable

use of com.intellij.openapi.roots.ui.configuration.ProjectStructureConfigurable in project intellij-community by JetBrains.

the class ClasspathPanelImpl method navigate.

@Override
public void navigate(boolean openLibraryEditor) {
    final OrderEntry entry = getSelectedEntry();
    final ProjectStructureConfigurable rootConfigurable = ProjectStructureConfigurable.getInstance(myState.getProject());
    if (entry instanceof ModuleOrderEntry) {
        Module module = ((ModuleOrderEntry) entry).getModule();
        if (module != null) {
            rootConfigurable.select(module.getName(), null, true);
        }
    } else if (entry instanceof LibraryOrderEntry) {
        if (!openLibraryEditor && !((LibraryOrderEntry) entry).getLibraryLevel().equals(LibraryTableImplUtil.MODULE_LEVEL)) {
            rootConfigurable.select((LibraryOrderEntry) entry, true);
        } else {
            doEdit();
        }
    } else if (entry instanceof JdkOrderEntry) {
        Sdk jdk = ((JdkOrderEntry) entry).getJdk();
        if (jdk != null) {
            rootConfigurable.select(jdk, true);
        }
    }
}
Also used : Sdk(com.intellij.openapi.projectRoots.Sdk) Module(com.intellij.openapi.module.Module) ProjectStructureConfigurable(com.intellij.openapi.roots.ui.configuration.ProjectStructureConfigurable)

Example 4 with ProjectStructureConfigurable

use of com.intellij.openapi.roots.ui.configuration.ProjectStructureConfigurable in project intellij-plugins by JetBrains.

the class FlexBCConfigurator method createBcConfigurable.

private CompositeConfigurable createBcConfigurable(final Module module, final ModifiableFlexBuildConfiguration bc, final Runnable treeNodeNameUpdater) {
    final ProjectStructureConfigurable c = ProjectStructureConfigurable.getInstance(module.getProject());
    final Runnable bcNatureModifier = createBCNatureModifier(bc);
    return new FlexBCConfigurable(module, bc, bcNatureModifier, myConfigEditor, c.getProjectJdksModel(), c.getContext()) {

        public void apply() throws ConfigurationException {
            super.apply();
            myBCToOutputPathMap.put(bc, bc.getActualOutputFilePath());
        }

        @Override
        public void setDisplayName(final String name) {
            super.setDisplayName(name);
            treeNodeNameUpdater.run();
            myEventDispatcher.getMulticaster().buildConfigurationRenamed(this);
        }
    }.wrapInTabs();
}
Also used : ConfigurationException(com.intellij.openapi.options.ConfigurationException) FlexBCConfigurable(com.intellij.lang.javascript.flex.projectStructure.ui.FlexBCConfigurable) ProjectStructureConfigurable(com.intellij.openapi.roots.ui.configuration.ProjectStructureConfigurable)

Example 5 with ProjectStructureConfigurable

use of com.intellij.openapi.roots.ui.configuration.ProjectStructureConfigurable in project intellij-plugins by JetBrains.

the class FlexSdkUtils method openModuleConfigurable.

public static void openModuleConfigurable(final Module module) {
    final ProjectStructureConfigurable projectStructureConfigurable = ProjectStructureConfigurable.getInstance(module.getProject());
    ShowSettingsUtil.getInstance().editConfigurable(module.getProject(), projectStructureConfigurable, () -> projectStructureConfigurable.select(module.getName(), ClasspathEditor.NAME, true));
}
Also used : ProjectStructureConfigurable(com.intellij.openapi.roots.ui.configuration.ProjectStructureConfigurable)

Aggregations

ProjectStructureConfigurable (com.intellij.openapi.roots.ui.configuration.ProjectStructureConfigurable)10 Module (com.intellij.openapi.module.Module)4 Place (com.intellij.ui.navigation.Place)4 FlexBuildConfiguration (com.intellij.lang.javascript.flex.projectStructure.model.FlexBuildConfiguration)2 ConfigurationException (com.intellij.openapi.options.ConfigurationException)2 Project (com.intellij.openapi.project.Project)2 HyperlinkEvent (javax.swing.event.HyperlinkEvent)2 Nullable (org.jetbrains.annotations.Nullable)2 FlexBCConfigurable (com.intellij.lang.javascript.flex.projectStructure.ui.FlexBCConfigurable)1 Notification (com.intellij.notification.Notification)1 NotificationListener (com.intellij.notification.NotificationListener)1 Sdk (com.intellij.openapi.projectRoots.Sdk)1 StructureConfigurableContext (com.intellij.openapi.roots.ui.configuration.projectRoot.StructureConfigurableContext)1 Ref (com.intellij.openapi.util.Ref)1 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)1 TreePath (javax.swing.tree.TreePath)1 AndroidFacet (org.jetbrains.android.facet.AndroidFacet)1 NotNull (org.jetbrains.annotations.NotNull)1