本文整理汇总了Java中com.intellij.openapi.keymap.impl.ui.ActionsTreeUtil类的典型用法代码示例。如果您正苦于以下问题:Java ActionsTreeUtil类的具体用法?Java ActionsTreeUtil怎么用?Java ActionsTreeUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ActionsTreeUtil类属于com.intellij.openapi.keymap.impl.ui包,在下文中一共展示了ActionsTreeUtil类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: CustomActionsSchema
import com.intellij.openapi.keymap.impl.ui.ActionsTreeUtil; //导入依赖的package包/类
public CustomActionsSchema() {
myIdToNameList.add(new Pair(IdeActions.GROUP_MAIN_MENU, ActionsTreeUtil.MAIN_MENU_TITLE));
myIdToNameList.add(new Pair(IdeActions.GROUP_MAIN_TOOLBAR, ActionsTreeUtil.MAIN_TOOLBAR));
myIdToNameList.add(new Pair(IdeActions.GROUP_EDITOR_POPUP, ActionsTreeUtil.EDITOR_POPUP));
myIdToNameList.add(new Pair(IdeActions.GROUP_EDITOR_GUTTER, "Editor Gutter Popup Menu"));
myIdToNameList.add(new Pair(IdeActions.GROUP_EDITOR_TAB_POPUP, ActionsTreeUtil.EDITOR_TAB_POPUP));
myIdToNameList.add(new Pair(IdeActions.GROUP_PROJECT_VIEW_POPUP, ActionsTreeUtil.PROJECT_VIEW_POPUP));
myIdToNameList.add(new Pair(IdeActions.GROUP_SCOPE_VIEW_POPUP, "Scope View Popup Menu"));
myIdToNameList.add(new Pair(IdeActions.GROUP_FAVORITES_VIEW_POPUP, ActionsTreeUtil.FAVORITES_POPUP));
myIdToNameList.add(new Pair(IdeActions.GROUP_COMMANDER_POPUP, ActionsTreeUtil.COMMANDER_POPUP));
myIdToNameList.add(new Pair(IdeActions.GROUP_J2EE_VIEW_POPUP, ActionsTreeUtil.J2EE_POPUP));
myIdToNameList.add(new Pair(IdeActions.GROUP_NAVBAR_POPUP, "Navigation Bar"));
myIdToNameList.add(new Pair("NavBarToolBar", "Navigation Bar Toolbar"));
CustomizableActionGroupProvider.CustomizableActionGroupRegistrar registrar =
new CustomizableActionGroupProvider.CustomizableActionGroupRegistrar() {
@Override
public void addCustomizableActionGroup(@NotNull String groupId, @NotNull String groupTitle) {
myIdToNameList.add(new Pair(groupId, groupTitle));
}
};
for (CustomizableActionGroupProvider provider : CustomizableActionGroupProvider.EP_NAME.getExtensions()) {
provider.registerGroups(registrar);
}
}
示例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 = 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);
}
示例4: 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);
}
示例5: CustomActionsSchema
import com.intellij.openapi.keymap.impl.ui.ActionsTreeUtil; //导入依赖的package包/类
public CustomActionsSchema() {
myIdToNameList.add(new Pair(IdeActions.GROUP_MAIN_MENU, ActionsTreeUtil.MAIN_MENU_TITLE));
myIdToNameList.add(new Pair(IdeActions.GROUP_MAIN_TOOLBAR, ActionsTreeUtil.MAIN_TOOLBAR));
myIdToNameList.add(new Pair(IdeActions.GROUP_EDITOR_POPUP, ActionsTreeUtil.EDITOR_POPUP));
myIdToNameList.add(new Pair(IdeActions.GROUP_EDITOR_GUTTER, "Editor Gutter Popup Menu"));
myIdToNameList.add(new Pair(IdeActions.GROUP_EDITOR_TAB_POPUP, ActionsTreeUtil.EDITOR_TAB_POPUP));
myIdToNameList.add(new Pair(IdeActions.GROUP_PROJECT_VIEW_POPUP, ActionsTreeUtil.PROJECT_VIEW_POPUP));
myIdToNameList.add(new Pair(IdeActions.GROUP_SCOPE_VIEW_POPUP, "Scope View Popup Menu"));
myIdToNameList.add(new Pair(IdeActions.GROUP_FAVORITES_VIEW_POPUP, ActionsTreeUtil.FAVORITES_POPUP));
myIdToNameList.add(new Pair(IdeActions.GROUP_COMMANDER_POPUP, ActionsTreeUtil.COMMANDER_POPUP));
myIdToNameList.add(new Pair(IdeActions.GROUP_J2EE_VIEW_POPUP, ActionsTreeUtil.J2EE_POPUP));
myIdToNameList.add(new Pair(IdeActions.GROUP_NAVBAR_POPUP, "Navigation Bar"));
myIdToNameList.add(new Pair("NavBarToolBar", "Navigation Bar Toolbar"));
CustomizableActionGroupProvider.CustomizableActionGroupRegistrar registrar = new CustomizableActionGroupProvider.CustomizableActionGroupRegistrar() {
@Override
public void addCustomizableActionGroup(@Nonnull String groupId, @Nonnull String groupTitle) {
myIdToNameList.add(new Pair(groupId, groupTitle));
}
};
for (CustomizableActionGroupProvider provider : CustomizableActionGroupProvider.EP_NAME.getExtensions()) {
provider.registerGroups(registrar);
}
}
示例6: addPathToActionsTree
import com.intellij.openapi.keymap.impl.ui.ActionsTreeUtil; //导入依赖的package包/类
private static void addPathToActionsTree(JTree tree, ActionUrl url) {
final TreePath treePath = CustomizationUtil.getTreePath(tree, url);
if (treePath == null) return;
DefaultMutableTreeNode node = (DefaultMutableTreeNode)treePath.getLastPathComponent();
final int absolutePosition = url.getAbsolutePosition();
if (node.getChildCount() >= absolutePosition && absolutePosition >= 0) {
if (url.getComponent() instanceof Group){
node.insert(ActionsTreeUtil.createNode((Group)url.getComponent()), absolutePosition);
} else {
node.insert(new DefaultMutableTreeNode(url.getComponent()), absolutePosition);
}
}
}
示例7: fillActionGroups
import com.intellij.openapi.keymap.impl.ui.ActionsTreeUtil; //导入依赖的package包/类
public void fillActionGroups(DefaultMutableTreeNode root){
final ActionManager actionManager = ActionManager.getInstance();
for (Pair pair : myIdToNameList) {
final ActionGroup actionGroup = (ActionGroup)actionManager.getAction(pair.first);
if (actionGroup != null) { //J2EE/Commander plugin was disabled
root.add(ActionsTreeUtil.createNode(ActionsTreeUtil.createGroup(actionGroup, pair.second, null, null, true, null, false)));
}
}
}
示例8: 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);
}
}
}
示例9: 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;
}
示例10: fillActionGroups
import com.intellij.openapi.keymap.impl.ui.ActionsTreeUtil; //导入依赖的package包/类
public void fillActionGroups(DefaultMutableTreeNode root) {
final ActionManager actionManager = ActionManager.getInstance();
for (Pair pair : myIdToNameList) {
final ActionGroup actionGroup = (ActionGroup)actionManager.getAction(pair.first);
if (actionGroup != null) { //J2EE/Commander plugin was disabled
root.add(ActionsTreeUtil.createNode(ActionsTreeUtil.createGroup(actionGroup, pair.second, null, null, true, null, false)));
}
}
}
示例11: 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);
}
}
}
示例12: isToolbarAction
import com.intellij.openapi.keymap.impl.ui.ActionsTreeUtil; //导入依赖的package包/类
private static boolean isToolbarAction(DefaultMutableTreeNode node) {
return node.getParent() != null && ((DefaultMutableTreeNode)node.getParent()).getUserObject() instanceof Group &&
((Group)((DefaultMutableTreeNode)node.getParent()).getUserObject()).getName().equals(ActionsTreeUtil.MAIN_TOOLBAR);
}