本文整理汇总了Java中com.intellij.openapi.keymap.impl.ui.ActionsTreeUtil.createGroup方法的典型用法代码示例。如果您正苦于以下问题:Java ActionsTreeUtil.createGroup方法的具体用法?Java ActionsTreeUtil.createGroup怎么用?Java ActionsTreeUtil.createGroup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.openapi.keymap.impl.ui.ActionsTreeUtil
的用法示例。
在下文中一共展示了ActionsTreeUtil.createGroup方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: readExternal
import com.intellij.openapi.keymap.impl.ui.ActionsTreeUtil; //导入方法依赖的package包/类
@Override
public void readExternal(Element element) throws InvalidDataException {
myGroupPath = new ArrayList<String>();
for (Object o : element.getChildren(PATH)) {
myGroupPath.add(((Element)o).getAttributeValue(VALUE));
}
final String attributeValue = element.getAttributeValue(VALUE);
if (element.getAttributeValue(IS_ACTION) != null) {
myComponent = attributeValue;
}
else if (element.getAttributeValue(SEPARATOR) != null) {
myComponent = Separator.getInstance();
}
else if (element.getAttributeValue(IS_GROUP) != null) {
final AnAction action = ActionManager.getInstance().getAction(attributeValue);
myComponent = action instanceof ActionGroup
? ActionsTreeUtil.createGroup((ActionGroup)action, true, null)
: new Group(attributeValue, attributeValue, null);
}
myActionType = Integer.parseInt(element.getAttributeValue(ACTION_TYPE));
myAbsolutePosition = Integer.parseInt(element.getAttributeValue(POSITION));
DefaultJDOMExternalizer.readExternal(this, element);
}
示例2: readExternal
import com.intellij.openapi.keymap.impl.ui.ActionsTreeUtil; //导入方法依赖的package包/类
public void readExternal(Element element) throws InvalidDataException {
myGroupPath = new ArrayList<String>();
for (Object o : element.getChildren(PATH)) {
myGroupPath.add(((Element)o).getAttributeValue(VALUE));
}
final String attributeValue = element.getAttributeValue(VALUE);
if (element.getAttributeValue(IS_ACTION) != null) {
myComponent = attributeValue;
}
else if (element.getAttributeValue(SEPARATOR) != null) {
myComponent = Separator.getInstance();
}
else if (element.getAttributeValue(IS_GROUP) != null) {
final AnAction action = ActionManager.getInstance().getAction(attributeValue);
myComponent = action instanceof ActionGroup
? ActionsTreeUtil.createGroup((ActionGroup)action, true, null)
: new Group(attributeValue, attributeValue, null);
}
myActionType = Integer.parseInt(element.getAttributeValue(ACTION_TYPE));
myAbsolutePosition = Integer.parseInt(element.getAttributeValue(POSITION));
DefaultJDOMExternalizer.readExternal(this, element);
}
示例3: readExternal
import com.intellij.openapi.keymap.impl.ui.ActionsTreeUtil; //导入方法依赖的package包/类
public void readExternal(Element element) throws InvalidDataException {
myGroupPath = new ArrayList<String>();
for (Object o : element.getChildren(PATH)) {
myGroupPath.add(((Element)o).getAttributeValue(VALUE));
}
final String attributeValue = element.getAttributeValue(VALUE);
if (element.getAttributeValue(IS_ACTION) != null) {
myComponent = attributeValue;
}
else if (element.getAttributeValue(SEPARATOR) != null) {
myComponent = AnSeparator.getInstance();
}
else if (element.getAttributeValue(IS_GROUP) != null) {
final AnAction action = ActionManager.getInstance().getAction(attributeValue);
myComponent = action instanceof ActionGroup
? ActionsTreeUtil.createGroup((ActionGroup)action, true, null)
: new Group(attributeValue, attributeValue, null);
}
myActionType = Integer.parseInt(element.getAttributeValue(ACTION_TYPE));
myAbsolutePosition = Integer.parseInt(element.getAttributeValue(POSITION));
DefaultJDOMExternalizer.readExternal(this, element);
}
示例4: addAction
import com.intellij.openapi.keymap.impl.ui.ActionsTreeUtil; //导入方法依赖的package包/类
private static void addAction(KeymapGroup result, AnAction action, Condition<AnAction> filtered, boolean forceNonPopup) {
if (action instanceof ActionGroup) {
if (forceNonPopup) {
AnAction[] actions = getActions((ActionGroup)action);
for (AnAction childAction : actions) {
addAction(result, childAction, filtered, true);
}
}
else {
Group subGroup = ActionsTreeUtil.createGroup((ActionGroup)action, false, filtered);
if (subGroup.getSize() > 0) {
result.addGroup(subGroup);
}
}
}
else if (action instanceof Separator) {
if (result instanceof Group) {
((Group)result).addSeparator();
}
}
else {
if (filtered == null || filtered.value(action)) {
String id = action instanceof ActionStub ? ((ActionStub)action).getId() : ActionManager.getInstance().getId(action);
result.addActionId(id);
}
}
}
示例5: createGroup
import com.intellij.openapi.keymap.impl.ui.ActionsTreeUtil; //导入方法依赖的package包/类
public KeymapGroup createGroup(final Condition<AnAction> filtered, final Project project) {
KeymapGroup result = KeymapGroupFactory.getInstance().createGroup(KeyMapBundle.message("version.control.group.title"));
ActionGroup versionControls = (ActionGroup)ActionManager.getInstance().getActionOrStub("VcsGroup");
AnAction[] mainMenuTopGroups = versionControls instanceof DefaultActionGroup
? ((DefaultActionGroup)versionControls).getChildActionsOrStubs()
: versionControls.getChildren(null);
for (AnAction action : mainMenuTopGroups) {
Group subGroup = ActionsTreeUtil.createGroup((ActionGroup)action, false, filtered);
if (subGroup.getSize() > 0) {
result.addGroup(subGroup);
}
}
return result;
}
示例6: addAction
import com.intellij.openapi.keymap.impl.ui.ActionsTreeUtil; //导入方法依赖的package包/类
private static void addAction(KeymapGroup result, AnAction action, Condition<AnAction> filtered, boolean forceNonPopup) {
if (action instanceof ActionGroup) {
if (forceNonPopup) {
AnAction[] actions = getActions((ActionGroup)action);
for (AnAction childAction : actions) {
addAction(result, childAction, filtered, true);
}
}
else {
Group subGroup = ActionsTreeUtil.createGroup((ActionGroup)action, false, filtered);
if (subGroup.getSize() > 0) {
result.addGroup(subGroup);
}
}
}
else if (action instanceof AnSeparator) {
if (result instanceof Group) {
((Group)result).addSeparator();
}
}
else {
if (filtered == null || filtered.value(action)) {
String id = action instanceof ActionStub ? ((ActionStub)action).getId() : ActionManager.getInstance().getId(action);
result.addActionId(id);
}
}
}