本文整理汇总了Java中com.intellij.openapi.roots.ui.configuration.ChooseModulesDialog.setSingleSelectionMode方法的典型用法代码示例。如果您正苦于以下问题:Java ChooseModulesDialog.setSingleSelectionMode方法的具体用法?Java ChooseModulesDialog.setSingleSelectionMode怎么用?Java ChooseModulesDialog.setSingleSelectionMode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.roots.ui.configuration.ChooseModulesDialog
的用法示例。
在下文中一共展示了ChooseModulesDialog.setSingleSelectionMode方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
示例2: 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);
}
示例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();
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);
}
示例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 = 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);
}
示例5: 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);
}
示例6: 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