Example usage for com.intellij.openapi.actionSystem ActionPlaces ANT_EXPLORER_POPUP

List of usage examples for com.intellij.openapi.actionSystem ActionPlaces ANT_EXPLORER_POPUP

Introduction

In this page you can find the example usage for com.intellij.openapi.actionSystem ActionPlaces ANT_EXPLORER_POPUP.

Prototype

String ANT_EXPLORER_POPUP

To view the source code for com.intellij.openapi.actionSystem ActionPlaces ANT_EXPLORER_POPUP.

Click Source Link

Usage

From source file:com.headwire.aem.tooling.intellij.explorer.SlingServerTreeManager.java

License:Apache License

private void popupInvoked(final Component comp, final int x, final int y) {
    Object userObject = null;/*from   w w  w.  ja v a 2  s .co  m*/
    final TreePath path = tree.getSelectionPath();
    if (path != null) {
        final DefaultMutableTreeNode node = (DefaultMutableTreeNode) path.getLastPathComponent();
        if (node != null) {
            userObject = node.getUserObject();
        }
    }
    ActionManager actionManager = ActionManager.getInstance();
    DefaultActionGroup group = new DefaultActionGroup();
    if (userObject instanceof SlingServerNodeDescriptor
            || userObject instanceof SlingServerModuleNodeDescriptor) {
        group.add(actionManager.getAction("AEM.Connection.Popup"));
    } else {
        group.add(actionManager.getAction("AEM.Root.Popup"));
    }
    final ActionPopupMenu popupMenu = ActionManager.getInstance()
            .createActionPopupMenu(ActionPlaces.ANT_EXPLORER_POPUP, group);
    popupMenu.getComponent().show(comp, x, y);
}

From source file:com.intellij.lang.ant.config.explorer.AntExplorer.java

License:Apache License

private void popupInvoked(final Component comp, final int x, final int y) {
    Object userObject = null;//  w w w. jav  a 2s.c  o m
    final TreePath path = myTree.getSelectionPath();
    if (path != null) {
        final DefaultMutableTreeNode node = (DefaultMutableTreeNode) path.getLastPathComponent();
        if (node != null) {
            userObject = node.getUserObject();
        }
    }
    final DefaultActionGroup group = new DefaultActionGroup();
    group.add(new RunAction());
    group.add(new CreateMetaTargetAction());
    group.add(new RemoveMetaTargetsOrBuildFileAction());
    group.add(ActionManager.getInstance().getAction(IdeActions.ACTION_EDIT_SOURCE));
    group.add(new AntGroupManagerActionGroup(null, myTree));
    group.add(new RemoveGroupsAction(myTree));
    if (userObject instanceof AntBuildFileNodeDescriptor) {
        group.add(new RemoveBuildFileAction(this));
    }
    if (userObject instanceof AntTargetNodeDescriptor) {
        final AntBuildTargetBase target = ((AntTargetNodeDescriptor) userObject).getTarget();
        final DefaultActionGroup executeOnGroup = new DefaultActionGroup(
                AntBundle.message("ant.explorer.execute.on.action.group.name"), true);
        executeOnGroup.add(new ExecuteOnEventAction(target, ExecuteBeforeCompilationEvent.getInstance()));
        executeOnGroup.add(new ExecuteOnEventAction(target, ExecuteAfterCompilationEvent.getInstance()));
        executeOnGroup.addSeparator();
        executeOnGroup.add(new ExecuteBeforeRunAction(target));
        group.add(executeOnGroup);
        group.add(new AssignShortcutAction(target.getActionId()));
    }
    group.add(myAntBuildFilePropertiesAction);
    final ActionPopupMenu popupMenu = ActionManager.getInstance()
            .createActionPopupMenu(ActionPlaces.ANT_EXPLORER_POPUP, group);
    popupMenu.getComponent().show(comp, x, y);
}

From source file:org.napile.idea.thermit.config.explorer.AntExplorer.java

License:Apache License

private void popupInvoked(final Component comp, final int x, final int y) {
    Object userObject = null;/*ww  w.  jav a 2  s. c  om*/
    final TreePath path = myTree.getSelectionPath();
    if (path != null) {
        final DefaultMutableTreeNode node = (DefaultMutableTreeNode) path.getLastPathComponent();
        if (node != null) {
            userObject = node.getUserObject();
        }
    }
    final DefaultActionGroup group = new DefaultActionGroup();
    group.add(new RunAction());
    group.add(new CreateMetaTargetAction());
    group.add(new RemoveMetaTargetsOrBuildFileAction());
    group.add(ActionManager.getInstance().getAction(IdeActions.ACTION_EDIT_SOURCE));
    if (userObject instanceof AntBuildFileNodeDescriptor) {
        group.add(new RemoveBuildFileAction(this));
    }
    if (userObject instanceof AntTargetNodeDescriptor) {
        final AntBuildTargetBase target = ((AntTargetNodeDescriptor) userObject).getTarget();
        final DefaultActionGroup executeOnGroup = new DefaultActionGroup(
                ThermitBundle.message("ant.explorer.execute.on.action.group.name"), true);
        executeOnGroup.add(new ExecuteOnEventAction(target, ExecuteBeforeCompilationEvent.getInstance()));
        executeOnGroup.add(new ExecuteOnEventAction(target, ExecuteAfterCompilationEvent.getInstance()));
        executeOnGroup.addSeparator();
        executeOnGroup.add(new ExecuteBeforeRunAction(target));
        group.add(executeOnGroup);
        group.add(new AssignShortcutAction(target.getActionId()));
    }
    group.add(myAntBuildFilePropertiesAction);
    final ActionPopupMenu popupMenu = ActionManager.getInstance()
            .createActionPopupMenu(ActionPlaces.ANT_EXPLORER_POPUP, group);
    popupMenu.getComponent().show(comp, x, y);
}