Package com.intellij.openapi.ui.popup

Examples of com.intellij.openapi.ui.popup.ListPopup


                        actionGroup.add(new SelectHistoryMethodAction(methodExecutionInput));
                    }
                }
            }

            ListPopup popup = JBPopupFactory.getInstance().createActionGroupPopup(
                    "Select method",
                    actionGroup,
                    DataManager.getInstance().getDataContext(getComponent()),
                    JBPopupFactory.ActionSelectionAid.SPEEDSEARCH,
                    true, null, 10);

            Point locationOnScreen = selectMethodActionPanel.getLocationOnScreen();
            Point location = new Point(
                    (int) (locationOnScreen.getX()),
                    (int) locationOnScreen.getY() + selectMethodActionPanel.getHeight());
            popup.showInScreenCoordinates(selectMethodActionPanel, location);
        }
View Full Code Here


        for (DBObjectType objectType : OBJECT_TYPES) {
            if (!settings.containsFilter(objectType)) {
                actionGroup.add(new CreateFilterForObjectTypeAction(objectType, settingsForm));
            }
        }
        ListPopup popup = JBPopupFactory.getInstance().createActionGroupPopup(
                "Select object type",
                actionGroup,
                e.getDataContext(),
                JBPopupFactory.ActionSelectionAid.SPEEDSEARCH,
                true, null, 10);

        Component component = (Component) e.getInputEvent().getSource();
        popup.showUnderneathOf(component);
    }
View Full Code Here

            actionGroup = new DefaultActionGroup();
            actionGroup.add(new CreateDDLFileAction(object));
            actionGroup.add(new AttachDDLFileAction(object));
            actionGroup.add(new DetachDDLFileAction(object));

            ListPopup popup = JBPopupFactory.getInstance().createActionGroupPopup(
                    "DDL File",
                    actionGroup,
                    e.getDataContext(),
                    JBPopupFactory.ActionSelectionAid.SPEEDSEARCH,
                    true, null, 10);
View Full Code Here

                    }
                }
            }

            if (actionGroup.getChildrenCount() > 1) {
                ListPopup popupBuilder = JBPopupFactory.getInstance().createActionGroupPopup(
                        "Select console connection",
                        actionGroup,
                        e.getDataContext(),
                        //JBPopupFactory.ActionSelectionAid.SPEEDSEARCH,
                        true,
                        true,
                        true,
                        null,
                        actionGroup.getChildrenCount(),
                        new Condition<AnAction>() {
                            @Override
                            public boolean value(AnAction action) {
                                SelectConnectionAction selectConnectionAction = (SelectConnectionAction) action;
                                return latestSelection == selectConnectionAction.connectionHandler;
                            }
                        });

                popupBuilder.showCenteredInCurrentWindow(project);
            } else {
                if (singleConnectionHandler != null) {
                    openSQLConsole(singleConnectionHandler);
                } else {
                    int selection = Messages.showDialog(project,
View Full Code Here

                    }
                }

                if (actionGroup.getChildrenCount() > 1) {
                    removeActionLock();
                    ListPopup popupBuilder = JBPopupFactory.getInstance().createActionGroupPopup(
                            "Select connection for lookup",
                            actionGroup,
                            event.getDataContext(),
                            //JBPopupFactory.ActionSelectionAid.SPEEDSEARCH,
                            true,
                            true,
                            true,
                            null,
                            actionGroup.getChildrenCount(),
                            new Condition<AnAction>() {
                                public boolean value(AnAction action) {
                                    SelectConnectionAction selectConnectionAction = (SelectConnectionAction) action;
                                    return latestSelection == selectConnectionAction.connectionHandler;
                                }
                            });

                    popupBuilder.showCenteredInCurrentWindow(project);
                } else {
                    showLookupPopup(event, project, singleConnectionHandler, null);
                }
            } else {
                ConnectionManager connectionManager = ConnectionManager.getInstance(project);
View Full Code Here

    public PopupChoiceAction() {
        actionGroup = (ActionGroup) ActionManager.getInstance().getAction("osmedile.ManipulateStringGroup");
    }

    public void actionPerformed(AnActionEvent e) {
        ListPopup popup = JBPopupFactory.getInstance().createActionGroupPopup(null, actionGroup,
                e.getDataContext(), JBPopupFactory.ActionSelectionAid.ALPHA_NUMBERING, false);

        popup.showInBestPositionFor(e.getDataContext());

    }
View Full Code Here

    });
    copyProfile.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        if (isModified(displayedSettings)) {
          ListPopup confirmation = createConfirmation(
              "Profile was modified, save changes to current profile?", "Yes", "No", new Runnable() {
                @Override
                public void run() {
                  exportDisplayedSettings();
                  copyProfile();
                }
              }, new Runnable() {
                @Override
                public void run() {
                  importFrom(displayedSettings);
                  copyProfile();
                }
              }, 0
          );

          confirmation.showInFocusCenter();
        } else {
          copyProfile();
        }
      }
