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


Java OptionsCategory类代码示例

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


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

示例1: evaluate

import org.netbeans.spi.options.OptionsCategory; //导入依赖的package包/类
@Override
   public void evaluate(SearchRequest request, SearchResponse response) {
readKeywordsFromNewAnnotation();
       for (Lookup.Item<OptionsCategory> entry : getODCategories()) {
           for (Map.Entry<String, Set<String>> kw : getKeywords(entry).entrySet()) {
               for (String keywords : kw.getValue()) {
	    for (String keyword : Arrays.asList(keywords.split(","))) {
		if (keyword.toLowerCase().indexOf(request.getText().toLowerCase()) > -1) {
		    String path = entry.getId().substring(entry.getId().indexOf("/") + 1);  // NOI18N
		    if (kw.getKey().contains("/")) {
			path = path + kw.getKey().substring(kw.getKey().indexOf("/")); //NOI18N
		    }
		    if (!response.addResult(new OpenOption(path), keyword)) {
			return;
		    }
		}
	    }
               }
           }
       }
   }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:22,代码来源:QuickSearchProvider.java

示例2: loadOptionsCategories

import org.netbeans.spi.options.OptionsCategory; //导入依赖的package包/类
private Map<String, OptionsCategory> loadOptionsCategories() {
    Lookup lookup = Lookups.forPath(OD_LAYER_FOLDER_NAME);
    if (result != null) {
        result.removeLookupListener(this);
    }
    result = lookup.lookup(new Lookup.Template<OptionsCategory>(OptionsCategory.class));
    Map<String, OptionsCategory> m = new LinkedHashMap<String, OptionsCategory>();
    for (Iterator<? extends Lookup.Item<OptionsCategory>> it = result.allItems().iterator(); it.hasNext();) {
        Lookup.Item<OptionsCategory> item = it.next();
        m.put(item.getId().substring(OD_LAYER_FOLDER_NAME.length() + 1), item.getInstance());
    }
    return Collections.unmodifiableMap(m);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:14,代码来源:CategoryModel.java

示例3: getSelectedSubcategory

import org.netbeans.spi.options.OptionsCategory; //导入依赖的package包/类
/** Returns display name of subcategory selected in AdvancedPanel. */
private String getSelectedSubcategory(Class<? extends OptionsCategory> categoryClass) throws Exception {
    OptionsCategory category = lookup.lookup(categoryClass);
    Method getAdvancedPanelMethod = AdvancedPanelController.class.getDeclaredMethod("getAdvancedPanel", (Class[])null);
    getAdvancedPanelMethod.setAccessible(true);
    AdvancedPanel advancedPanel = (AdvancedPanel)getAdvancedPanelMethod.invoke(category.create(), (Object[])null);
    Method getSelectedDisplayNameMethod = AdvancedPanel.class.getDeclaredMethod("getSelectedDisplayName", (Class[])null);
    getSelectedDisplayNameMethod.setAccessible(true);
    return (String) getSelectedDisplayNameMethod.invoke(advancedPanel, (Object[])null);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:11,代码来源:OptionsDisplayerOpenTest.java

示例4: testOptionsCategories

import org.netbeans.spi.options.OptionsCategory; //导入依赖的package包/类
public void testOptionsCategories () {
    for(OptionsCategory oc : getCategories()) {
        assertNotNull (oc.getCategoryName ());
        assertNotNull (oc.getIcon());
        assertNotNull (oc.getTitle ());
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:8,代码来源:EditorOptionsTest.java

示例5: getCategories

import org.netbeans.spi.options.OptionsCategory; //导入依赖的package包/类
private Collection<? extends OptionsCategory> getCategories () {
//        FileObject fo = FileUtil.getConfigFile ("OptionsDialog");
//        Lookup lookup = new FolderLookup (DataFolder.findFolder (fo)).
//            getLookup ();
//        return new ArrayList (lookup.lookup (
//            new Lookup.Template (OptionsCategory.class)
//        ).allInstances ());
        return Lookups.forPath("OptionsDialog").lookupAll(OptionsCategory.class);
    }
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:EditorOptionsTest.java

示例6: Category

import org.netbeans.spi.options.OptionsCategory; //导入依赖的package包/类
private Category(final String id, final OptionsCategory category) {
    this.category = category;
    this.id = id;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:5,代码来源:CategoryModel.java

示例7: getODCategories

import org.netbeans.spi.options.OptionsCategory; //导入依赖的package包/类
private Iterable<? extends Lookup.Item<OptionsCategory>> getODCategories() {
    Lookup lookup = Lookups.forPath(CategoryModel.OD_LAYER_FOLDER_NAME);
    Lookup.Result<OptionsCategory> result = lookup.lookupResult(OptionsCategory.class);
    return result.allItems();
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:6,代码来源:QuickSearchProvider.java


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