Package com.intellij.openapi.actionSystem

Examples of com.intellij.openapi.actionSystem.DefaultActionGroup


    }

    public void projectOpened() {
        final SynchronizeWithModuleActionGroup action = new SynchronizeWithModuleActionGroup(project);

        final DefaultActionGroup editorPopup = findGroup("EditorPopupMenu");
        editorPopup.addSeparator();
        editorPopup.add(action);

        final DefaultActionGroup editorTabPopup = findGroup("EditorTabPopupMenu");
        editorTabPopup.addSeparator();
        editorTabPopup.add(action);

        final DefaultActionGroup projViewPopup = findGroup("ProjectViewPopupMenu");
        projViewPopup.addSeparator();
        projViewPopup.add(action);

        final DefaultActionGroup cmndrPopup = findGroup("CommanderPopupMenu");
        cmndrPopup.addSeparator();
        cmndrPopup.add(action);

        final Runnable actionRegistrar = new Runnable() {
            public void run() {
                final ActionManager actMgr = ActionManager.getInstance();
                final MavenPluginsManager pluginsMgr = MavenPluginsManager.getInstance(project);
View Full Code Here


        final AnAction autoScrollAction =
                cmnActionsMgr.installAutoscrollToSourceHandler(project,
                                                               tree,
                                                               this);

        final DefaultActionGroup actionGrp = new DefaultActionGroup("POM Manager", false);
        actionGrp.add(new ExecuteGoalAction());
        actionGrp.addSeparator();
        actionGrp.add(new AddPluginGoalToPomAction());
        actionGrp.add(new RemovePluginGoalFromPomAction());
        actionGrp.addSeparator();
        actionGrp.add(new RefreshPomToolWindowAction());
        actionGrp.add(autoScrollAction);
        actionGrp.addSeparator();
        actionGrp.add(cmnActionsMgr.createCollapseAllAction(treeExpanded));
        actionGrp.add(cmnActionsMgr.createExpandAllAction(treeExpanded));

        final ActionToolbar toolbar = actionMgr.createActionToolbar(PLACE, actionGrp, true);
        add(toolbar.getComponent(), BorderLayout.PAGE_START);

        //
        //install popup menu on tree
        //
        final DefaultActionGroup popupGrp = new DefaultActionGroup("POM Manager Popup", true);
        popupGrp.add(new ExecuteGoalAction());
        actionGrp.addSeparator();
        popupGrp.add(new AddPluginGoalToPomAction());
        popupGrp.add(new RemovePluginGoalFromPomAction());
        actionGrp.addSeparator();
        popupGrp.add(new SynchronizeWithModuleActionGroup(project));
        PopupHandler.installPopupHandler(tree, popupGrp, PLACE, actionMgr);
    }
View Full Code Here

    }

    @Override
    protected DefaultActionGroup createToolBarActionGroup() {
        final ActionGroup group = super.createToolBarActionGroup();
        final DefaultActionGroup grp;
        if (group instanceof DefaultActionGroup)
            grp = (DefaultActionGroup) group;
        else {
            grp = new DefaultActionGroup();
            final AnAction[] actions = group.getChildren(null);
            for (AnAction action : actions)
                grp.add(action);
        }

        grp.add(new AddAsDependencyAction(this));
        return grp;
    }
View Full Code Here

        treesPanel.add(ScrollPaneFactory.createScrollPane(initialTree), EMPTY_TREE_NAME);
        add(treesPanel, BorderLayout.CENTER);
    }

    protected ActionGroup createToolBarActionGroup() {
        final DefaultActionGroup actGroup = new DefaultActionGroup();
        actGroup.add(new DownloadArtifactsAction(this));
        actGroup.add(new RefreshRepoAction(this));
        return actGroup;
    }
View Full Code Here

      {
        e.getPresentation().setEnabled(((messages != null) && (currentIndex < messages.size() - 1)));
      }
    };

    DefaultActionGroup actionGroup = new DefaultActionGroup();
    actionGroup.add(previousAction);
    actionGroup.add(nextAction);
    tbPagination = ActionManager.getInstance().createActionToolbar("", actionGroup, true)
      .getComponent();
  }
