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


Java Category类代码示例

本文整理汇总了Java中org.netbeans.spi.project.ui.support.ProjectCustomizer.Category的典型用法代码示例。如果您正苦于以下问题:Java Category类的具体用法?Java Category怎么用?Java Category使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Category类属于org.netbeans.spi.project.ui.support.ProjectCustomizer包,在下文中一共展示了Category类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createCustomizerPane

import org.netbeans.spi.project.ui.support.ProjectCustomizer.Category; //导入依赖的package包/类
/** Creates standard innerPane for customizer dialog.
 */
private static CustomizerPane createCustomizerPane( Category[] categories,
                                            CategoryComponentProvider componentProvider,
                                            String preselectedCategory ) {
    
    CategoryChangeSupport changeSupport = new CategoryChangeSupport();
    registerCategoryChangeSupport(changeSupport, categories);
    
    CategoryModel categoryModel = new CategoryModel( categories );
    JPanel categoryView = new CategoryView( categoryModel );
    CustomizerPane customizerPane = new CustomizerPane( categoryView, categoryModel, componentProvider );
    
    if ( preselectedCategory == null ) {
        preselectedCategory = categories[0].getName();
    }
    
    Category c = categoryModel.getCategory( preselectedCategory );
    if ( c != null ) {
        categoryModel.setCurrentCategory( c );
    }
    
    return customizerPane;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:25,代码来源:ProjectCustomizer.java

示例2: createCategory

import org.netbeans.spi.project.ui.support.ProjectCustomizer.Category; //导入依赖的package包/类
public Category createCategory(Lookup context) {
    AuxiliaryConfiguration aux = context.lookup(AuxiliaryConfiguration.class);
    final ProjectAccessor acc = context.lookup(ProjectAccessor.class);
    Project project = context.lookup(Project.class);
    assert aux != null;
    assert acc != null;
    assert project != null;
    if (LookupProviderImpl.isMyProject(aux)) {
        Category cat = ProjectCustomizer.Category.create("SourceFolders", //NOI18N
                NbBundle.getMessage(ClasspathPanel.class, "LBL_ProjectCustomizer_Category_Sources"), null);
        final ProjectModel pm = ProjectModel.createModel(Util.getProjectLocation(acc.getHelper(), acc.getEvaluator()), 
                FileUtil.toFile(project.getProjectDirectory()), acc.getEvaluator(), acc.getHelper());
        InstanceContent ic = context.lookup(InstanceContent.class);
        assert ic != null;
        ic.add(pm);
        cat.setOkButtonListener(new ActionListener() {
            public void actionPerformed(ActionEvent arg0) {
               // store changes always because model could be modified in ClasspathPanel or OutputPanel
                ProjectModel.saveProject(acc.getHelper(), pm);                
            }
        });
        return cat;
    }
    return null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:26,代码来源:SourceFoldersCategoryProvider.java

示例3: createCategory

import org.netbeans.spi.project.ui.support.ProjectCustomizer.Category; //导入依赖的package包/类
@Messages("LBL_InstallerPanel=Installer")
@Override
    public Category createCategory(Lookup context) {
    Project project = context.lookup(Project.class);
    NbMavenProject watcher = project.getLookup().lookup(NbMavenProject.class);
    if (watcher!=null &&
            NbMavenProject.TYPE_NBM_APPLICATION.equalsIgnoreCase(watcher.getPackagingType())) {
        String version = PluginPropertyUtils.getPluginVersion(watcher.getMavenProject(), "org.codehaus.mojo", "nbm-maven-plugin");
        if (version == null || new ComparableVersion(version).compareTo(new ComparableVersion("3.7-SNAPSHOT")) >= 0) {
            return null; // now handled by maven.apisupport
        }
        return ProjectCustomizer.Category.create(
                "Installer",
                LBL_InstallerPanel(),
                null,
                (ProjectCustomizer.Category[])null);
    }
    return null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:20,代码来源:ExtraPanel.java

示例4: createComponent

import org.netbeans.spi.project.ui.support.ProjectCustomizer.Category; //导入依赖的package包/类
public JComponent createComponent(Category category, Lookup context) {
    Project project = context.lookup(Project.class);
    ProjectAccessor acc = context.lookup(ProjectAccessor.class);
    AuxiliaryConfiguration aux = context.lookup(AuxiliaryConfiguration.class);
    assert aux != null;
    assert acc != null;
    assert project != null;
    
    List<TargetDescriptor> extraTargets = new ArrayList<TargetDescriptor>();
    for (ProjectNature pn : FreeformProject.PROJECT_NATURES.allInstances()) {
        extraTargets.addAll(pn.getExtraTargets(project, acc.getHelper(), acc.getEvaluator(), aux));
    }
    
    TargetMappingPanel panel = new TargetMappingPanel(extraTargets, acc.getEvaluator(), acc.getHelper());
    category.setOkButtonListener(panel.getCustomizerOkListener());
    return panel;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:18,代码来源:TargetMappingCategoryProvider.java

示例5: createCategory

import org.netbeans.spi.project.ui.support.ProjectCustomizer.Category; //导入依赖的package包/类
@Override
public Category createCategory(Lookup context) {
    Project project = context.lookup(Project.class);
    NbMavenProject watcher = project.getLookup().lookup(NbMavenProject.class);
    String effPackaging = watcher.getPackagingType();
    String[] types = PluginPropertyUtils.getPluginPropertyList(project, OSGiConstants.GROUPID_FELIX, OSGiConstants.ARTIFACTID_BUNDLE_PLUGIN, "supportedProjectTypes", "supportedProjectType", /*"bundle" would not work for GlassFish parent POM*/null);
    if (types != null) {
        for (String type : types) {
            if (effPackaging.equals(type)) {
                effPackaging = NbMavenProject.TYPE_OSGI;
            }
        }
    }
    if (NbMavenProject.TYPE_OSGI.equalsIgnoreCase(effPackaging)) {
        return ProjectCustomizer.Category.create(
                ModelHandle2.PANEL_COMPILE,
                org.openide.util.NbBundle.getMessage(PackagesPanelProvider.class, "TIT_Packages"),
                null);
    }
    return null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:PackagesPanelProvider.java

示例6: createComponent

import org.netbeans.spi.project.ui.support.ProjectCustomizer.Category; //导入依赖的package包/类
@Override
public JComponent createComponent(Category category, Lookup lkp) {
    Project project = Utilities.actionsGlobalContext().lookup(Project.class);
    PanelMainProperties panelMainProperties = new PanelMainProperties(project);
    category.setOkButtonListener((ActionEvent e) -> {
        try {
            String runPort = panelMainProperties.getRunPort();
            String debugPort = panelMainProperties.getDebugPort();
            String parameters = panelMainProperties.getParameters();
            
            ProjectSpecificSettings settings = new ProjectSpecificSettings(project.getProjectDirectory().getPath());
            settings.setValue(KEYS_RUN_PORT, runPort, false);
            settings.setValue(KEYS_DEBUG_PORT, debugPort, false);
            settings.setValue(KEYS_COMMAND_PARAMETERS, parameters, false);
            
            settings.store();
        } catch (IOException ex) {
            ExceptionManager.logException(ex);
        }
    });
    return panelMainProperties;
}
 
开发者ID:pedrohidalgo,项目名称:pleasure,代码行数:23,代码来源:MainProjectProperties.java

示例7: createComponent

import org.netbeans.spi.project.ui.support.ProjectCustomizer.Category; //导入依赖的package包/类
@Override
public JComponent createComponent(final Category category, final Lookup lkp) {
    Preferences projectPreferences = ProjectUtils.getPreferences(lkp.lookup(Project.class), EclipseFormatterPanel46.class, true);
    final EclipseFormatterPanel46 configPanel = new EclipseFormatterPanel46(projectPreferences, true);
    final ProjectSpecificSettingsPanel projectSpecificSettingsPanel = new ProjectSpecificSettingsPanel(configPanel, projectPreferences);
    configPanel.load();
    projectSpecificSettingsPanel.load();

    category.setStoreListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            configPanel.store();
            projectSpecificSettingsPanel.store();
        }
    });

    listener = new Listener(category, projectSpecificSettingsPanel);
    configPanel.addChangeListener(WeakListeners.change(listener, configPanel));
    projectSpecificSettingsPanel.addChangeListener(WeakListeners.change(listener, projectSpecificSettingsPanel));
    return projectSpecificSettingsPanel;
}
 
开发者ID:markiewb,项目名称:eclipsecodeformatter_for_netbeans,代码行数:22,代码来源:EclipseFormatterCustomizerTab.java

示例8: createCategory

import org.netbeans.spi.project.ui.support.ProjectCustomizer.Category; //导入依赖的package包/类
@Override
public Category createCategory(Lookup context) {
    boolean fxProjectEnabled = true;
    final Project project = context.lookup(Project.class);
    if (project != null) {
        final J2SEPropertyEvaluator j2sepe = project.getLookup().lookup(J2SEPropertyEvaluator.class);
        fxProjectEnabled = JFXProjectProperties.isTrue(j2sepe.evaluator().getProperty(JFXProjectProperties.JAVAFX_ENABLED)) //NOI18N
                && !JFXProjectProperties.isTrue(j2sepe.evaluator().getProperty(JFXProjectProperties.JAVAFX_PRELOADER)); //NOI18N
    }
    if(fxProjectEnabled) {
        return ProjectCustomizer.Category.create(CAT_RUN,
                NbBundle.getMessage(JFXRunCategoryProvider.class, "LBL_Category_Run"), null); //NOI18N
    }
    return null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:JFXRunCategoryProvider.java

示例9: 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
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:35,代码来源:SuiteCustomizerLibrariesTest.java

示例10: createCategory

import org.netbeans.spi.project.ui.support.ProjectCustomizer.Category; //导入依赖的package包/类
@Override
@Messages("TIT_Packages=Public Packages")
public Category createCategory(Lookup context) {
    Project project = context.lookup(Project.class);
    NbMavenProject watcher = project.getLookup().lookup(NbMavenProject.class);
    if (NbMavenProject.TYPE_NBM.equalsIgnoreCase(watcher.getPackagingType())) {
        return ProjectCustomizer.Category.create(
                ModelHandle2.PANEL_COMPILE,
                TIT_Packages(),
                null);
    }
    return null;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:PackagesPanelProvider.java

示例11: 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
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:CustomizerCategoryProvider.java

示例12: createComponent

import org.netbeans.spi.project.ui.support.ProjectCustomizer.Category; //导入依赖的package包/类
public JComponent createComponent(Category category, Lookup context) {
    Project project = getProject(context);
    ConfigFileManager manager = getConfigFileManager(project);
    SpringCustomizerPanel panel = new SpringCustomizerPanel(project, manager.getConfigFiles(), manager.getConfigFileGroups());
    CategoryListener listener = new CategoryListener(manager, panel);
    category.setOkButtonListener(listener);
    category.setStoreListener(listener);
    return panel;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:CustomizerCategoryProvider.java

示例13: registerCategoryChangeSupport

import org.netbeans.spi.project.ui.support.ProjectCustomizer.Category; //导入依赖的package包/类
private static void registerCategoryChangeSupport(final CategoryChangeSupport changeSupport, 
        final Category[] categories) {        
    for (int i = 0; i < categories.length; i++) {
        Utilities.putCategoryChangeSupport(categories[i], changeSupport);
        Category[] subCategories = categories[i].getSubcategories();
        if (subCategories != null) {
            registerCategoryChangeSupport(changeSupport, subCategories);
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:ProjectCustomizer.java

示例14: Category

import org.netbeans.spi.project.ui.support.ProjectCustomizer.Category; //导入依赖的package包/类
/** Private constructor. See the factory method.
 */
private Category( String name,
                 String displayName,
                 Image icon,
                 Category[] subcategories ) {
    
    this.name = name;
    this.displayName = displayName;
    this.icon = icon;
    this.subcategories = subcategories;
    this.valid = true; // default
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:ProjectCustomizer.java

示例15: includeSubcats

import org.netbeans.spi.project.ui.support.ProjectCustomizer.Category; //导入依赖的package包/类
private void includeSubcats(ProjectCustomizer.Category[] cats, ProjectCustomizer.CompositeCategoryProvider provider) {
    if (cats != null) {
        for (ProjectCustomizer.Category cat : cats) {
            category2provider.put(cat, provider);
            includeSubcats(cat.getSubcategories(), provider);
        }
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:ProjectCustomizer.java


注:本文中的org.netbeans.spi.project.ui.support.ProjectCustomizer.Category类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。