本文整理汇总了Java中com.intellij.ide.util.projectWizard.ModuleBuilder.getAllBuilders方法的典型用法代码示例。如果您正苦于以下问题:Java ModuleBuilder.getAllBuilders方法的具体用法?Java ModuleBuilder.getAllBuilders怎么用?Java ModuleBuilder.getAllBuilders使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.ide.util.projectWizard.ModuleBuilder
的用法示例。
在下文中一共展示了ModuleBuilder.getAllBuilders方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getGroups
import com.intellij.ide.util.projectWizard.ModuleBuilder; //导入方法依赖的package包/类
@NotNull
@Override
public String[] getGroups() {
List<ModuleBuilder> builders = ModuleBuilder.getAllBuilders();
Set<String> groups = ContainerUtil.map2Set(builders, new Function<ModuleBuilder, String>() {
@Override
public String fun(ModuleBuilder builder) {
return builder.getGroupName();
}
});
HashSet<String> set = new HashSet<String>(groups);
set.add(OTHER_GROUP);
return ArrayUtil.toStringArray(set);
}
示例2: createTemplates
import com.intellij.ide.util.projectWizard.ModuleBuilder; //导入方法依赖的package包/类
@NotNull
@Override
public ProjectTemplate[] createTemplates(final String group, WizardContext context) {
if (OTHER_GROUP.equals(group)) {
if (!context.isCreatingNewProject()) {
return ProjectTemplate.EMPTY_ARRAY;
}
return new ProjectTemplate[]{new BuilderBasedTemplate(new EmptyModuleBuilder() {
@Override
public String getPresentableName() {
return "Empty Project";
}
@Override
public String getDescription() {
return "Empty project without modules. Use it to create free-style module structure.";
}
})};
}
List<ModuleBuilder> builders = ModuleBuilder.getAllBuilders();
List<ProjectTemplate> templates = ContainerUtil.mapNotNull(builders, new NullableFunction<ModuleBuilder, ProjectTemplate>() {
@Nullable
@Override
public ProjectTemplate fun(ModuleBuilder builder) {
return builder.getGroupName().equals(group) ? new BuilderBasedTemplate(builder) : null;
}
});
return templates.toArray(new ProjectTemplate[templates.size()]);
}
示例3: getGroupIcon
import com.intellij.ide.util.projectWizard.ModuleBuilder; //导入方法依赖的package包/类
@Override
public Icon getGroupIcon(String group) {
List<ModuleBuilder> builders = ModuleBuilder.getAllBuilders();
for (ModuleBuilder builder : builders) {
if (group.equals(builder.getGroupName())) {
return builder.getNodeIcon();
}
}
return null;
}
示例4: getGroupWeight
import com.intellij.ide.util.projectWizard.ModuleBuilder; //导入方法依赖的package包/类
@Override
public int getGroupWeight(String group) {
List<ModuleBuilder> builders = ModuleBuilder.getAllBuilders();
for (int i = 0; i < builders.size(); i++) {
if (group.equals(builders.get(i).getGroupName())) {
return builders.size() - i;
}
}
return 0;
}