View Full Code Here

        return processIcon;
      }
    };
    builder.setCommandButton(new CompositeActiveComponent(spinningProgress, settingsButton));

    DefaultActionGroup toolbar = new DefaultActionGroup();
    usageView.addFilteringActions(toolbar);

    toolbar.add(UsageGroupingRuleProviderImpl.createGroupByFileStructureAction(usageView));
    toolbar.add(
        new AnAction("Open Find Usages Toolwindow", "Show all usages in a separate toolwindow",
            AllIcons.Toolwindows.ToolWindowFind) {
          {
            AnAction action = ActionManager.getInstance().getAction(IdeActions.ACTION_FIND_USAGES);
            setShortcutSet(action.getShortcutSet());
          }

          @Override
          public void actionPerformed(AnActionEvent e) {
            hideHints();
            popup[0].cancel();
            FindUsagesManager findUsagesManager = ((FindManagerImpl) FindManager.getInstance(
                usageView.getProject())).getFindUsagesManager();
            findUsagesManager.findUsages(handler.getPrimaryElements(),
                handler.getSecondaryElements(), handler, options, true);
          }
        }
    );

    ActionToolbar actionToolbar = ActionManager.getInstance()
        .createActionToolbar(ActionPlaces.USAGE_VIEW_TOOLBAR, toolbar, true);
    actionToolbar.setReservePlaceAutoPopupIcon(false);
    final JComponent toolBar = actionToolbar.getComponent();
    toolBar.setOpaque(false);
    builder.setSettingButton(toolBar);

    popup[0] = builder.createPopup();
    JComponent content = popup[0].getContent();

    myWidth = (int) (toolBar.getPreferredSize().getWidth() + new JLabel(
        getFullTitle(usages, title, hadMoreSeparator, visibleNodes.size() - 1,
            true)).getPreferredSize().getWidth() + settingsButton.getPreferredSize().getWidth());
    myWidth = -1;
    for (AnAction action : toolbar.getChildren(null)) {
      action.unregisterCustomShortcutSet(usageView.getComponent());
      action.registerCustomShortcutSet(action.getShortcutSet(), content);
    }

    return popup[0];
View Full Code Here

    @NotNull
    protected DefaultActionGroup createPopupActionGroup(JComponent component) {
        Project project = ActionUtil.getProject(component);
        VirtualFile virtualFile = PlatformDataKeys.VIRTUAL_FILE.getData(DataManager.getInstance().getDataContext(component));
        ConnectionHandler activeConnection = FileConnectionMappingManager.getInstance(project).getActiveConnection(virtualFile);
        DefaultActionGroup actionGroup = new DefaultActionGroup();
        if (activeConnection != null && !activeConnection.isVirtual() && !activeConnection.isDisposed()) {
            for (DBSchema schema : activeConnection.getObjectBundle().getSchemas()){
                actionGroup.add(new SetCurrentSchemaAction(schema));
            }
        }
        return actionGroup;
    }
View Full Code Here

    private void showPopup() {
        isShowingPopup = true;
        innerPanel.setCursor(Cursor.getDefaultCursor());
        label.setCursor(Cursor.getDefaultCursor());
        DefaultActionGroup actionGroup = new DefaultActionGroup();
        for (T value : getValues()) {
            actionGroup.add(new SelectValueAction(value));
        }
        ListPopup popup = JBPopupFactory.getInstance().createActionGroupPopup(
                null,
                actionGroup,
                DataManager.getInstance().getDataContext(this),
View Full Code Here

    public void invoke(@NotNull Project project, Editor editor, PsiFile psiFile) throws IncorrectOperationException {
        ConnectionManager connectionManager = ConnectionManager.getInstance(project);
        List<ConnectionBundle> connectionBundles = connectionManager.getConnectionBundles();

        DefaultActionGroup actionGroup = new DefaultActionGroup();
        DBLanguageFile dbLanguageFile = (DBLanguageFile) psiFile;

        boolean connectionsFound = false;
        for (ConnectionBundle connectionBundle : connectionBundles) {
            if (connectionBundle.getConnectionHandlers().size() > 0) {
                actionGroup.addSeparator();
                for (ConnectionHandler connectionHandler : connectionBundle.getConnectionHandlers()) {

                    SelectConnectionAction connectionAction = new SelectConnectionAction(connectionHandler, dbLanguageFile);
                    actionGroup.add(connectionAction);
                    connectionsFound = true;
                }
            }
        }

        if (connectionsFound) actionGroup.addSeparator();
        ProjectConnectionBundle projectConnectionManager = ProjectConnectionBundle.getInstance(project);
        for (ConnectionHandler virtualConnectionHandler : projectConnectionManager.getVirtualConnections()) {
            SelectConnectionAction connectionAction = new SelectConnectionAction(virtualConnectionHandler, dbLanguageFile);
            actionGroup.add(connectionAction);
        }

        actionGroup.addSeparator();
        actionGroup.add(new SetupConnectionAction());

        ListPopup popupBuilder = JBPopupFactory.getInstance().createActionGroupPopup(
                "Select connection",
                actionGroup,
                DataManager.getInstance().getDataContext(editor.getComponent()),
View Full Code Here

        }
        return false;
    }

    public void invoke(@NotNull Project project, Editor editor, PsiFile psiFile) throws IncorrectOperationException {
        DefaultActionGroup actionGroup = new DefaultActionGroup();
        DBLanguageFile dbLanguageFile = (DBLanguageFile) psiFile;

        ConnectionHandler connectionHandler = dbLanguageFile.getActiveConnection();
        if (connectionHandler != null && !connectionHandler.isVirtual() && !connectionHandler.isDisposed()) {
            List<DBSchema> schemas = connectionHandler.getObjectBundle().getSchemas();
            for (DBSchema schema  :schemas) {
                SelectSchemaAction schemaAction = new SelectSchemaAction(schema, dbLanguageFile);
                actionGroup.add(schemaAction);
            }
        }

        ListPopup popupBuilder = JBPopupFactory.getInstance().createActionGroupPopup(
                "Select schema",
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.