View Full Code Here

            Object source = path.getLastPathComponent();
            ActionGroup actionGroup = source instanceof CssTreeNode ? ((CssTreeNode) source).getActionGroup() : null;

            if (actionGroup != null)
            {
                ListPopup listPopup = JBPopupFactory.getInstance().createActionGroupPopup(null,
                        actionGroup,
                        createDataContext(),
                        JBPopupFactory.ActionSelectionAid.MNEMONICS,
                        true);

                listPopup.showInScreenCoordinates(tree, point);
            }
        }
    }
View Full Code Here

    final List<Pair<PsiFile, BDDFrameworkType>> pairs = ContainerUtil.newArrayList(pairSortedSet);
    if (!pairs.isEmpty()) {
      pairs.add(0, null);

      final JBPopupFactory popupFactory = JBPopupFactory.getInstance();
      final ListPopup popupStep =
        popupFactory.createListPopup(new BaseListPopupStep<Pair<PsiFile, BDDFrameworkType>>(
          CucumberBundle.message("choose.step.definition.file"), ContainerUtil.newArrayList(pairs)) {
          @Override
          public boolean isSpeedSearchEnabled() {
            return true;
          }

          @NotNull
          @Override
          public String getTextFor(Pair<PsiFile, BDDFrameworkType> value) {
            if (value == null) {
              return CucumberBundle.message("create.new.file");
            }

            final VirtualFile file = value.getFirst().getVirtualFile();
            assert file != null;

            CucumberStepsIndex stepsIndex = CucumberStepsIndex.getInstance(value.getFirst().getProject());
            StepDefinitionCreator stepDefinitionCreator = stepsIndex.getExtensionMap().get(value.getSecond()).getStepDefinitionCreator();
            return stepDefinitionCreator.getStepDefinitionFilePath(value.getFirst());
          }

          @Override
          public Icon getIconFor(Pair<PsiFile, BDDFrameworkType> value) {
            return value == null ? AllIcons.Actions.CreateFromUsage : value.getFirst().getIcon(0);
          }

          @Override
          public PopupStep onChosen(final Pair<PsiFile, BDDFrameworkType> selectedValue, boolean finalChoice) {
            return doFinalStep(new Runnable() {
              public void run() {
                createStepOrSteps(step, selectedValue != null ? selectedValue.first : null);
              }
            });
          }
        });

      if (!ApplicationManager.getApplication().isUnitTestMode()) {
        popupStep.showCenteredInCurrentWindow(step.getProject());
      } else {
        new WriteCommandAction.Simple(step.getProject()) {
          @Override
          protected void run() throws Throwable {
            createStepOrSteps(step, pairs.get(1).getFirst());
View Full Code Here

  protected abstract void fillActions(Project project, DefaultActionGroup group);

  private static void showPopup(AnActionEvent e, DefaultActionGroup group) {
    if (group.getChildrenCount() == 0) return;
    final ListPopup popup = JBPopupFactory.getInstance()
      .createActionGroupPopup(e.getPresentation().getText(),
                              group,
                              e.getDataContext(),
                              JBPopupFactory.ActionSelectionAid.NUMBERING,
                              true);

    popup.showCenteredInCurrentWindow(e.getData(DataKeys.PROJECT));
  }
View Full Code Here

TOP

Related Classes of com.intellij.openapi.ui.popup.ListPopup

Copyright © 2018 www.massapicom. 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.