List of usage examples for com.intellij.openapi.ui.popup JBPopupFactory createActionGroupPopup
@NotNull public ListPopup createActionGroupPopup(@Nullable @Nls(capitalization = Nls.Capitalization.Title) String title, @NotNull ActionGroup actionGroup, @NotNull DataContext dataContext, ActionSelectionAid selectionAidMethod, boolean showDisabledActions)
From source file:com.intellij.uiDesigner.actions.CreateListenerAction.java
License:Apache License
protected void actionPerformed(final GuiEditor editor, final List<RadComponent> selection, final AnActionEvent e) { final DefaultActionGroup actionGroup = prepareActionGroup(selection); final JComponent selectedComponent = selection.get(0).getDelegee(); final DataContext context = DataManager.getInstance().getDataContext(selectedComponent); final JBPopupFactory factory = JBPopupFactory.getInstance(); final ListPopup popup = factory.createActionGroupPopup(UIDesignerBundle.message("create.listener.title"), actionGroup, context, JBPopupFactory.ActionSelectionAid.NUMBERING, true); FormEditingUtil.showPopupUnderComponent(popup, selection.get(0)); }
From source file:com.intellij.uiDesigner.designSurface.ListenerNavigateButton.java
License:Apache License
public static void showNavigatePopup(final RadComponent component, final boolean showIfEmpty) { final DefaultActionGroup actionGroup = prepareActionGroup(component); if (actionGroup != null && actionGroup.getChildrenCount() == 0 && showIfEmpty) { actionGroup.add(new MyNavigateAction(UIDesignerBundle.message("navigate.to.listener.empty"), null)); }// w ww . j av a 2 s . co m if (actionGroup != null && actionGroup.getChildrenCount() > 0) { final DataContext context = DataManager.getInstance().getDataContext(component.getDelegee()); final JBPopupFactory factory = JBPopupFactory.getInstance(); final ListPopup popup = factory.createActionGroupPopup( UIDesignerBundle.message("navigate.to.listener.title"), actionGroup, context, JBPopupFactory.ActionSelectionAid.NUMBERING, true); FormEditingUtil.showPopupUnderComponent(popup, component); } }
From source file:ru.scratch.OpenScratchListAction.java
License:Apache License
private void showListPopup(AnActionEvent event, DefaultActionGroup actionGroup, Project project) { JBPopupFactory factory = JBPopupFactory.getInstance(); ListPopup listPopup = factory.createActionGroupPopup(POPUP_TITLE, actionGroup, event.getDataContext(), NUMBERING, true);//www . j a va 2 s . c o m listPopup.showCenteredInCurrentWindow(project); }