本文整理汇总了Java中com.intellij.openapi.roots.ui.configuration.ClasspathEditor类的典型用法代码示例。如果您正苦于以下问题:Java ClasspathEditor类的具体用法?Java ClasspathEditor怎么用?Java ClasspathEditor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ClasspathEditor类属于com.intellij.openapi.roots.ui.configuration包,在下文中一共展示了ClasspathEditor类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: run
import com.intellij.openapi.roots.ui.configuration.ClasspathEditor; //导入依赖的package包/类
@Override
public void run() {
final Set<String> sdkNames = getSdkNamesFromModules(myProblemModules);
if (sdkNames.size() == 1) {
final Sdk sdk = ProjectJdkTable.getInstance().findJdk(sdkNames.iterator().next());
if (sdk != null && sdk.getSdkType() instanceof AndroidSdkType) {
final ProjectStructureConfigurable config = ProjectStructureConfigurable.getInstance(myProject);
if (ShowSettingsUtil.getInstance().editConfigurable(myProject, config, new Runnable() {
@Override
public void run() {
config.select(sdk, true);
}
})) {
askAndRebuild(myProject);
}
return;
}
}
final String moduleToSelect = myProblemModules.size() > 0
? myProblemModules.iterator().next().getName()
: null;
if (ModulesConfigurator.showDialog(myProject, moduleToSelect, ClasspathEditor.NAME)) {
askAndRebuild(myProject);
}
}
示例2: selectOrderEntry
import com.intellij.openapi.roots.ui.configuration.ClasspathEditor; //导入依赖的package包/类
public ActionCallback 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 ActionCallback result = ProjectStructureConfigurable.getInstance(myProject).navigateTo(p, true);
return r != null ? result.doWhenDone(r) : result;
}
示例3: selectOrderEntry
import com.intellij.openapi.roots.ui.configuration.ClasspathEditor; //导入依赖的package包/类
public ActionCallback selectOrderEntry(@NotNull final Module module, @Nullable final 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 = 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 ActionCallback result = ProjectStructureConfigurable.getInstance(myProject).navigateTo(p, true);
return r != null ? result.doWhenDone(r) : result;
}
示例4: MySdkNotConfiguredNotificationPanel
import com.intellij.openapi.roots.ui.configuration.ClasspathEditor; //导入依赖的package包/类
MySdkNotConfiguredNotificationPanel(@NotNull final Module module) {
setText("Android SDK is not configured for module '" + module.getName() + "' or corrupted");
createActionLabel("Open Project Structure", new Runnable() {
@Override
public void run() {
ModulesConfigurator.showDialog(module.getProject(), module.getName(), ClasspathEditor.NAME);
myNotifications.updateAllNotifications();
}
});
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:AndroidSdkNotConfiguredNotificationProvider.java
示例5: createApplicationIfNeeded
import com.intellij.openapi.roots.ui.configuration.ClasspathEditor; //导入依赖的package包/类
public void createApplicationIfNeeded(@NotNull final Module module) {
if (findAppRoot(module) == null && module.getUserData(CREATE_APP_STRUCTURE) == Boolean.TRUE) {
while (ModuleRootManager.getInstance(module).getSdk() == null) {
if (Messages.showYesNoDialog(module.getProject(), "Cannot generate " + getDisplayName() + " project structure because JDK is not specified for module \"" +
module.getName() + "\".\n" +
getDisplayName() + " project will not be created if you don't specify JDK.\nDo you want to specify JDK?",
"Error", Messages.getErrorIcon()) == Messages.NO) {
return;
}
ProjectSettingsService.getInstance(module.getProject()).showModuleConfigurationDialog(module.getName(), ClasspathEditor.NAME);
}
module.putUserData(CREATE_APP_STRUCTURE, null);
final GeneralCommandLine commandLine = getCreationCommandLine(module);
if (commandLine == null) return;
MvcConsole.executeProcess(module, commandLine, new Runnable() {
@Override
public void run() {
VirtualFile root = findAppRoot(module);
if (root == null) return;
PsiDirectory psiDir = PsiManager.getInstance(module.getProject()).findDirectory(root);
IdeView ide = LangDataKeys.IDE_VIEW.getData(DataManager.getInstance().getDataContext());
if (ide != null) ide.selectElement(psiDir);
//also here comes fileCreated(application.properties) which manages roots and run configuration
}
}, true);
}
}
示例6: ensureRunnerConfigured
import com.intellij.openapi.roots.ui.configuration.ClasspathEditor; //导入依赖的package包/类
@Override
public boolean ensureRunnerConfigured(@Nullable Module module, RunProfile profile, Executor executor, final Project project) throws ExecutionException {
if (module == null) {
throw new ExecutionException("Module is not specified");
}
if (LibrariesUtil.getGroovyHomePath(module) == null) {
ExecutionUtil.handleExecutionError(project, executor.getToolWindowId(), profile, new ExecutionException("Groovy is not configured"));
ModulesConfigurator.showDialog(module.getProject(), module.getName(), ClasspathEditor.NAME);
return false;
}
return true;
}
示例7: createEditors
import com.intellij.openapi.roots.ui.configuration.ClasspathEditor; //导入依赖的package包/类
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),
};
}
示例8: createApplicationIfNeeded
import com.intellij.openapi.roots.ui.configuration.ClasspathEditor; //导入依赖的package包/类
public void createApplicationIfNeeded(@NotNull final Module module) {
if (findAppRoot(module) == null && module.getUserData(CREATE_APP_STRUCTURE) == Boolean.TRUE) {
while (ModuleRootManager.getInstance(module).getSdk() == null) {
if (Messages.showYesNoDialog(module.getProject(), "Cannot generate " + getDisplayName() + " project structure because JDK is not specified for module \"" +
module.getName() + "\".\n" +
getDisplayName() + " project will not be created if you don't specify JDK.\nDo you want to specify JDK?",
"Error", Messages.getErrorIcon()) == 1) {
return;
}
ProjectSettingsService.getInstance(module.getProject()).showModuleConfigurationDialog(module.getName(), ClasspathEditor.NAME);
}
module.putUserData(CREATE_APP_STRUCTURE, null);
final GeneralCommandLine commandLine = getCreationCommandLine(module);
if (commandLine == null) return;
MvcConsole.executeProcess(module, commandLine, new Runnable() {
public void run() {
VirtualFile root = findAppRoot(module);
if (root == null) return;
PsiDirectory psiDir = PsiManager.getInstance(module.getProject()).findDirectory(root);
IdeView ide = LangDataKeys.IDE_VIEW.getData(DataManager.getInstance().getDataContext());
if (ide != null) ide.selectElement(psiDir);
//also here comes fileCreated(application.properties) which manages roots and run configuration
}
}, true);
}
}
示例9: ensureRunnerConfigured
import com.intellij.openapi.roots.ui.configuration.ClasspathEditor; //导入依赖的package包/类
@Override
public boolean ensureRunnerConfigured(@Nullable Module module, RunProfile profile, Executor executor, final Project project) throws ExecutionException {
if (module == null) {
throw new ExecutionException("Module is not specified");
}
if (LibrariesUtil.getGroovyHomePath(module) == null) {
ExecutionUtil.handleExecutionError(project, executor.getToolWindowId(), profile, new ExecutionException("Groovy is not configured"));
ModulesConfigurator.showDialog(module.getProject(), module.getName(), ClasspathEditor.NAME);
return false;
}
return true;
}
示例10: createEditors
import com.intellij.openapi.roots.ui.configuration.ClasspathEditor; //导入依赖的package包/类
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)
};
}