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

Java ChooseModulesDialog类代码示例

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

本文整理汇总了Java中com.intellij.openapi.roots.ui.configuration.ChooseModulesDialog的典型用法代码示例。如果您正苦于以下问题:Java ChooseModulesDialog类的具体用法?Java ChooseModulesDialog怎么用?Java ChooseModulesDialog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ChooseModulesDialog类属于com.intellij.openapi.roots.ui.configuration包,在下文中一共展示了ChooseModulesDialog类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: showDialogAndAddLibraryToDependencies

import com.intellij.openapi.roots.ui.configuration.ChooseModulesDialog; //导入依赖的package包/类
public static void showDialogAndAddLibraryToDependencies(final Library library, final Project project, boolean allowEmptySelection) {
  for (ProjectStructureValidator validator : EP_NAME.getExtensions()) {
    if (validator.addLibraryToDependencies(library, project, allowEmptySelection)) {
      return;
    }
  }

  final ModuleStructureConfigurable moduleStructureConfigurable = ModuleStructureConfigurable.getInstance(project);
  final List<Module> modules =
    LibraryEditingUtil.getSuitableModules(moduleStructureConfigurable, ((LibraryEx)library).getKind(), library);
  if (modules.isEmpty()) return;
  final ChooseModulesDialog
    dlg = new ChooseModulesDialog(moduleStructureConfigurable.getProject(), modules, ProjectBundle.message("choose.modules.dialog.title"),
                                  ProjectBundle
                                    .message("choose.modules.dialog.description", library.getName()));
  if (dlg.showAndGet()) {
    final List<Module> chosenModules = dlg.getChosenElements();
    for (Module module : chosenModules) {
      moduleStructureConfigurable.addLibraryOrderEntry(module, library);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:ProjectStructureValidator.java


示例2: actionPerformed

import com.intellij.openapi.roots.ui.configuration.ChooseModulesDialog; //导入依赖的package包/类
public void actionPerformed(final AnActionEvent e) {
  final Project project = e.getData(CommonDataKeys.PROJECT);
  if (project == null) return;

  List<Module> pluginModules = new ArrayList<Module>();
  for (Module aModule : ModuleManager.getInstance(project).getModules()) {
    if (PluginModuleType.isOfType(aModule)) {
      pluginModules.add(aModule);
    }
  }

  ChooseModulesDialog dialog = new ChooseModulesDialog(project,
                                                       pluginModules,
                                                       DevKitBundle.message("select.plugin.modules.title"),
                                                       DevKitBundle.message("select.plugin.modules.description"));
  if (dialog.showAndGet()) {
    doPrepare(dialog.getChosenElements(), project);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:PrepareAllToDeployAction.java


示例3: showDialogAndAddLibraryToDependencies

import com.intellij.openapi.roots.ui.configuration.ChooseModulesDialog; //导入依赖的package包/类
public static void showDialogAndAddLibraryToDependencies(final Library library, final Project project, boolean allowEmptySelection) {
  for (ProjectStructureValidator validator : EP_NAME.getExtensions()) {
    if (validator.addLibraryToDependencies(library, project, allowEmptySelection)) {
      return;
    }
  }

  final ModuleStructureConfigurable moduleStructureConfigurable = ModuleStructureConfigurable.getInstance(project);
  final List<Module> modules = LibraryEditingUtil.getSuitableModules(moduleStructureConfigurable, ((LibraryEx)library).getKind(), library);
  if (modules.isEmpty()) return;
  final ChooseModulesDialog
    dlg = new ChooseModulesDialog(moduleStructureConfigurable.getProject(), modules, ProjectBundle.message("choose.modules.dialog.title"),
                                  ProjectBundle
                                    .message("choose.modules.dialog.description", library.getName()));
  dlg.show();
  if (dlg.isOK()) {
    final List<Module> chosenModules = dlg.getChosenElements();
    for (Module module : chosenModules) {
      moduleStructureConfigurable.addLibraryOrderEntry(module, library);
    }
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:23,代码来源:ProjectStructureValidator.java


示例4: createArtifact

import com.intellij.openapi.roots.ui.configuration.ChooseModulesDialog; //导入依赖的package包/类
@Nullable
@Override
@RequiredReadAction
public NewArtifactConfiguration createArtifact()
{
	List<Module> modules = new ArrayList<>();
	for(Module module : myContext.getModulesProvider().getModules())
	{
		if(ModuleUtilCore.getExtension(module, JavaWebModuleExtension.class) != null)
		{
			modules.add(module);
		}
	}

	ChooseModulesDialog dialog = new ChooseModulesDialog(myContext.getProject(), modules, "Choose Module", "Choose Module For Artifact Creation");
	dialog.setSingleSelectionMode();
	List<Module> selectedModules = dialog.showAndGetResult();
	if(selectedModules.size() != 1)
	{
		return null;
	}
	return doCreateArtifactTemplate(modules.get(0), myContext);
}
 
开发者ID:consulo,项目名称:consulo-javaee,代码行数:24,代码来源:ExplodedWarArtifactTemplate.java


示例5: showDialogForFacets

import com.intellij.openapi.roots.ui.configuration.ChooseModulesDialog; //导入依赖的package包/类
public static AndroidFacet showDialogForFacets(Project project, List<AndroidFacet> facets) {
    List<Module> modules = Lists.newArrayList();
    String previousModuleName = getPreviousModuleName(project);
    List<Module> previousSelectedModule = null;
    for (AndroidFacet facet : facets) {
        Module module = facet.getModule();
        modules.add(module);
        if (module.getName().equals(previousModuleName)) {
            previousSelectedModule = Lists.newArrayList(module);
        }
    }

    ChooseModulesDialog dialog = new ChooseModulesDialog(project, modules, "Choose Module", "");
    dialog.setSingleSelectionMode();
    if (previousSelectedModule != null) {
        dialog.selectElements(previousSelectedModule);
    }
    dialog.show();

    List<Module> chosenElements = dialog.getChosenElements();
    if (chosenElements.isEmpty()) {
        return null;
    }

    Module chosenModule = chosenElements.get(0);
    saveModuleName(project, chosenModule.getName());
    int chosenModuleIndex = modules.indexOf(chosenModule);
    return facets.get(chosenModuleIndex);
}
 
开发者ID:zzz40500,项目名称:ADB-Duang,代码行数:30,代码来源:ModuleChooserDialogHelper.java


示例6: chooseElements

import com.intellij.openapi.roots.ui.configuration.ChooseModulesDialog; //导入依赖的package包/类
@Override
@NotNull
public List<Module> chooseElements() {
  ChooseModulesDialog dialog = new ChooseModulesDialog(myClasspathPanel.getComponent(), myItems, myTitle, myDescription);
  dialog.show();
  return dialog.getChosenElements();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:AddModuleDependencyAction.java


示例7: addRow

import com.intellij.openapi.roots.ui.configuration.ChooseModulesDialog; //导入依赖的package包/类
@Override
public void addRow() {
  final Set<Module> projectModules = new HashSet<Module>(Arrays.asList(ModuleManager.getInstance(myProject).getModules()));
  projectModules.removeAll(getAllModules());
  final ChooseModulesDialog chooser =
    new ChooseModulesDialog(ProcessedModulesTable.this, new ArrayList<Module>(projectModules), "ChooseModule");
  if (chooser.showAndGet()) {
    final List<Module> chosen = chooser.getChosenElements();
    for (Module module : chosen) {
      addElement(module, null);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:ProcessedModulesTable.java


示例8: createArtifact

import com.intellij.openapi.roots.ui.configuration.ChooseModulesDialog; //导入依赖的package包/类
@Override
public NewArtifactConfiguration createArtifact() {
  Module module = null;
  if (myModules.size() == 1) {
    module = myModules.get(0);
  } else {
    final ChooseModulesDialog dialog = new ChooseModulesDialog(myModules.get(0).getProject(), myModules,
                                                               "Select Module",
                                                               "Selected module output would to be included in the artifact");
    dialog.setSingleSelectionMode();
    if (dialog.showAndGet()) {
      final List<Module> elements = dialog.getChosenElements();
      if (elements.isEmpty()) {
        return null;
      }
      module = elements.get(0);
    }
  }
  if (module == null) return null;
  final CompositePackagingElement<?> rootElement = JavaFxApplicationArtifactType.this.createRootElement(module.getName());
  final CompositePackagingElement<?>
    subElement = PackagingElementFactory.getInstance().createArchive(FileUtil.sanitizeFileName(module.getName()) + ".jar");
  final PackagingElement<?> moduleOutputElement = PackagingElementFactory.getInstance().createModuleOutput(module);
  subElement.addFirstChild(moduleOutputElement);
  rootElement.addFirstChild(subElement);
  return new NewArtifactConfiguration(rootElement, module.getName(), JavaFxApplicationArtifactType.this);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:JavaFxApplicationArtifactType.java


示例9: addRow

import com.intellij.openapi.roots.ui.configuration.ChooseModulesDialog; //导入依赖的package包/类
@Override
public void addRow() {
  final Set<Module> projectModules = new HashSet<Module>(Arrays.asList(ModuleManager.getInstance(myProject).getModules()));
  projectModules.removeAll(getAllModules());
  final ChooseModulesDialog chooser = new ChooseModulesDialog(ProcessedModulesTable.this, new ArrayList<Module>(projectModules), "ChooseModule");
  chooser.show();
  if (chooser.isOK()) {
    final List<Module> chosen = chooser.getChosenElements();
    for (Module module : chosen) {
      addElement(module, null);
    }
  }      
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:14,代码来源:ProcessedModulesTable.java


示例10: createArtifact

import com.intellij.openapi.roots.ui.configuration.ChooseModulesDialog; //导入依赖的package包/类
@Override
public NewArtifactConfiguration createArtifact() {
  Module module = null;
  if (myModules.size() == 1) {
    module = myModules.get(0);
  } else {
    final ChooseModulesDialog dialog = new ChooseModulesDialog(myModules.get(0).getProject(), myModules,
                                                               "Select Module",
                                                               "Selected module output would to be included in the artifact");
    dialog.setSingleSelectionMode();
    dialog.show();
    if (dialog.isOK()) {
      final List<Module> elements = dialog.getChosenElements();
      if (elements.isEmpty()) {
        return null;
      }
      module = elements.get(0);
    }
  }
  if (module == null) return null;
  final CompositePackagingElement<?> rootElement = JavaFxApplicationArtifactType.this.createRootElement(module.getName());
  final CompositePackagingElement<?>
    subElement = PackagingElementFactory.getInstance().createArchive(FileUtil.sanitizeFileName(module.getName()) + ".jar");
  final PackagingElement<?> moduleOutputElement = PackagingElementFactory.getInstance().createModuleOutput(module);
  subElement.addFirstChild(moduleOutputElement);
  rootElement.addFirstChild(subElement);
  return new NewArtifactConfiguration(rootElement, module.getName(), JavaFxApplicationArtifactType.this);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:29,代码来源:JavaFxApplicationArtifactType.java


示例11: createArtifact

import com.intellij.openapi.roots.ui.configuration.ChooseModulesDialog; //导入依赖的package包/类
@Override
public NewArtifactConfiguration createArtifact()
{
	Module module = null;
	if(myModules.size() == 1)
	{
		module = myModules.get(0);
	}
	else
	{
		final ChooseModulesDialog dialog = new ChooseModulesDialog(myModules.get(0).getProject(), myModules, "Select Module", "Selected module output would to be included in the artifact");
		dialog.setSingleSelectionMode();
		dialog.show();
		if(dialog.isOK())
		{
			final List<Module> elements = dialog.getChosenElements();
			if(elements.isEmpty())
			{
				return null;
			}
			module = elements.get(0);
		}
	}
	if(module == null)
	{
		return null;
	}
	final CompositePackagingElement<?> rootElement = JavaFxApplicationArtifactType.this.createRootElement(module.getName());
	final CompositePackagingElement<?> subElement = JarArtifactType.getInstance().createRootElement(FileUtil.sanitizeFileName(module.getName()));
	final PackagingElement<?> moduleOutputElement = ProductionModuleOutputElementType.getInstance().createElement(module.getProject(), ModuleUtil.createPointer(module));
	subElement.addFirstChild(moduleOutputElement);
	rootElement.addFirstChild(subElement);
	return new NewArtifactConfiguration(rootElement, module.getName(), JavaFxApplicationArtifactType.this);
}
 
开发者ID:consulo,项目名称:consulo-javafx,代码行数:35,代码来源:JavaFxApplicationArtifactType.java


示例12: chooseModules

import com.intellij.openapi.roots.ui.configuration.ChooseModulesDialog; //导入依赖的package包/类
@Override
public List<Module> chooseModules(final List<Module> modules, final String title) {
  return new ChooseModulesDialog(getProject(), modules, title, null).showAndGetResult();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:ArtifactEditorContextImpl.java


示例13: actionPerformed

import com.intellij.openapi.roots.ui.configuration.ChooseModulesDialog; //导入依赖的package包/类
/**
 * Opens Choose Module dialog for user to select a module, then opens the appropriate App Engine
 * Framework Support dialog to add App Engine support.
 */
@Override
public void actionPerformed(AnActionEvent event) {
  Project project = event.getProject();
  if (project == null) {
    return;
  }

  List<Module> suitableModules = getModulesWithoutAppEngineSupport(project);

  String frameworkNameInTitle = getTemplatePresentation().getText();
  if (suitableModules.isEmpty()) {
    Messages.showErrorDialog(
        project,
        GctBundle.message("appengine.add.framework.support.no.modules.message", FRAMEWORK_NAME),
        GctBundle.message(
            "appengine.add.framework.support.no.modules.title", frameworkNameInTitle));
    return;
  }

  ChooseModulesDialog chooseModulesDialog =
      new ChooseModulesDialog(
          project,
          suitableModules,
          GctBundle.message("appengine.add.framework.support.choose.module.dialog.title"),
          GctBundle.message(
              "appengine.add.framework.support.choose.module.dialog.description",
              FRAMEWORK_NAME));
  chooseModulesDialog.setSingleSelectionMode();
  chooseModulesDialog.setOKActionEnabled(false);

  if (chooseModulesDialog.getPreferredFocusedComponent() instanceof JTable) {
    JTable chooseModuleTable = (JTable) chooseModulesDialog.getPreferredFocusedComponent();

    ListSelectionModel selectionModel = chooseModuleTable.getSelectionModel();
    if (selectionModel != null) {
      selectionModel.addListSelectionListener(
          e -> chooseModulesDialog.setOKActionEnabled(chooseModuleTable.getSelectedRow() != -1));
    }
  }

  chooseModulesDialog.show();

  final List<Module> elements = chooseModulesDialog.getChosenElements();
  if (!chooseModulesDialog.isOK() || elements.size() != 1) {
    return;
  }

  Module module = elements.get(0);
  AddAppEngineFrameworkSupportDialog frameworkSupportDialog =
      new AddAppEngineFrameworkSupportDialog(
          GctBundle.message("appengine.add.framework.support.dialog.title", frameworkNameInTitle),
          project,
          module,
          getModuleConfigurable(module));
  frameworkSupportDialog.show();
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-intellij,代码行数:61,代码来源:AddAppEngineFrameworkSupportAction.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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