本文整理汇总了Java中org.netbeans.spi.project.ui.support.ProjectCustomizer.Category.create方法的典型用法代码示例。如果您正苦于以下问题:Java Category.create方法的具体用法?Java Category.create怎么用?Java Category.create使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.netbeans.spi.project.ui.support.ProjectCustomizer.Category
的用法示例。
在下文中一共展示了Category.create方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testDependencyWarnings
import org.netbeans.spi.project.ui.support.ProjectCustomizer.Category; //导入方法依赖的package包/类
@RandomlyFails // NB-Core-Build #4183: expected:<[ERR_excluded_dep, Module Three, suite, bar, somecluster]> but was:<null>
public void testDependencyWarnings() throws Exception { // #65924
final SuiteProperties suiteProps = new SuiteProperties(suite, suite.getHelper(), suite.getEvaluator(), Collections.<NbModuleProject>emptySet());
final Category cat = Category.create("dummy", "dummy", null);
final SuiteCustomizerLibraries[] ref = new SuiteCustomizerLibraries[1];
Runnable r = new Runnable() {
public void run() {
// OutlineView in SCL must be initialized in EQ
ref[0] = new SuiteCustomizerLibraries(suiteProps, cat);
}
};
EventQueue.invokeAndWait(r);
SuiteCustomizerLibraries scl = ref[0];
Set<SuiteCustomizerLibraries.UniverseModule> modules = SuiteCustomizerLibraries.loadUniverseModules(platform.getSortedModules(), SuiteUtils.getSubProjects(suite), Collections.<ModuleEntry>emptySet());
Set<File> allClusters = new HashSet<File>(Arrays.asList(
new File(install, "somecluster"), new File(install, "anothercluster"), ClusterUtils.getClusterDirectory(suite)));
assertEquals(null, join(scl.findWarning(modules, allClusters, Collections.<String>emptySet()).warning));
/* XXX failing, investigate:
assertEquals("[ERR_excluded_dep, baz, anothercluster, Foo Module, somecluster]",
join(scl.findWarning(modules, Collections.singleton(new File(install, "anothercluster")), Collections.<String>emptySet()).warning));
*/
assertNull(join(scl.findWarning(modules, Collections.singleton(new File(install, "somecluster")), Collections.<String>emptySet()).warning));
assertEquals("[ERR_excluded_dep, Module Three, suite, bar, somecluster]",
join(scl.findWarning(modules, allClusters, Collections.singleton("bar")).warning));
/* XXX failing, investigate:
assertEquals("[ERR_only_excluded_providers, tok1, bar, somecluster, Foo Module, somecluster]",
join(scl.findWarning(modules, Collections.singleton(ClusterUtils.getClusterDirectory(suite)), Collections.<String>emptySet()).warning));
*/
assertEquals("[ERR_only_excluded_providers, tok1, bar, somecluster, Foo Module, somecluster]",
join(scl.findWarning(modules, allClusters, Collections.singleton("foo")).warning));
assertEquals("[ERR_only_excluded_providers, tok1b, bar2, somecluster, foo2, somecluster]",
join(scl.findWarning(modules, allClusters, Collections.singleton("foo2")).warning));
// XXX much more could be tested; check coverage results
}
示例2: createCategory
import org.netbeans.spi.project.ui.support.ProjectCustomizer.Category; //导入方法依赖的package包/类
public Category createCategory(Lookup context) {
Project project = getProject(context);
ConfigFileManager manager = getConfigFileManager(project);
// Do not display the customizer if there are no Spring config files
// and the Spring library is not on the classpath.
if (manager.getConfigFiles().size() <= 0) {
if (!hasSpringOnClassPath(project)) {
return null;
}
}
String categoryName = NbBundle.getMessage(CustomizerCategoryProvider.class, "LBL_SpringFramework");
return Category.create("SpringFramework", categoryName, null); // NOI18N
}
示例3: createCategory
import org.netbeans.spi.project.ui.support.ProjectCustomizer.Category; //导入方法依赖的package包/类
@Override
public Category createCategory(Lookup context) {
Project prj = context.lookup(Project.class);
if (prj == null) return null;
return Category.create("editor.hints", Bundle.CAP_Hints(), null);
}
示例4: init
import org.netbeans.spi.project.ui.support.ProjectCustomizer.Category; //导入方法依赖的package包/类
public void init()
{
Category settings = Category.create(
"Pod Settings",
"Pod Settings",
null,
(Category[])null);
// ! panel order used in actionPerformed !
categories = new Category[]
{
settings,
};
FanProjectProperties props=project.getLookup().lookup(FanProjectProperties.class);
FanProjectPropertiesPanel settingsPanel=new FanProjectPropertiesPanel();
if(props!=null)
{
settingsPanel.setMainMethod(props.getMainMethod());
settingsPanel.setBuildTarget(props.getBuildTarget());
settingsPanel.setArgs(props.getArgs());
settingsPanel.setJvm(props.getJvmArgs());
settingsPanel.setIsTales(props.isIsTalesProject());
}
panels.put(settings, settingsPanel);
panelProvider = new PanelProvider(panels);
}
示例5: testClusterAndModuleNodesEnablement
import org.netbeans.spi.project.ui.support.ProjectCustomizer.Category; //导入方法依赖的package包/类
public void testClusterAndModuleNodesEnablement() throws Exception { // #70714
final SuiteProperties suiteProps = new SuiteProperties(suite, suite.getHelper(), suite.getEvaluator(), Collections.<NbModuleProject>emptySet());
final Category cat = Category.create("dummy", "dummy", null);
final SuiteCustomizerLibraries[] ref = new SuiteCustomizerLibraries[1];
Runnable r = new Runnable() {
public void run() {
// OutlineView in SCL must be initialized in EQ
ref[0] = new SuiteCustomizerLibraries(suiteProps, cat);
}
};
EventQueue.invokeAndWait(r);
SuiteCustomizerLibraries scl = ref[0];
SuiteCustomizerLibraries.TEST = true;
scl.refresh();
ExplorerManager mgr = scl.getExplorerManager();
assertNotNull(mgr);
Children clusters = mgr.getRootContext().getChildren();
/* XXX reenable once SCL uses Children.create w/ asynch factory:
// disable 'somecluster', all its modules should be disabled
Enabled sc = (Enabled) clusters.findChild("somecluster");
sc.setEnabled(false);
assertFalse("Cluster \"somecluster\" is enabled!", sc.isEnabled());
for (Node ch : sc.getChildren().getNodes()) {
if (ch instanceof Enabled) {
Enabled en = (Enabled) ch;
assertFalse("Module node under disabled cluster is enabled!", en.isEnabled());
}
}
// enable one of its modules, it should enable the cluster (and keep the others disabled)
Enabled bar = (Enabled) sc.getChildren().findChild("bar");
bar.setEnabled(true);
assertTrue("Cluster is disabled.", sc.isEnabled());
for (Node ch : sc.getChildren().getNodes()) {
if (ch instanceof Enabled) {
Enabled en = (Enabled) ch;
if ("bar".equals(en.getName())) {
assertTrue("Module \"bar\" is disabled!", en.isEnabled());
} else {
assertFalse("Module \"" + en.getName() + "\" is enabled!", en.isEnabled());
}
}
}
// disabling the only module of "anothercluster" should disable it as well
Enabled ac = (Enabled) clusters.findChild("anothercluster");
assertTrue("Cluster \"anothercluster\" is disabled!", ac.isEnabled());
Enabled baz = (Enabled) ac.getChildren().findChild("baz");
baz.setEnabled(false);
assertFalse("Module \"baz\" is enabled!", baz.isEnabled());
assertFalse("Cluster \"anothercluster\" is enabled!", ac.isEnabled());
// check stored EnabledClusters and DisabledModules
scl.store();
SuiteProperties props = scl.getProperties();
String[] ec = props.getEnabledClusters();
Arrays.sort(ec);
// "anothercluster" should be disabled
assertTrue("Wrong clusters disabled!", Arrays.deepEquals(ec, new String[] { "harness", "platform", "somecluster" }));
String[] dm = props.getDisabledModules();
Arrays.sort(dm);
// although "baz" has been disabled, it shouldn't appear here, as its cluster is disabled
assertTrue("Wrong modules disabled!", Arrays.deepEquals(dm, new String[] { "bar2", "foo", "foo2" }));
*/
}
示例6: createCategory
import org.netbeans.spi.project.ui.support.ProjectCustomizer.Category; //导入方法依赖的package包/类
public Category createCategory(Lookup context) {
return Category.create("one", "One", null);
}
示例7: createCategory
import org.netbeans.spi.project.ui.support.ProjectCustomizer.Category; //导入方法依赖的package包/类
public Category createCategory(Lookup context) {
return Category.create("generalInfo", //NOI18N
NbBundle.getMessage(TargetMappingPanel.class, "LBL_ProjectCustomizer_Category_General"), //NOI18N
null);
}
示例8: createCategory
import org.netbeans.spi.project.ui.support.ProjectCustomizer.Category; //导入方法依赖的package包/类
@Override
public ProjectCustomizer.Category createCategory(Lookup lookup) {
return Category.create(CATEGORY_NAME, CATEGORY_NAME, null);
}
示例9: createCategory
import org.netbeans.spi.project.ui.support.ProjectCustomizer.Category; //导入方法依赖的package包/类
@NbBundle.Messages({ "vaadinCategoryName=Vaadin",
"gwtCategoryName=Compiler and GWT",
"advancedCategoryName=Advanced Compiler and GWT",
"devModeCategoryName=Dev Mode", "jettyCategoryName=Jetty" })
@Override
public ProjectCustomizer.Category createCategory( Lookup context ) {
Project project = context.lookup(Project.class);
VaadinSupport support = project.getLookup().lookup(VaadinSupport.class);
if (support == null || !support.isEnabled()) {
return null;
}
BufferedImage image = null;
try {
image =
ImageIO.read(VaadinCustomizer.class
.getResource('/' + VaadinProjectWizardIterator.PROJECT_ICON));
}
catch (IOException ignore) {
}
if (support.isWeb()) {
Category gwt =
Category.create(GWT_COMPILER_CATEGORY,
Bundle.gwtCategoryName(), null);
Category advanced =
Category.create(ADVANCED_GWT_COMPILER_CATEGORY,
Bundle.advancedCategoryName(), null);
Category devMode =
Category.create(DEV_MODE_CATEGORY,
Bundle.devModeCategoryName(), null);
if (VaadinConfiguration.getInstance().isJettyEnabled()) {
Category jetty =
Category.create(JETTY_CATEGORY,
Bundle.jettyCategoryName(), null);
return ProjectCustomizer.Category.create(VAADIN_CATEGORY,
Bundle.vaadinCategoryName(), image, gwt, advanced,
devMode, jetty);
}
else {
return ProjectCustomizer.Category.create(VAADIN_CATEGORY,
Bundle.vaadinCategoryName(), image, gwt, advanced,
devMode);
}
}
else {
return ProjectCustomizer.Category.create(VAADIN_CATEGORY,
Bundle.vaadinCategoryName(), image);
}
}
示例10: createCategory
import org.netbeans.spi.project.ui.support.ProjectCustomizer.Category; //导入方法依赖的package包/类
@Override
public Category createCategory(Lookup context) {
Project prj = context.lookup(Project.class);
if (prj == null) return null;
Standard settings = findStandardSettings(prj.getLookup());
if (settings == null) return null;
return Category.create("editor.hints", Bundle.CAP_Hints(), null);
}