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


Java ActionGroup类代码示例

本文整理汇总了Java中com.intellij.openapi.actionSystem.ActionGroup的典型用法代码示例。如果您正苦于以下问题:Java ActionGroup类的具体用法?Java ActionGroup怎么用?Java ActionGroup使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ActionGroup类属于com.intellij.openapi.actionSystem包,在下文中一共展示了ActionGroup类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createTrees

import com.intellij.openapi.actionSystem.ActionGroup; //导入依赖的package包/类
@Override
protected void createTrees(@NotNull final Map<String, JTree> type2TreeMap) {
  ActionGroup group = (ActionGroup)ActionManager.getInstance().getAction(IdeActions.GROUP_CALL_HIERARCHY_POPUP);
  final JTree tree1 = createTree(false);
  PopupHandler.installPopupHandler(tree1, group, ActionPlaces.CALL_HIERARCHY_VIEW_POPUP, ActionManager.getInstance());
  final BaseOnThisMethodAction baseOnThisMethodAction = new BaseOnThisMethodAction();
  baseOnThisMethodAction
    .registerCustomShortcutSet(ActionManager.getInstance().getAction(IdeActions.ACTION_CALL_HIERARCHY).getShortcutSet(), tree1);
  type2TreeMap.put(CALLEE_TYPE, tree1);

  final JTree tree2 = createTree(false);
  PopupHandler.installPopupHandler(tree2, group, ActionPlaces.CALL_HIERARCHY_VIEW_POPUP, ActionManager.getInstance());
  baseOnThisMethodAction
    .registerCustomShortcutSet(ActionManager.getInstance().getAction(IdeActions.ACTION_CALL_HIERARCHY).getShortcutSet(), tree2);
  type2TreeMap.put(CALLER_TYPE, tree2);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:CallHierarchyBrowser.java

示例2: createConsole

import com.intellij.openapi.actionSystem.ActionGroup; //导入依赖的package包/类
private void createConsole(@NotNull final NetService netService) {
  TextConsoleBuilder consoleBuilder = TextConsoleBuilderFactory.getInstance().createBuilder(netService.getProject());
  netService.configureConsole(consoleBuilder);
  console = consoleBuilder.getConsole();

  ApplicationManager.getApplication().invokeLater(new Runnable() {
    @Override
    public void run() {
      ActionGroup actionGroup = netService.getConsoleToolWindowActions();
      ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, actionGroup, false);

      SimpleToolWindowPanel toolWindowPanel = new SimpleToolWindowPanel(false, true);
      toolWindowPanel.setContent(console.getComponent());
      toolWindowPanel.setToolbar(toolbar.getComponent());

      ToolWindow toolWindow = ToolWindowManager.getInstance(netService.getProject())
        .registerToolWindow(netService.getConsoleToolWindowId(), false, ToolWindowAnchor.BOTTOM, netService.getProject(), true);
      toolWindow.setIcon(netService.getConsoleToolWindowIcon());

      Content content = ContentFactory.SERVICE.getInstance().createContent(toolWindowPanel, "", false);
      Disposer.register(content, console);

      toolWindow.getContentManager().addContent(content);
    }
  }, netService.getProject().getDisposed());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:ConsoleManager.java

示例3: getChildrenCountRecursive

import com.intellij.openapi.actionSystem.ActionGroup; //导入依赖的package包/类
private static int getChildrenCountRecursive(ActionGroup group) {
  AnAction[] children;
  if (group instanceof DefaultActionGroup) {
    children = ((DefaultActionGroup) group).getChildActionsOrStubs();
  }
  else {
    children = group.getChildren(null);
  }
  int count = 0;
  for (AnAction child : children) {
    if (child instanceof ActionGroup) {
      count += getChildrenCountRecursive((ActionGroup) child);
    }
    else {
      count++;
    }
  }
  return count;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:SmartPopupActionGroup.java

示例4: readExternal

import com.intellij.openapi.actionSystem.ActionGroup; //导入依赖的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

示例5: getCorrectedAction

import com.intellij.openapi.actionSystem.ActionGroup; //导入依赖的package包/类
public AnAction getCorrectedAction(String id) {
  if (! myIdToNameList.contains(new Pair(id, ""))){
    return ActionManager.getInstance().getAction(id);
  }
  if (myIdToActionGroup.get(id) == null) {
    for (Pair pair : myIdToNameList) {
      if (pair.first.equals(id)){
        final ActionGroup actionGroup = (ActionGroup)ActionManager.getInstance().getAction(id);
        if (actionGroup != null) { //J2EE/Commander plugin was disabled
          myIdToActionGroup.put(id, CustomizationUtil.correctActionGroup(actionGroup, this, pair.second, pair.second));
        }
      }
    }
  }
  return myIdToActionGroup.get(id);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:CustomActionsSchema.java

示例6: isCorrectActionGroup

import com.intellij.openapi.actionSystem.ActionGroup; //导入依赖的package包/类
public boolean isCorrectActionGroup(ActionGroup group, String defaultGroupName) {
  if (myActions.isEmpty()){
    return false;
  }

  final String text = group.getTemplatePresentation().getText();
  if (!StringUtil.isEmpty(text)) {
    for (ActionUrl url : myActions) {
      if (url.getGroupPath().contains(text) || url.getGroupPath().contains(defaultGroupName)) {
        return true;
      }
      if (url.getComponent() instanceof Group) {
        final Group urlGroup = (Group)url.getComponent();
        String id = urlGroup.getName() != null ? urlGroup.getName() : urlGroup.getId();
        if (id == null || id.equals(text) || id.equals(defaultGroupName)) {
          return true;
        }
      }
    }
    return false;
  }
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:CustomActionsSchema.java

示例7: createActions

import com.intellij.openapi.actionSystem.ActionGroup; //导入依赖的package包/类
@NotNull
private ActionGroup createActions() {
  DefaultActionGroup popupGroup = new DefaultActionGroup(null, false);
  AbstractRepositoryManager<Repo> repositoryManager = myRepositoryManager;
  if (repositoryManager.moreThanOneRoot()) {
    if (userWantsSyncControl()) {
      fillWithCommonRepositoryActions(popupGroup, repositoryManager);
    }
    else {
      fillPopupWithCurrentRepositoryActions(popupGroup, createRepositoriesActions());
    }
  }
  else {
    fillPopupWithCurrentRepositoryActions(popupGroup, null);
  }
  popupGroup.addSeparator();
  return popupGroup;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:DvcsBranchPopup.java

示例8: getChildren

import com.intellij.openapi.actionSystem.ActionGroup; //导入依赖的package包/类
@Override
@NotNull
public AnAction[] getChildren(@Nullable AnActionEvent e) {
  List<AnAction> result = new ArrayList<AnAction>();
  for (AnAction action : myDelegate.getChildren(e)) {
    if (myExcludes.contains(action)) {
      continue;
    }
    if (action instanceof ActionGroup) {
      result.add(new ExcludingActionGroup((ActionGroup) action, myExcludes));
    } else {
      result.add(action);
    }
  }
  return result.toArray(new AnAction[result.size()]);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:ExcludingActionGroup.java

示例9: getToolbarActions

import com.intellij.openapi.actionSystem.ActionGroup; //导入依赖的package包/类
@NotNull
public ActionGroup getToolbarActions(Project project, DeviceContext deviceContext) {
  DefaultActionGroup group = new DefaultActionGroup();

  group.add(new ScreenshotAction(project, deviceContext));
  group.add(new ScreenRecorderAction(project, deviceContext));
  group.add(DumpSysActions.create(project, deviceContext));
  //group.add(new MyFileExplorerAction());
  group.add(new Separator());

  group.add(new TerminateVMAction(deviceContext));
  //group.add(new MyAllocationTrackerAction());
  //group.add(new Separator());

  return group;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:AndroidToolWindowFactory.java

示例10: createActionToolbar

import com.intellij.openapi.actionSystem.ActionGroup; //导入依赖的package包/类
@NotNull
private ActionGroup createActionToolbar(JComponent consolePanel, ConsoleView consoleView, @NotNull final RunnerLayoutUi myUi, RunContentDescriptor contentDescriptor, Executor runExecutorInstance) {
    final DefaultActionGroup actionGroup = new DefaultActionGroup();
    actionGroup.add(new FilterAction());
    actionGroup.add(new RerunAction(consolePanel, consoleView));
    actionGroup.add(new StopAction());
    actionGroup.add(new FormatAction());
    actionGroup.add(new MyCloseAction(runExecutorInstance, contentDescriptor, myProject));
    return actionGroup;
}
 
开发者ID:kookob,项目名称:mybatis-log-plugin,代码行数:11,代码来源:TailContentExecutor.java

示例11: createConsolePanel

import com.intellij.openapi.actionSystem.ActionGroup; //导入依赖的package包/类
private static JComponent createConsolePanel(ConsoleView view, ActionGroup actions) {
    JPanel panel = new JPanel();
    panel.setLayout(new BorderLayout());
    panel.add(view.getComponent(), BorderLayout.CENTER);
    panel.add(createToolbar(actions), BorderLayout.WEST);
    return panel;
}
 
开发者ID:kookob,项目名称:mybatis-log-plugin,代码行数:8,代码来源:TailContentExecutor.java

示例12: createActions

import com.intellij.openapi.actionSystem.ActionGroup; //导入依赖的package包/类
/**
 * Create a list of idea actions that the user can choose, to change their pairs.
 *
 * @param pairController Pair logic controller for list of members.
 * @return list of actions.
 */
private static ActionGroup createActions(@NotNull PairController pairController, @NotNull TeamMemberAction.TeamMemberActionPerformer teamMemberActionPerformer) {
    DefaultActionGroup defaultActionGroup = new DefaultActionGroup(null, false);
    PairConfig pairConfig = pairController.getPairConfig();

    for (TeamMember teamMember : pairConfig.getTeamMembers()) {
        defaultActionGroup.add(new TeamMemberAction(teamMember, teamMemberActionPerformer));
    }

    return defaultActionGroup;
}
 
开发者ID:RoboPlugins,项目名称:git-pair.idea,代码行数:17,代码来源:PairsPopupList.java

示例13: createToolbarFromGroupId

import com.intellij.openapi.actionSystem.ActionGroup; //导入依赖的package包/类
private static ActionToolbar createToolbarFromGroupId(final String groupId) {
    final ActionManager actionManager = ActionManager.getInstance();

    if (!actionManager.isGroup(groupId)) {
        throw new IllegalStateException(groupId + " should have been a group");
    }
    final ActionGroup group = ((ActionGroup)actionManager.getAction(groupId));
    final ActionToolbarImpl editorToolbar =
            ((ActionToolbarImpl)actionManager.createActionToolbar(ActionPlaces.EDITOR_TOOLBAR, group, true));
    editorToolbar.setOpaque(false);
    editorToolbar.setBorder(new JBEmptyBorder(0, 2, 0, 2));

    return editorToolbar;
}
 
开发者ID:zalando,项目名称:intellij-swagger,代码行数:15,代码来源:SwaggerUIToolbar.java

示例14: createActionToolbar

import com.intellij.openapi.actionSystem.ActionGroup; //导入依赖的package包/类
@NotNull
private ActionGroup createActionToolbar(JComponent consolePanel, ConsoleView consoleView, @NotNull final RunnerLayoutUi myUi, RunContentDescriptor contentDescriptor, Executor runExecutorInstance) {
    final DefaultActionGroup actionGroup = new DefaultActionGroup();
    actionGroup.add(new RerunAction(consolePanel, consoleView));
    actionGroup.add(new StopAction());
    actionGroup.add(new FormatAction());
    actionGroup.add(new MyCloseAction(runExecutorInstance, contentDescriptor, myProject));
    return actionGroup;
}
 
开发者ID:kookob,项目名称:RestoreSql,代码行数:10,代码来源:TailContentExecutor.java

示例15: createTrees

import com.intellij.openapi.actionSystem.ActionGroup; //导入依赖的package包/类
protected void createTrees(@NotNull Map<String, JTree> trees) {
  final JTree tree = createTree(false);
  ActionGroup group = (ActionGroup)ActionManager.getInstance().getAction(IdeActions.GROUP_METHOD_HIERARCHY_POPUP);
  PopupHandler.installPopupHandler(tree, group, ActionPlaces.METHOD_HIERARCHY_VIEW_POPUP, ActionManager.getInstance());

  final BaseOnThisMethodAction baseOnThisMethodAction = new BaseOnThisMethodAction();
  baseOnThisMethodAction
    .registerCustomShortcutSet(ActionManager.getInstance().getAction(IdeActions.ACTION_METHOD_HIERARCHY).getShortcutSet(), tree);

  trees.put(METHOD_TYPE, tree);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:MethodHierarchyBrowser.java


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