Java源码示例:com.intellij.openapi.roots.ui.configuration.ClasspathEditor
示例1
public AsyncResult<Void> selectOrderEntry(@Nonnull final Module module, @Nullable final OrderEntry orderEntry) {
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 = new Runnable() {
@Override
public void run() {
if (orderEntry != null) {
ModuleEditor moduleEditor = ((ModuleConfigurable)node.getConfigurable()).getModuleEditor();
ModuleConfigurationEditor editor = moduleEditor.getEditor(ClasspathEditor.NAME);
if (editor instanceof ClasspathEditor) {
((ClasspathEditor)editor).selectOrderEntry(orderEntry);
}
}
}
};
}
final AsyncResult<Void> result = ProjectStructureConfigurable.getInstance(myProject).navigateTo(p, true);
return r != null ? result.doWhenDone(r) : result;
}
示例2
public ModuleConfigurationEditor[] createEditors(ModuleConfigurationState state) {
Module module = state.getRootModel().getModule();
if (!(ModuleType.get(module) instanceof HaskellModuleType)) {
return ModuleConfigurationEditor.EMPTY;
}
return new ModuleConfigurationEditor[]{
new JavaContentEntriesEditor(module.getName(), state),
// new CabalFilesEditor(state),
new ClasspathEditor(state),
};
}
示例3
public ModuleConfigurationEditor[] createEditors(final ModuleConfigurationState state) {
final Module module = state.getRootModel().getModule();
if (ModuleType.get(module) != HaxeModuleType.getInstance()) {
return ModuleConfigurationEditor.EMPTY;
}
return new ModuleConfigurationEditor[]{
new CommonContentEntriesEditor(module.getName(), state, JavaSourceRootType.SOURCE, JavaSourceRootType.TEST_SOURCE),
new ClasspathEditor(state),
new HaxeModuleConfigurationEditor(state)
};
}