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


Java ActionsTreeUtil类代码示例

本文整理汇总了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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:ActionUrl.java

示例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);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:CustomActionsSchema.java

示例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);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:23,代码来源:ActionUrl.java

示例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);
}
 
开发者ID:consulo,项目名称:consulo,代码行数:23,代码来源:ActionUrl.java

示例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);
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:25,代码来源:CustomActionsSchema.java

示例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);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:ActionUrl.java

示例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)));
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:CustomActionsSchema.java

示例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);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:VcsKeymapExtension.java

示例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;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:16,代码来源:VcsKeymapExtension.java

示例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)));
    }
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:10,代码来源:CustomActionsSchema.java

示例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);
    }
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:28,代码来源:VcsKeymapExtension.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:CustomizableActionsPanel.java


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