Package com.intellij.ide

Examples of com.intellij.ide.CommonActionsManager


        //
        //create the toolbar
        //
        final ActionManager actionMgr = ActionManager.getInstance();
        final CommonActionsManager cmnActionsMgr = CommonActionsManager.getInstance();
        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);

        //
View Full Code Here


        myEditButton.setEnabled(fileSet != null && !dumbService.isDumb());
        myRemoveButton.setEnabled(fileSet != null);
      }
    });

    final CommonActionsManager actionManager = CommonActionsManager.getInstance();
    myTreePanel.add(
      ToolbarDecorator.createDecorator(myTree)
        .setAddAction(new AnActionButtonRunnable() {
          @Override
          public void run(AnActionButton button) {
            final StrutsFileSet fileSet =
              new StrutsFileSet(StrutsFileSet.getUniqueId(myBuffer),
                                StrutsFileSet.getUniqueName(StrutsBundle.message("facet.fileset.my.fileset"), myBuffer),
                                originalConfiguration) {
                public boolean isNew() {
                  return true;
                }
              };

            final FileSetEditor editor = new FileSetEditor(myPanel,
                                                           fileSet,
                                                           facetEditorContext,
                                                           myConfigsSearcher);
            editor.show();
            if (editor.getExitCode() == DialogWrapper.OK_EXIT_CODE) {
              final StrutsFileSet editedFileSet = editor.getEditedFileSet();
              Disposer.register(strutsFacetConfiguration, editedFileSet);
              myBuffer.add(editedFileSet);
              myModified = true;
              myBuilder.updateFromRoot();
              selectFileSet(fileSet);
            }
            myTree.requestFocus();
          }
        })
        .setRemoveAction(new AnActionButtonRunnable() {
          @Override
          public void run(AnActionButton button) {
            remove();
            myModified = true;
            myBuilder.updateFromRoot();
            myTree.requestFocus();
          }
        })
        .setEditAction(new AnActionButtonRunnable() {
          @Override
          public void run(AnActionButton button) {
            final StrutsFileSet fileSet = getCurrentFileSet();
            if (fileSet != null) {
              final FileSetEditor editor = new FileSetEditor(myPanel,
                                                             fileSet,
                                                             facetEditorContext,
                                                             myConfigsSearcher);
              editor.show();
              if (editor.getExitCode() == DialogWrapper.OK_EXIT_CODE) {
                myModified = true;
                myBuffer.remove(fileSet);
                final StrutsFileSet edited = editor.getEditedFileSet();
                Disposer.register(strutsFacetConfiguration, edited);
                myBuffer.add(edited);
                edited.setAutodetected(false);
                myBuilder.updateFromRoot();
                selectFileSet(edited);
              }
              myTree.requestFocus();
            }
          }
        })
        .addExtraAction(AnActionButton.fromAction(actionManager.createExpandAllAction(myTreeExpander, myTree)))
        .addExtraAction(AnActionButton.fromAction(actionManager.createCollapseAllAction(myTreeExpander, myTree)))
        .addExtraAction(new AnActionButton("Open Struts 2 plugin documentation…", AllIcons.Actions.Help) {
          @Override
          public void actionPerformed(AnActionEvent e) {
            BrowserUtil.browse("http://confluence.jetbrains.com/pages/viewpage.action?pageId=35367");
          }
View Full Code Here

            public boolean canCollapse() {
                return true;
            }
        };

        CommonActionsManager actionsManager = CommonActionsManager.getInstance();

        final AnAction expandAllAction = actionsManager.createExpandAllAction(treeExpander, resultPanel);
        final AnAction collapseAllAction = actionsManager.createCollapseAllAction(treeExpander, resultPanel);

        Disposer.register(this, new Disposable() {
            @Override
            public void dispose() {
                collapseAllAction.unregisterCustomShortcutSet(resultPanel);
View Full Code Here

            public boolean canCollapse() {
                return true;
            }
        };

        CommonActionsManager actionsManager = CommonActionsManager.getInstance();

        final AnAction expandAllAction = actionsManager.createExpandAllAction(treeExpander, rootPanel);
        final AnAction collapseAllAction = actionsManager.createCollapseAllAction(treeExpander, rootPanel);

        Disposer.register(this, new Disposable() {
            @Override
            public void dispose() {
                collapseAllAction.unregisterCustomShortcutSet(rootPanel);
View Full Code Here

TOP

Related Classes of com.intellij.ide.CommonActionsManager

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.