• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ClasspathEditor类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:RenderErrorPanel.java


示例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;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:26,代码来源:ModuleStructureConfigurable.java


示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:ModuleStructureConfigurable.java


示例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);
  }

}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:32,代码来源:MvcFramework.java


示例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;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:DefaultGroovyScriptRunner.java


示例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),
    };
}
 
开发者ID:carymrobbins,项目名称:intellij-haskforce,代码行数:12,代码来源:HaskellModuleConfigurationEditor.java


示例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);
  }

}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:31,代码来源:MvcFramework.java


示例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;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:16,代码来源:DefaultGroovyScriptRunner.java


示例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)
  };
}
 
开发者ID:HaxeFoundation,项目名称:intellij-haxe,代码行数:12,代码来源:HaxeModuleConfigurationEditorProvider.java



注:本文中的com.intellij.openapi.roots.ui.configuration.ClasspathEditor类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java AuthenticationException类代码示例发布时间:2022-05-23
下一篇:
Java ObjectUtil类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap