Package com.intellij.openapi.actionSystem

Examples of com.intellij.openapi.actionSystem.DefaultActionGroup


  @Override
  public ActionGroup getToolbarActions() {
    if (myActionGroup != null) {
      return myActionGroup;
    }
    DefaultActionGroup group = new DefaultActionGroup();
    group.add(new StopProcessAction("Stop Karma Server", null, myProcessOutputArchive.getProcessHandler()));

    final AnAction[] actions = myConsole.createConsoleActions();
    for (AnAction action : actions) {
      group.add(action);
    }

    group.addSeparator();

    myActionGroup = group;

    return myActionGroup;
  }
View Full Code Here


      }
    });

    StatusToolbar statusToolbar = ((StatusToolbar) myContainer.getComponentInstanceOfType(StatusToolbar.class));

    DefaultActionGroup toolbarActions = new DefaultActionGroup();
    ActionGroup actions = (ActionGroup)myActionManager.getAction("IDEtalk");
    if (actions != null) {
      toolbarActions.addAll(actions);
    }
    toolbarActions.add(new ContextHelpAction("reference.toolWindows.idetalk"));

    ActionGroup treeActions = (ActionGroup) myActionManager.getAction("IDEtalk_Tree");

    JPanel toolbarPanel = new JPanel();
    toolbarPanel.setLayout(new BoxLayout(toolbarPanel, BoxLayout.X_AXIS));
View Full Code Here

      public void valueChanged(TreeSelectionEvent e) {
        updateButtonStatus();
      }
    });

    DefaultActionGroup toolbarActions = new DefaultActionGroup();
    toolbarActions.add(new ExpandAllAction(myUserTree));
    toolbarActions.add(new CollapseAllAction(myUserTree));
    myToolbarPanel.setLayout(new BorderLayout());
    myToolbarPanel.add(ActionManager.getInstance().createActionToolbar("toolbar",
    toolbarActions, true).getComponent(), BorderLayout.EAST);

    updateButtonStatus();
View Full Code Here

    StatusToolbar statusToolbar = ((StatusToolbar) projectLevelContainer.getComponentInstanceOfType(StatusToolbar.class));
    if (statusToolbar != null) {
      statusToolbar.addToolbarCommand(JabberConnectionCommand.class);
    }
    if (!ourInitialized && ApplicationManager.getApplication() != null && !Pico.isUnitTest()) {
      DefaultActionGroup group = ((DefaultActionGroup) ActionManager.getInstance().getAction("IDEtalk.OptionsGroup"));
      if (group != null) {
        group.add(new EditJabberSettingsAction(), new Constraints(Anchor.FIRST, ""));
      }
      ourInitialized = true;
    }
  }
View Full Code Here

    panel.add(createBottomPanel());
    panel.revalidate();
  }

  private Component createBottomPanel() {
    DefaultActionGroup actions = new DefaultActionGroup();
    for (Class<? extends NamedUserCommand> toolbarAction : getToolbarActions()) {
      actions.add(new BaseAction(toolbarAction));
    }
    final ActionToolbar actionToolbar = ActionManager.getInstance().createActionToolbar("BottomToolbar", actions, true);
    actionToolbar.setLayoutPolicy(ActionToolbar.NOWRAP_LAYOUT_POLICY);
    return actionToolbar.getComponent();
  }
View Full Code Here

        .setAddAction(new AnActionButtonRunnable() {
          @Override
          public void run(AnActionButton button) {
            JBPopupFactory.getInstance().createActionGroupPopup(
              OsmorcBundle.message("frameworks.add.title"),
              new DefaultActionGroup(addActions),
              DataManager.getInstance().getDataContext(button.getContextComponent()),
              false, false, false, null, -1, null
            ).show(button.getPreferredPopupPoint());
          }
        })
View Full Code Here

                        m_gdbConsole.getComponent(), "GDB Console", AllIcons.Debugger.Console,
                        m_gdbConsole.getPreferredFocusableComponent());
                gdbConsoleContent.setCloseable(false);

                // Create the actions
                final DefaultActionGroup consoleActions = new DefaultActionGroup();
                AnAction[] actions = m_gdbConsole.getConsole().createConsoleActions();
                for (AnAction action : actions) {
                    consoleActions.add(action);
                }
                gdbConsoleContent.setActions(consoleActions, ActionPlaces.DEBUGGER_TOOLBAR,
                        m_gdbConsole.getConsole().getPreferredFocusableComponent());

                ui.addContent(gdbConsoleContent, 2, PlaceInGrid.bottom, false);
View Full Code Here

  public DefaultActionGroup getPaperActionGroup() {
    return getCommonActionGroup();
  }

  protected DefaultActionGroup getCommonActionGroup() {
    DefaultActionGroup group = new DefaultActionGroup();

    group.add(GraphViewUtil.getCommonPopupActions());

    return group;
  }
View Full Code Here

    }

    //constructs the actions for the widget popup
    public ActionGroup getActions(){

        DefaultActionGroup actionGroup = new DefaultActionGroup(null, false);
        File profilerCsv = ProfilerUtil.findProfilerCsv(project);
        if(profilerCsv == null) {
            return actionGroup;
        }

        ProfilerIndex profilerIndex = new ProfilerIndex(profilerCsv);

        List<ProfilerRequest> requests = profilerIndex.getRequests();
        Collections.reverse(requests);

        if(requests.size() > 10) {
            requests = requests.subList(0, 10);
        }

        Collection<AnAction> templateActions = new ArrayList<AnAction>();
        Map<String, Integer> templateActionsMap = new HashMap<String, Integer>();

        Collection<AnAction> routeActions = new ArrayList<AnAction>();
        Map<String, Integer> routeActionsMap = new HashMap<String, Integer>();

        Collection<AnAction> controllerActions = new ArrayList<AnAction>();
        Map<String, Integer> controllerActionsMap = new HashMap<String, Integer>();

        Collection<AnAction> urlActions = new ArrayList<AnAction>();

        Collection<AnAction> mailActions = new ArrayList<AnAction>();

        for(ProfilerRequest profilerRequest : requests) {
            DefaultDataCollector collector = profilerRequest.getCollector(DefaultDataCollector.class);

            String statusCode = collector.getStatusCode();
            urlActions.add(new SymfonyProfilerWidgetActions.UrlAction(this.project, profilerRequest, statusCode));

            // regular expression fails on current version (because of multiple mailer)
            // ArrayList<MailMessage> messages = profilerRequest.getCollector(MailCollector.class).getMessages();

            // @TODO: use collector
            String content = profilerRequest.getContent();
            if(content != null && content.contains("Swift_Mime_Headers_MailboxHeader")) {
                mailActions.add(new SymfonyProfilerWidgetActions.UrlAction(this.project, profilerRequest, statusCode).withPanel("swiftmailer").withIcon(Symfony2Icons.MAIL));
            }

            attachProfileItem(templateActions, templateActionsMap, collector.getTemplate(), ProfilerTarget.TEMPLATE);
            attachProfileItem(routeActions, routeActionsMap, collector.getRoute(), ProfilerTarget.ROUTE);
            attachProfileItem(controllerActions, controllerActionsMap, collector.getController(), ProfilerTarget.CONTROLLER);


        }

        // routes
        if(urlActions.size() > 0) {
            actionGroup.addSeparator("Debug-Url");
            actionGroup.addAll(urlActions);
        }

        // mails send by request
        if(mailActions.size() > 0) {
            actionGroup.addSeparator("E-Mail");
            actionGroup.addAll(mailActions);
        }

        // routes
        if(routeActions.size() > 0) {
            actionGroup.addSeparator("Routes");
            actionGroup.addAll(routeActions);
        }

        // controller methods
        if(controllerActions.size() > 0) {
            actionGroup.addSeparator("Controller");
            actionGroup.addAll(controllerActions);
        }

        // template should be most use case; so keep it in cursor range
        if(templateActions.size() > 0) {
            actionGroup.addSeparator("Template");
            actionGroup.addAll(templateActions);
        }

        return actionGroup;
    }
View Full Code Here

                    @Override
                    public void mouseReleased(MouseEvent e) {
                        if (e.isPopupTrigger()) {
                            // Single right click unless configured differently
                            ActionManager actionManager = ActionManager.getInstance();
                            DefaultActionGroup defaultActionGroup = (DefaultActionGroup) actionManager.getAction("org.intellij.plugins.junitgen.action.JUnitGeneratorEditorMenu");
                            ActionPopupMenu menu = actionManager.createActionPopupMenu("junitgenerator.editor.popup", defaultActionGroup);
                            menu.getComponent().show(e.getComponent(), e.getX(), e.getY());
                        }
                    }
                });
View Full Code Here

TOP

Related Classes of com.intellij.openapi.actionSystem.DefaultActionGroup

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.