本文整理汇总了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;
}
}
}
}
}
}
}
示例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);
}
示例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);
}
示例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 ());
}
}
示例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);
}
示例6: Category
import org.netbeans.spi.options.OptionsCategory; //导入依赖的package包/类
private Category(final String id, final OptionsCategory category) {
this.category = category;
this.id = id;
}
示例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();
}