本文整理了Java中org.nuxeo.ecm.platform.actions.Action.getCategories()
方法的一些代码示例,展示了Action.getCategories()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Action.getCategories()
方法的具体详情如下:
包路径:org.nuxeo.ecm.platform.actions.Action
类名称:Action
方法名:getCategories
暂无
代码示例来源:origin: org.nuxeo.ecm.platform/nuxeo-platform-actions-core
public synchronized Action removeAction(String id) {
if (log.isDebugEnabled()) {
log.debug("Unregistering action: " + id);
}
Action action = actions.remove(id);
if (action != null) {
for (String category : action.getCategories()) {
List<String> acts = categories.get(category);
if (acts != null) {
acts.remove(id);
}
}
}
return action;
}
代码示例来源:origin: org.nuxeo.ecm.platform/nuxeo-platform-actions-core
protected void applyCompatibility(Action finalAction) {
if (finalAction != null && finalAction.getType() == null) {
// iterate over all categories to apply compat
String[] cats = finalAction.getCategories();
if (cats != null) {
for (String cat : cats) {
if (applyCompatibility(cat, finalAction)) {
break;
}
}
}
}
}
代码示例来源:origin: org.nuxeo.ecm.platform/nuxeo-platform-actions-core
public synchronized void addAction(Action action) {
String id = action.getId();
if (log.isDebugEnabled()) {
if (actions.containsKey(id)) {
log.debug("Overriding action: " + action);
} else {
log.debug("Registering action: " + action);
}
}
// add a default label if not set
if (action.getLabel() == null) {
action.setLabel(action.getId());
}
actions.put(id, action);
for (String category : action.getCategories()) {
List<String> acts = categories.get(category);
if (acts == null) {
acts = new ArrayList<>();
}
if (!acts.contains(id)) {
acts.add(id);
}
categories.put(category, acts);
}
}
代码示例来源:origin: org.nuxeo.ecm.platform/nuxeo-platform-webapp-base
@Override
public void setCurrentSubTabAction(Action tabAction) {
if (tabAction != null) {
String[] categories = tabAction.getCategories();
if (categories == null || categories.length == 0) {
log.error("Cannot set subtab with id '" + tabAction.getId()
+ "' as this action does not hold any category");
return;
}
if (categories.length != 1) {
log.error("Setting subtab with id '" + tabAction.getId() + "' with category '" + categories[0]
+ "': use webActions#setCurrentTabAction(action, category) to specify another category");
}
setCurrentTabAction(categories[0], tabAction);
}
}
代码示例来源:origin: org.nuxeo.ecm.platform/nuxeo-platform-actions-core
Set<String> mergedCategories = new HashSet<String>(Arrays.asList(dest.getCategories()));
mergedCategories.addAll(new HashSet<String>(Arrays.asList(source.getCategories())));
dest.setCategories(mergedCategories.toArray(new String[mergedCategories.size()]));
内容来源于网络,如有侵权,请联系作者删除!