Search in sources :

Example 36 with ListPopup

use of com.intellij.openapi.ui.popup.ListPopup in project intellij-community by JetBrains.

the class QuickFixManager method showIntentionPopup.

final void showIntentionPopup() {
    LOG.debug("showIntentionPopup()");
    if (myHint == null || !myHint.isVisible()) {
        return;
    }
    final ErrorInfo[] errorInfos = getErrorInfos();
    if (!haveFixes(errorInfos)) {
        return;
    }
    final ArrayList<ErrorWithFix> fixList = new ArrayList<>();
    for (ErrorInfo errorInfo : errorInfos) {
        final QuickFix[] quickFixes = errorInfo.myFixes;
        if (quickFixes.length > 0) {
            for (QuickFix fix : quickFixes) {
                fixList.add(new ErrorWithFix(errorInfo, fix));
            }
        } else if (errorInfo.getInspectionId() != null) {
            buildSuppressFixes(errorInfo, fixList, true);
        }
    }
    final ListPopup popup = JBPopupFactory.getInstance().createListPopup(new QuickFixPopupStep(fixList, true));
    popup.showUnderneathOf(myHint.getComponent());
}
Also used : ErrorInfo(com.intellij.uiDesigner.ErrorInfo) ArrayList(java.util.ArrayList) ListPopup(com.intellij.openapi.ui.popup.ListPopup)

Example 37 with ListPopup

use of com.intellij.openapi.ui.popup.ListPopup in project intellij-community by JetBrains.

the class VcsLogPopupComponent method showPopupMenu.

private void showPopupMenu() {
    ListPopup popup = createPopupMenu();
    popup.showUnderneathOf(this);
}
Also used : ListPopup(com.intellij.openapi.ui.popup.ListPopup)

Example 38 with ListPopup

use of com.intellij.openapi.ui.popup.ListPopup in project intellij-community by JetBrains.

the class VcsLogGearActionGroup method actionPerformed.

@Override
public void actionPerformed(@NotNull AnActionEvent e) {
    DefaultActionGroup group = new DefaultActionGroup(ActionManager.getInstance().getAction(myActionGroup));
    ListPopup popup = JBPopupFactory.getInstance().createActionGroupPopup(null, group, e.getDataContext(), JBPopupFactory.ActionSelectionAid.MNEMONICS, true, ToolWindowContentUi.POPUP_PLACE);
    Component component = e.getInputEvent().getComponent();
    if (component instanceof ActionButtonComponent) {
        popup.showUnderneathOf(component);
    } else {
        popup.showInCenterOf(component);
    }
}
Also used : ActionButtonComponent(com.intellij.openapi.actionSystem.ActionButtonComponent) ListPopup(com.intellij.openapi.ui.popup.ListPopup) ActionButtonComponent(com.intellij.openapi.actionSystem.ActionButtonComponent) DefaultActionGroup(com.intellij.openapi.actionSystem.DefaultActionGroup)

Example 39 with ListPopup

use of com.intellij.openapi.ui.popup.ListPopup in project intellij-community by JetBrains.

the class SurroundPopupAction method actionPerformed.

protected void actionPerformed(final GuiEditor editor, final List<RadComponent> selection, final AnActionEvent e) {
    final ListPopup groupPopup = JBPopupFactory.getInstance().createActionGroupPopup(UIDesignerBundle.message("surround.with.popup.title"), myActionGroup, e.getDataContext(), JBPopupFactory.ActionSelectionAid.ALPHA_NUMBERING, true);
    final JComponent component = (JComponent) e.getData(PlatformDataKeys.CONTEXT_COMPONENT);
    if (component instanceof ComponentTree) {
        groupPopup.show(JBPopupFactory.getInstance().guessBestPopupLocation(component));
    } else {
        RadComponent selComponent = selection.get(0);
        FormEditingUtil.showPopupUnderComponent(groupPopup, selComponent);
    }
}
Also used : ListPopup(com.intellij.openapi.ui.popup.ListPopup) RadComponent(com.intellij.uiDesigner.radComponents.RadComponent) ComponentTree(com.intellij.uiDesigner.componentTree.ComponentTree)

Example 40 with ListPopup

use of com.intellij.openapi.ui.popup.ListPopup in project intellij-community by JetBrains.

the class GitDiffFromHistoryHandler method showPopup.

private void showPopup(@NotNull AnActionEvent event, @NotNull GitFileRevision rev, @NotNull FilePath filePath, @NotNull Collection<GitFileRevision> parents) {
    ActionGroup parentActions = createActionGroup(rev, filePath, parents);
    DataContext dataContext = SimpleDataContext.getProjectContext(myProject);
    ListPopup popup = JBPopupFactory.getInstance().createActionGroupPopup("Choose parent to compare", parentActions, dataContext, JBPopupFactory.ActionSelectionAid.NUMBERING, true);
    showPopupInBestPosition(popup, event, dataContext);
}
Also used : SimpleDataContext(com.intellij.openapi.actionSystem.impl.SimpleDataContext) ListPopup(com.intellij.openapi.ui.popup.ListPopup)

Aggregations

ListPopup (com.intellij.openapi.ui.popup.ListPopup)49 JBPopupFactory (com.intellij.openapi.ui.popup.JBPopupFactory)11 BaseListPopupStep (com.intellij.openapi.ui.popup.util.BaseListPopupStep)10 NotNull (org.jetbrains.annotations.NotNull)10 RelativePoint (com.intellij.ui.awt.RelativePoint)8 DefaultActionGroup (com.intellij.openapi.actionSystem.DefaultActionGroup)7 Project (com.intellij.openapi.project.Project)7 PopupStep (com.intellij.openapi.ui.popup.PopupStep)7 DataContext (com.intellij.openapi.actionSystem.DataContext)5 DumbAwareAction (com.intellij.openapi.project.DumbAwareAction)4 RadComponent (com.intellij.uiDesigner.radComponents.RadComponent)4 MouseEvent (java.awt.event.MouseEvent)4 ArrayList (java.util.ArrayList)4 AnActionEvent (com.intellij.openapi.actionSystem.AnActionEvent)3 SimpleDataContext (com.intellij.openapi.actionSystem.impl.SimpleDataContext)3 VirtualFile (com.intellij.openapi.vfs.VirtualFile)3 Nullable (org.jetbrains.annotations.Nullable)3 JBScrollPane (com.intellij.ui.components.JBScrollPane)2 GuiEditor (com.intellij.uiDesigner.designSurface.GuiEditor)2 java.awt (java.awt)2