Search in sources :

Example 1 with ClasspathEditor

use of com.intellij.openapi.roots.ui.configuration.ClasspathEditor in project ballerina by ballerina-lang.

the class BallerinaModuleEditorsProvider method createEditors.

@Override
public ModuleConfigurationEditor[] createEditors(@NotNull ModuleConfigurationState state) {
    ModifiableRootModel rootModel = state.getRootModel();
    Module module = rootModel.getModule();
    if (!(ModuleType.get(module) instanceof BallerinaModuleType)) {
        return ModuleConfigurationEditor.EMPTY;
    }
    String moduleName = module.getName();
    List<ModuleConfigurationEditor> editors = ContainerUtil.newArrayList();
    editors.add(new ContentEntriesEditor(moduleName, state));
    editors.add(new OutputEditorEx(state));
    editors.add(new ClasspathEditor(state));
    return editors.toArray(new ModuleConfigurationEditor[editors.size()]);
}
Also used : ModifiableRootModel(com.intellij.openapi.roots.ModifiableRootModel) ContentEntriesEditor(com.intellij.openapi.roots.ui.configuration.ContentEntriesEditor) ModuleConfigurationEditor(com.intellij.openapi.module.ModuleConfigurationEditor) ClasspathEditor(com.intellij.openapi.roots.ui.configuration.ClasspathEditor) Module(com.intellij.openapi.module.Module) BallerinaModuleType(org.ballerinalang.plugins.idea.BallerinaModuleType)

Example 2 with ClasspathEditor

use of com.intellij.openapi.roots.ui.configuration.ClasspathEditor 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

ClasspathEditor (com.intellij.openapi.roots.ui.configuration.ClasspathEditor)2 Module (com.intellij.openapi.module.Module)1 ModuleConfigurationEditor (com.intellij.openapi.module.ModuleConfigurationEditor)1 ModifiableRootModel (com.intellij.openapi.roots.ModifiableRootModel)1 ContentEntriesEditor (com.intellij.openapi.roots.ui.configuration.ContentEntriesEditor)1 ModuleEditor (com.intellij.openapi.roots.ui.configuration.ModuleEditor)1 ActionCallback (com.intellij.openapi.util.ActionCallback)1 Place (com.intellij.ui.navigation.Place)1 BallerinaModuleType (org.ballerinalang.plugins.idea.BallerinaModuleType)1