当前位置: 首页>>代码示例>>Java>>正文


Java ChooseModulesDialog.getChosenElements方法代码示例

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


在下文中一共展示了ChooseModulesDialog.getChosenElements方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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

示例3: 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

示例4: 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

示例5: 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

示例6: 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

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

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

示例9: 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

示例10: 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.getChosenElements方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。