Java 类com.intellij.openapi.actionSystem.ActionPopupMenu 实例源码

项目:aem-ide-tooling-4-intellij    文件:SlingServerTreeManager.java   
private void popupInvoked(final Component comp, final int x, final int y) {
    Object userObject = null;
    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);
}
项目:tools-idea    文件:EditorActionUtil.java   
public static EditorPopupHandler createEditorPopupHandler(final String groupId) {
  return new EditorPopupHandler() {
    @Override
    public void invokePopup(final EditorMouseEvent event) {
      if (!event.isConsumed() && event.getArea() == EditorMouseEventArea.EDITING_AREA) {
        ActionGroup group = (ActionGroup)CustomActionsSchema.getInstance().getCorrectedAction(groupId);
        ActionPopupMenu popupMenu = ActionManager.getInstance().createActionPopupMenu(ActionPlaces.EDITOR_POPUP, group);
        MouseEvent e = event.getMouseEvent();
        final Component c = e.getComponent();
        if (c != null && c.isShowing()) {
          popupMenu.getComponent().show(c, e.getX(), e.getY());
        }
        e.consume();
      }
    }
  };
}
项目:consulo-ui-designer    文件:GridCaptionPanel.java   
private boolean checkShowPopupMenu(final MouseEvent e)
{
    int cell = getCellAt(e.getPoint());

    if(cell >= 0 && e.isPopupTrigger())
    {
        if(!mySelectionModel.isSelectedIndex(cell))
        {
            mySelectionModel.setSelectionInterval(cell, cell);
        }
        ActionGroup group = mySelectedContainer.getGridLayoutManager().getCaptionActions();
        if(group != null)
        {
            final ActionPopupMenu popupMenu = ActionManager.getInstance().createActionPopupMenu(ActionPlaces.UNKNOWN, group);
            popupMenu.getComponent().show(GridCaptionPanel.this, e.getX(), e.getY());
            return true;
        }
    }
    return false;
}
项目:consulo    文件:PopupHandler.java   
@Nonnull
public static MouseListener installPopupHandler(@Nonnull JComponent component,
                                                @Nonnull ActionGroup group,
                                                String place,
                                                @Nonnull ActionManager actionManager,
                                                @Nullable PopupMenuListener menuListener) {
  if (ApplicationManager.getApplication() == null) return new MouseAdapter(){};
  PopupHandler popupHandler = new PopupHandler() {
    public void invokePopup(Component comp, int x, int y) {
      ActionPopupMenu popupMenu = actionManager.createActionPopupMenu(place, group);
      popupMenu.setTargetComponent(component);
      JPopupMenu menu = popupMenu.getComponent();
      if (menuListener != null) menu.addPopupMenuListener(menuListener);
      menu.show(comp, x, y);
    }
  };
  component.addMouseListener(popupHandler);
  return popupHandler;
}
项目:consulo    文件:PopupHandler.java   
@Nonnull
private static MouseListener installConditionalPopup(@Nonnull JComponent component,
                                                     @Nonnull ActionGroup group,
                                                     String place,
                                                     @Nonnull ActionManager actionManager,
                                                     @Nonnull ShowPopupPredicate condition) {
  if (ApplicationManager.getApplication() == null) return new MouseAdapter(){};
  PopupHandler handler = new PopupHandler() {
    public void invokePopup(Component comp, int x, int y) {
      if (condition.shouldShowPopup(comp, x, y)) {
        ActionPopupMenu popupMenu = actionManager.createActionPopupMenu(place, group);
        popupMenu.getComponent().show(comp, x, y);
      }
    }
  };
  component.addMouseListener(handler);
  return handler;
}
项目:intellij-ce-playground    文件:InspectDebuggerTree.java   
public InspectDebuggerTree(Project project) {
  super(project);

  final PopupHandler popupHandler = new PopupHandler() {
    public void invokePopup(Component comp, int x, int y) {
      ActionPopupMenu popupMenu = createPopupMenu();
      if (popupMenu != null) {
        myTipManager.registerPopup(popupMenu.getComponent()).show(comp, x, y);
      }
    }
  };
  addMouseListener(popupHandler);

  new ValueNodeDnD(this, project);
}
项目:intellij-ce-playground    文件:SimpleTree.java   
protected void invokeContextMenu(final MouseEvent e) {
  SwingUtilities.invokeLater(new Runnable() {
    public void run() {
      final ActionPopupMenu menu = ActionManager.getInstance().createActionPopupMenu(myPlace, myPopupGroup);
      menu.getComponent().show(e.getComponent(), e.getPoint().x, e.getPoint().y);
    }
  });
}
项目:intellij-ce-playground    文件:PopupHandler.java   
public static MouseListener installPopupHandler(JComponent component, @NotNull final ActionGroup group, final String place, final ActionManager actionManager) {
  if (ApplicationManager.getApplication() == null) return new MouseAdapter(){};
  PopupHandler popupHandler = new PopupHandler() {
    public void invokePopup(Component comp, int x, int y) {
      final ActionPopupMenu popupMenu = actionManager.createActionPopupMenu(place, group);
      popupMenu.getComponent().show(comp, x, y);
    }
  };
  component.addMouseListener(popupHandler);
  return popupHandler;
}
项目:intellij-ce-playground    文件:PopupHandler.java   
public static MouseListener installFollowingSelectionTreePopup(final JTree tree, @NotNull final ActionGroup group, final String place, final ActionManager actionManager){
  if (ApplicationManager.getApplication() == null) return new MouseAdapter(){};
  PopupHandler handler = new PopupHandler() {
    public void invokePopup(Component comp, int x, int y) {
      if (tree.getPathForLocation(x, y) != null && Arrays.binarySearch(tree.getSelectionRows(), tree.getRowForLocation(x, y)) > -1) { //do not show popup menu on rows other than selection
        final ActionPopupMenu popupMenu = actionManager.createActionPopupMenu(place, group);
        popupMenu.getComponent().show(comp, x, y);
      }
    }
  };
  tree.addMouseListener(handler);
  return handler;
}
项目:intellij-ce-playground    文件:EditorActionUtil.java   
private static void showEditorPopup(final EditorMouseEvent event, @NotNull final ActionGroup group) {
  if (!event.isConsumed() && event.getArea() == EditorMouseEventArea.EDITING_AREA) {
    ActionPopupMenu popupMenu = ActionManager.getInstance().createActionPopupMenu(ActionPlaces.EDITOR_POPUP, group);
    MouseEvent e = event.getMouseEvent();
    final Component c = e.getComponent();
    if (c != null && c.isShowing()) {
      popupMenu.getComponent().show(c, e.getX(), e.getY());
    }
    e.consume();
  }
}
项目:intellij-ce-playground    文件:ShareDialog.java   
public static ActionPopupMenu createShortPopupForRepositoryDialog(RepositoryBrowserComponent browserComponent) {
  DefaultActionGroup group = new DefaultActionGroup();
  DefaultActionGroup newGroup = new DefaultActionGroup("_New", true);
  newGroup.add(new AddLocationAction(browserComponent));
  newGroup.add(new MkDirAction(browserComponent));
  group.add(newGroup);
  group.addSeparator();
  group.add(new RefreshAction(browserComponent));
  group.add(new DiscardLocationAction(browserComponent));
  group.add(new DeleteAction(browserComponent));
  return ActionManager.getInstance().createActionPopupMenu("", group);
}
项目:intellij-ce-playground    文件:CopyOptionsDialog.java   
private void createUI() {
  myMainPanel = new JPanel(new BorderLayout());
  myBrowser = new RepositoryBrowserComponent(SvnVcs.getInstance(myProject));

  final DefaultActionGroup group = new DefaultActionGroup();
  group.add(new RepositoryBrowserDialog.MkDirAction(myBrowser) {
    @Override
    public void update(AnActionEvent e) {
      super.update(e);
      e.getPresentation().setText("New Remote Folder...");
    }
  });
  group.add(new RepositoryBrowserDialog.DeleteAction(myBrowser));
  group.add(new RepositoryBrowserDialog.RefreshAction(myBrowser));
  final ActionPopupMenu popupMenu = ActionManager.getInstance().createActionPopupMenu("", group);
  final JPopupMenu component = popupMenu.getComponent();
  myBrowser.getRepositoryTree().addMouseListener(new PopupHandler() {
    @Override
    public void invokePopup(Component comp, int x, int y) {
      component.show(comp, x, y);
    }
  });

  final Splitter splitter = new Splitter(true);
  splitter.setProportion(0.7f);
  final JPanel wrapper = createBrowserPartWrapper();
  splitter.setFirstComponent(wrapper);
  final JPanel commitMessageWrapper = createCommitMessageWrapper();
  splitter.setSecondComponent(commitMessageWrapper);

  myMainPanel.add(splitter, BorderLayout.CENTER);
  final JPanel recentMessagesWrapper = new JPanel(new BorderLayout());
  recentMessagesWrapper.add(new JLabel("Recent Messages:"), BorderLayout.NORTH);
  myMessagesBox = new JComboBox();
  recentMessagesWrapper.add(myMessagesBox, BorderLayout.SOUTH);
  recentMessagesWrapper.setBorder(BorderFactory.createEmptyBorder(4,0,0,0));
  myMainPanel.add(recentMessagesWrapper, BorderLayout.SOUTH);
}
项目:intellij-ce-playground    文件:SelectCreateExternalTargetDialog.java   
protected JPopupMenu createPopup(boolean toolWindow) {
  DefaultActionGroup group = new DefaultActionGroup();
  DefaultActionGroup newGroup = new DefaultActionGroup("_New", true);
  final RepositoryBrowserComponent browser = getRepositoryBrowser();
  newGroup.add(new AddLocationAction(browser));
  newGroup.add(new MkDirAction(browser));
  group.add(newGroup);
  group.addSeparator();
  group.add(new RefreshAction(browser));
  group.add(new DiscardLocationAction(browser));
  ActionPopupMenu menu = ActionManager.getInstance().createActionPopupMenu("", group);
  return menu.getComponent();
}
项目:intellij-ce-playground    文件:SelectionTool.java   
@Override
protected void handlePopup() {
  ActionManager actionManager = ActionManager.getInstance();
  ActionPopupMenu popupMenu = actionManager.createActionPopupMenu(myArea.getPopupPlace(), myArea.getPopupActions());
  MouseEvent event = (MouseEvent)myInputEvent;
  popupMenu.getComponent().show(myArea.getNativeComponent(), event.getX(), event.getY());
}
项目:tools-idea    文件:InspectDebuggerTree.java   
public InspectDebuggerTree(Project project) {
  super(project);

  final PopupHandler popupHandler = new PopupHandler() {
    public void invokePopup(Component comp, int x, int y) {
      ActionPopupMenu popupMenu = createPopupMenu();
      if (popupMenu != null) {
        myTipManager.registerPopup(popupMenu.getComponent()).show(comp, x, y);
      }
    }
  };
  addMouseListener(popupHandler);

  new ValueNodeDnD(this, project);
}
项目:tools-idea    文件:SimpleTree.java   
protected void invokeContextMenu(final MouseEvent e) {
  SwingUtilities.invokeLater(new Runnable() {
    public void run() {
      final ActionPopupMenu menu = ActionManager.getInstance().createActionPopupMenu(myPlace, myPopupGroup);
      menu.getComponent().show(e.getComponent(), e.getPoint().x, e.getPoint().y);
    }
  });
}
项目:tools-idea    文件:PopupHandler.java   
public static MouseListener installPopupHandler(JComponent component, @NotNull final ActionGroup group, final String place, final ActionManager actionManager) {
  if (ApplicationManager.getApplication() == null) return new MouseAdapter(){};
  PopupHandler popupHandler = new PopupHandler() {
    public void invokePopup(Component comp, int x, int y) {
      final ActionPopupMenu popupMenu = actionManager.createActionPopupMenu(place, group);
      popupMenu.getComponent().show(comp, x, y);
    }
  };
  component.addMouseListener(popupHandler);
  return popupHandler;
}
项目:tools-idea    文件:PopupHandler.java   
public static MouseListener installFollowingSelectionTreePopup(final JTree tree, @NotNull final ActionGroup group, final String place, final ActionManager actionManager){
  if (ApplicationManager.getApplication() == null) return new MouseAdapter(){};
  PopupHandler handler = new PopupHandler() {
    public void invokePopup(Component comp, int x, int y) {
      if (tree.getPathForLocation(x, y) != null && Arrays.binarySearch(tree.getSelectionRows(), tree.getRowForLocation(x, y)) > -1) { //do not show popup menu on rows other than selection
        final ActionPopupMenu popupMenu = actionManager.createActionPopupMenu(place, group);
        popupMenu.getComponent().show(comp, x, y);
      }
    }
  };
  tree.addMouseListener(handler);
  return handler;
}
项目:tools-idea    文件:ShareDialog.java   
public static ActionPopupMenu createShortPopupForRepositoryDialog(RepositoryBrowserComponent browserComponent) {
  DefaultActionGroup group = new DefaultActionGroup();
  DefaultActionGroup newGroup = new DefaultActionGroup("_New", true);
  newGroup.add(new AddLocationAction(browserComponent));
  newGroup.add(new MkDirAction(browserComponent));
  group.add(newGroup);
  group.addSeparator();
  group.add(new RefreshAction(browserComponent));
  group.add(new DiscardLocationAction(browserComponent));
  group.add(new DeleteAction(browserComponent));
  return ActionManager.getInstance().createActionPopupMenu("", group);
}
项目:tools-idea    文件:CopyOptionsDialog.java   
private void createUI() {
  myMainPanel = new JPanel(new BorderLayout());
  myBrowser = new RepositoryBrowserComponent(SvnVcs.getInstance(myProject));

  final DefaultActionGroup group = new DefaultActionGroup();
  group.add(new RepositoryBrowserDialog.MkDirAction(myBrowser) {
    @Override
    public void update(AnActionEvent e) {
      super.update(e);
      e.getPresentation().setText("New Remote Folder...");
    }
  });
  group.add(new RepositoryBrowserDialog.DeleteAction(myBrowser));
  group.add(new RepositoryBrowserDialog.RefreshAction(myBrowser));
  final ActionPopupMenu popupMenu = ActionManager.getInstance().createActionPopupMenu("", group);
  final JPopupMenu component = popupMenu.getComponent();
  myBrowser.getRepositoryTree().addMouseListener(new PopupHandler() {
    @Override
    public void invokePopup(Component comp, int x, int y) {
      component.show(comp, x, y);
    }
  });

  final Splitter splitter = new Splitter(true);
  splitter.setProportion(0.7f);
  final JPanel wrapper = createBrowserPartWrapper();
  splitter.setFirstComponent(wrapper);
  final JPanel commitMessageWrapper = createCommitMessageWrapper();
  splitter.setSecondComponent(commitMessageWrapper);

  myMainPanel.add(splitter, BorderLayout.CENTER);
  final JPanel recentMessagesWrapper = new JPanel(new BorderLayout());
  recentMessagesWrapper.add(new JLabel("Recent Messages:"), BorderLayout.NORTH);
  myMessagesBox = new JComboBox();
  recentMessagesWrapper.add(myMessagesBox, BorderLayout.SOUTH);
  recentMessagesWrapper.setBorder(BorderFactory.createEmptyBorder(4,0,0,0));
  myMainPanel.add(recentMessagesWrapper, BorderLayout.SOUTH);
}
项目:tools-idea    文件:SelectCreateExternalTargetDialog.java   
protected JPopupMenu createPopup(boolean toolWindow) {
  DefaultActionGroup group = new DefaultActionGroup();
  DefaultActionGroup newGroup = new DefaultActionGroup("_New", true);
  final RepositoryBrowserComponent browser = getRepositoryBrowser();
  newGroup.add(new AddLocationAction(browser));
  newGroup.add(new MkDirAction(browser));
  group.add(newGroup);
  group.addSeparator();
  group.add(new RefreshAction(browser));
  group.add(new DiscardLocationAction(browser));
  ActionPopupMenu menu = ActionManager.getInstance().createActionPopupMenu("", group);
  return menu.getComponent();
}
项目:tools-idea    文件:SelectionTool.java   
@Override
protected void handlePopup() {
  ActionManager actionManager = ActionManager.getInstance();
  ActionPopupMenu popupMenu = actionManager.createActionPopupMenu(myArea.getPopupPlace(), myArea.getPopupActions());
  MouseEvent event = (MouseEvent)myInputEvent;
  popupMenu.getComponent().show(myArea.getNativeComponent(), event.getX(), event.getY());
}
项目:cordovastudio    文件:SelectionTool.java   
@Override
protected void handlePopup() {
  ActionManager actionManager = ActionManager.getInstance();
  ActionPopupMenu popupMenu = actionManager.createActionPopupMenu(myArea.getPopupPlace(), myArea.getPopupActions());
  MouseEvent event = (MouseEvent)myInputEvent;
  popupMenu.getComponent().show(myArea.getNativeComponent(), event.getX(), event.getY());
}
项目:idea-coremedia-plugin    文件:DoctypeTreePanel.java   
@Override
public void actionPerformed(AnActionEvent event)
{
    final ActionGroup group = createGearActionGroup();
    final ActionPopupMenu menu = ActionManager.getInstance().createActionPopupMenu(ActionPlaces.UNKNOWN, group);
    final Component component = event.getInputEvent().getComponent();
    menu.getComponent().show(component, component.getX(), component.getY());
}
项目:consulo-apache-ant    文件:TreeView.java   
private void popupInvoked(Component component, int x, int y) {
  final TreePath path = myTree.getLeadSelectionPath();
  if (path == null) return;
  if (!(path.getLastPathComponent()instanceof MessageNode)) return;
  if (getData(PlatformDataKeys.NAVIGATABLE_ARRAY) == null) return;
  DefaultActionGroup group = new DefaultActionGroup();
  group.add(ActionManager.getInstance().getAction(IdeActions.ACTION_EDIT_SOURCE));
  ActionPopupMenu menu = ActionManager.getInstance().createActionPopupMenu(ActionPlaces.ANT_MESSAGES_POPUP, group);
  menu.getComponent().show(component, x, y);
}
项目:consulo    文件:SimpleTree.java   
protected void invokeContextMenu(final MouseEvent e) {
  SwingUtilities.invokeLater(new Runnable() {
    public void run() {
      final ActionPopupMenu menu = ActionManager.getInstance().createActionPopupMenu(myPlace, myPopupGroup);
      menu.getComponent().show(e.getComponent(), e.getPoint().x, e.getPoint().y);
    }
  });
}
项目:consulo    文件:EditorActionUtil.java   
private static void showEditorPopup(final EditorMouseEvent event, @Nonnull final ActionGroup group) {
  if (!event.isConsumed() && event.getArea() == EditorMouseEventArea.EDITING_AREA) {
    ActionPopupMenu popupMenu = ActionManager.getInstance().createActionPopupMenu(ActionPlaces.EDITOR_POPUP, group);
    MouseEvent e = event.getMouseEvent();
    final Component c = e.getComponent();
    if (c != null && c.isShowing()) {
      popupMenu.getComponent().show(c, e.getX(), e.getY());
    }
    e.consume();
  }
}
项目:intellij-ce-playground    文件:InspectDebuggerTree.java   
public static ActionPopupMenu createPopupMenu() {
  ActionGroup group = (ActionGroup)ActionManager.getInstance().getAction(DebuggerActions.INSPECT_PANEL_POPUP);
  return ActionManager.getInstance().createActionPopupMenu(DebuggerActions.INSPECT_PANEL_POPUP, group);
}
项目:intellij-ce-playground    文件:InspectPanel.java   
protected ActionPopupMenu createPopupMenu() {
  return InspectDebuggerTree.createPopupMenu();
}
项目:intellij-ce-playground    文件:ThreadsPanel.java   
@Override
protected ActionPopupMenu createPopupMenu() {
  DefaultActionGroup group = (DefaultActionGroup)ActionManager.getInstance().getAction(DebuggerActions.THREADS_PANEL_POPUP);
  return ActionManager.getInstance().createActionPopupMenu(DebuggerActions.THREADS_PANEL_POPUP, group);
}
项目:intellij-ce-playground    文件:StripeButton.java   
private void showPopup(final Component component, final int x, final int y) {
  final ActionGroup group = myDecorator.createPopupGroup();
  final ActionPopupMenu popupMenu = ActionManager.getInstance().createActionPopupMenu(ActionPlaces.UNKNOWN, group);
  popupMenu.getComponent().show(component, x, y);
}
项目:intellij-ce-playground    文件:TodoCheckinHandler.java   
@Override
public RefreshableOnComponent getBeforeCheckinConfigurationPanel() {
  final JCheckBox checkBox = new JCheckBox(VcsBundle.message("before.checkin.new.todo.check", ""));
  return new RefreshableOnComponent() {
    @Override
    public JComponent getComponent() {
      JPanel panel = new JPanel(new BorderLayout(4, 0));
      panel.add(checkBox, BorderLayout.WEST);
      setFilterText(myConfiguration.myTodoPanelSettings.todoFilterName);
      if (myConfiguration.myTodoPanelSettings.todoFilterName != null) {
        myTodoFilter = TodoConfiguration.getInstance().getTodoFilter(myConfiguration.myTodoPanelSettings.todoFilterName);
      }

      final Consumer<TodoFilter> consumer = new Consumer<TodoFilter>() {
        @Override
        public void consume(TodoFilter todoFilter) {
          myTodoFilter = todoFilter;
          final String name = todoFilter == null ? null : todoFilter.getName();
          myConfiguration.myTodoPanelSettings.todoFilterName = name;
          setFilterText(name);
        }
      };
      final LinkLabel linkLabel = new LinkLabel("Configure", null);
      linkLabel.setListener(new LinkListener() {
        @Override
        public void linkSelected(LinkLabel aSource, Object aLinkData) {
          DefaultActionGroup group = SetTodoFilterAction.createPopupActionGroup(myProject, myConfiguration.myTodoPanelSettings, consumer);
          ActionPopupMenu popupMenu = ActionManager.getInstance().createActionPopupMenu(ActionPlaces.TODO_VIEW_TOOLBAR, group);
          popupMenu.getComponent().show(linkLabel, 0, linkLabel.getHeight());
        }
      }, null);
      panel.add(linkLabel, BorderLayout.CENTER);

      CheckinHandlerUtil.disableWhenDumb(myProject, checkBox, "TODO check is impossible until indices are up-to-date");
      return panel;
    }

    private void setFilterText(final String filterName) {
      if (filterName == null) {
        checkBox.setText(VcsBundle.message("before.checkin.new.todo.check", IdeBundle.message("action.todo.show.all")));
      } else {
        checkBox.setText(VcsBundle.message("before.checkin.new.todo.check", "Filter: " + filterName));
      }
    }

    @Override
    public void refresh() {
    }

    @Override
    public void saveState() {
      myConfiguration.CHECK_NEW_TODO = checkBox.isSelected();
    }

    @Override
    public void restoreState() {
      checkBox.setSelected(myConfiguration.CHECK_NEW_TODO);
    }
  };
}
项目:intellij-ce-playground    文件:ShareDialog.java   
protected JPopupMenu createPopup(boolean toolWindow) {
  ActionPopupMenu menu = createShortPopupForRepositoryDialog(getRepositoryBrowser());
  return menu.getComponent();
}
项目:tools-idea    文件:InspectDebuggerTree.java   
public static ActionPopupMenu createPopupMenu() {
  ActionGroup group = (ActionGroup)ActionManager.getInstance().getAction(DebuggerActions.INSPECT_PANEL_POPUP);
  return ActionManager.getInstance().createActionPopupMenu(DebuggerActions.INSPECT_PANEL_POPUP, group);
}
项目:tools-idea    文件:WatchPanel.java   
protected ActionPopupMenu createPopupMenu() {
  return null;
}
项目:tools-idea    文件:InspectPanel.java   
protected ActionPopupMenu createPopupMenu() {
  return InspectDebuggerTree.createPopupMenu();
}
项目:tools-idea    文件:ThreadsPanel.java   
protected ActionPopupMenu createPopupMenu() {
  DefaultActionGroup group = (DefaultActionGroup)ActionManager.getInstance().getAction(DebuggerActions.THREADS_PANEL_POPUP);
  return ActionManager.getInstance().createActionPopupMenu(DebuggerActions.THREADS_PANEL_POPUP, group);
}
项目:tools-idea    文件:StripeButton.java   
private void showPopup(final Component component, final int x, final int y) {
  final ActionGroup group = myDecorator.createPopupGroup();
  final ActionPopupMenu popupMenu = ActionManager.getInstance().createActionPopupMenu(ActionPlaces.UNKNOWN, group);
  popupMenu.getComponent().show(component, x, y);
}
项目:tools-idea    文件:TodoCheckinHandler.java   
@Override
public RefreshableOnComponent getBeforeCheckinConfigurationPanel() {
  final JCheckBox checkBox = new JCheckBox(VcsBundle.message("before.checkin.new.todo.check", ""));
  return new RefreshableOnComponent() {
    @Override
    public JComponent getComponent() {
      JPanel panel = new JPanel(new BorderLayout(4, 0));
      panel.add(checkBox, BorderLayout.WEST);
      setFilterText(myConfiguration.myTodoPanelSettings.getTodoFilterName());
      if (myConfiguration.myTodoPanelSettings.getTodoFilterName() != null) {
        myTodoFilter = TodoConfiguration.getInstance().getTodoFilter(myConfiguration.myTodoPanelSettings.getTodoFilterName());
      }

      final Consumer<TodoFilter> consumer = new Consumer<TodoFilter>() {
        @Override
        public void consume(TodoFilter todoFilter) {
          myTodoFilter = todoFilter;
          final String name = todoFilter == null ? null : todoFilter.getName();
          myConfiguration.myTodoPanelSettings.setTodoFilterName(name);
          setFilterText(name);
        }
      };
      final LinkLabel linkLabel = new LinkLabel("Configure", null);
      linkLabel.setListener(new LinkListener() {
        @Override
        public void linkSelected(LinkLabel aSource, Object aLinkData) {
          DefaultActionGroup group = SetTodoFilterAction.createPopupActionGroup(myProject, myConfiguration.myTodoPanelSettings, consumer);
          ActionPopupMenu popupMenu = ActionManager.getInstance().createActionPopupMenu(ActionPlaces.TODO_VIEW_TOOLBAR, group);
          popupMenu.getComponent().show(linkLabel, 0, linkLabel.getHeight());
        }
      }, null);
      panel.add(linkLabel, BorderLayout.CENTER);

      refreshEnable(checkBox);
      return panel;
    }

    private void setFilterText(final String filterName) {
      if (filterName == null) {
        checkBox.setText(VcsBundle.message("before.checkin.new.todo.check", IdeBundle.message("action.todo.show.all")));
      } else {
        checkBox.setText(VcsBundle.message("before.checkin.new.todo.check", "Filter: " + filterName));
      }
    }

    @Override
    public void refresh() {
    }

    @Override
    public void saveState() {
      myConfiguration.CHECK_NEW_TODO = checkBox.isSelected();
    }

    @Override
    public void restoreState() {
      checkBox.setSelected(myConfiguration.CHECK_NEW_TODO);
    }
  };
}
项目:tools-idea    文件:ShareDialog.java   
protected JPopupMenu createPopup(boolean toolWindow) {
  ActionPopupMenu menu = createShortPopupForRepositoryDialog(getRepositoryBrowser());
  return menu.getComponent();
}