Examples of ActionManager


Examples of com.intellij.openapi.actionSystem.ActionManager

        cmndrPopup.addSeparator();
        cmndrPopup.add(action);

        final Runnable actionRegistrar = new Runnable() {
            public void run() {
                final ActionManager actMgr = ActionManager.getInstance();
                final MavenPluginsManager pluginsMgr = MavenPluginsManager.getInstance(project);
                final PluginGoalContainer[] plugins = pluginsMgr.getPlugins();
                for (GoalContainer plugin : plugins) {
                    final Goal[] goals = plugin.getGoals();
                    for (Goal goal : goals) {
                        final AnAction action = new GoalAction(goal);
                        if (actMgr.getAction(goal.getName()) == null)
                            actMgr.registerAction(goal.getName(), action, PLUGIN_ID);
                    }
                }
            }
        };
View Full Code Here

Examples of com.intellij.openapi.actionSystem.ActionManager

        //TODO: register actions here
//        StartupManager.getInstance(project).registerPostStartupActivity(actionRegistrar);
    }

    private DefaultActionGroup findGroup(final String pId) {
        ActionManager mgr = ActionManager.getInstance();
        final AnAction group = mgr.getAction(pId);
        if (group instanceof DefaultActionGroup)
            return (DefaultActionGroup) group;
        else
            return null;
    }
View Full Code Here

Examples of com.intellij.openapi.actionSystem.ActionManager

        add(ScrollPaneFactory.createScrollPane(tree), BorderLayout.CENTER);

        //
        //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);

        //
        //install popup menu on tree
        //
View Full Code Here

Examples of com.intellij.openapi.actionSystem.ActionManager

        final JPanel toolbarPanel = new JPanel(new BorderLayout());

        //
        //create the action group toolbar and add it to the toolbar panel
        //
        final ActionManager actMgr = ActionManager.getInstance();
        final ActionToolbar toolbar = actMgr.createActionToolbar(PLACE, pActions, true);
        toolbarPanel.add(toolbar.getComponent(), BorderLayout.LINE_START);

        //
        //add repository selection combo box
        //
View Full Code Here

Examples of com.intellij.openapi.actionSystem.ActionManager

        final RepoTree tree;
        if (pRepo != null)
            tree = new RepoTree(new RepoTreeModel(pRepo));
        else
            tree = new RepoTree();
        final ActionManager actionMgr = ActionManager.getInstance();
        PopupHandler.installPopupHandler(tree, actionGroup, PLACE, actionMgr);
        return tree;
    }
View Full Code Here

Examples of com.intellij.openapi.actionSystem.ActionManager

// TODO use in PluginUtil because EditorActions needs special support
public class ActionWrapper {
    private static final Logger LOG = Logger.getInstance(ActionWrapper.class);

    public static AnAction wrapAction(String actionId, final Listener listener) {
        ActionManager actionManager = ActionManager.getInstance();
        final AnAction action = actionManager.getAction(actionId);
        if (action == null) {
            LOG.warn("Couldn't wrap action " + actionId + " because it was not found");
            return null;
        }

        AnAction newAction;
        if (action instanceof EditorAction) {
            newAction = new WrappedEditorAction(listener, (EditorAction) action);
        } else if (action instanceof DumbAware) {
            newAction = new WrappedAction(listener, action);
        } else {
            newAction = new WrappedDumbUnawareAction(listener, action);
        }
        newAction.getTemplatePresentation().setText(action.getTemplatePresentation().getText());
        newAction.getTemplatePresentation().setIcon(action.getTemplatePresentation().getIcon());
        newAction.getTemplatePresentation().setHoveredIcon(action.getTemplatePresentation().getHoveredIcon());
        newAction.getTemplatePresentation().setDescription(action.getTemplatePresentation().getDescription());
        newAction.copyShortcutFrom(action);

        actionManager.unregisterAction(actionId);
        actionManager.registerAction(actionId, newAction);
        LOG.info("Wrapped action " + actionId);

        return newAction;
    }
View Full Code Here

Examples of com.intellij.openapi.actionSystem.ActionManager

        return newAction;
    }

    public static void unwrapAction(String actionId) {
        ActionManager actionManager = ActionManager.getInstance();
        AnAction wrappedAction = actionManager.getAction(actionId);
        if (wrappedAction == null) {
            LOG.warn("Couldn't unwrap action " + actionId + " because it was not found");
            return;
        }
        if (isActionWrapper(wrappedAction)) {
            actionManager.unregisterAction(actionId);
            actionManager.registerAction(actionId, originalAction(wrappedAction));
            LOG.info("Unwrapped action " + actionId);
        } else {
            LOG.warn("Action " + actionId + " is not wrapped");
        }
    }
View Full Code Here

Examples of com.sun.java.swing.action.ActionManager

        registerAction(FindAction.VALUE_COMMAND);
        registerAction(ShowAction.VALUE_COMMAND);
    }

    private void registerAction(String actionName) {
        ActionManager manager = ActionManager.getInstance();
        DelegateAction action = manager.getDelegateAction(actionName);
        action.addActionListener(this);
    }
View Full Code Here

Examples of com.vaadin.event.ActionManager

     * ACTIONS
     */
    @Override
    protected ActionManager getActionManager() {
        if (actionManager == null) {
            actionManager = new ActionManager(this);
        }
        return actionManager;
    }
View Full Code Here

Examples of com.vaadin.event.ActionManager

     *
     * @return the ActionManager in use
     */
    protected ActionManager getActionManager() {
        if (actionManager == null) {
            actionManager = new ActionManager();
            if (getWindow() != null) {
                actionManager.setViewer(getWindow());
            }
        }
        return actionManager;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.