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


Java ChooseModulesDialog.isOK方法代码示例

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


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

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

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

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

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