• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ListPopup类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.intellij.openapi.ui.popup.ListPopup的典型用法代码示例。如果您正苦于以下问题:Java ListPopup类的具体用法?Java ListPopup怎么用?Java ListPopup使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ListPopup类属于com.intellij.openapi.ui.popup包,在下文中一共展示了ListPopup类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: createLanguagePopup

import com.intellij.openapi.ui.popup.ListPopup; //导入依赖的package包/类
private ListPopup createLanguagePopup() {
  DefaultActionGroup actions = new DefaultActionGroup();
  for (final CodeFragmentFactory fragmentFactory : DebuggerUtilsEx.getCodeFragmentFactories(myContext)) {
    actions.add(new AnAction(fragmentFactory.getFileType().getLanguage().getDisplayName(), null, fragmentFactory.getFileType().getIcon()) {
      @Override
      public void actionPerformed(AnActionEvent e) {
        setFactory(fragmentFactory);
        setText(getText());
        IdeFocusManager.getInstance(getProject()).requestFocus(DebuggerEditorImpl.this, true);
      }
    });
  }

  DataContext dataContext = DataManager.getInstance().getDataContext(this);
  return JBPopupFactory.getInstance().createActionGroupPopup("Choose Language", actions, dataContext,
                                                             JBPopupFactory.ActionSelectionAid.SPEEDSEARCH,
                                                             false);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:DebuggerEditorImpl.java


示例2: chooseTypeAndCreate

import com.intellij.openapi.ui.popup.ListPopup; //导入依赖的package包/类
public static void chooseTypeAndCreate(final ClasspathPanel classpathPanel,
                                       final StructureConfigurableContext context,
                                       final JButton contextButton, @NotNull final LibraryCreatedCallback callback) {
  if (LibraryEditingUtil.hasSuitableTypes(classpathPanel)) {
    final ListPopup popup = JBPopupFactory.getInstance().createListPopup(LibraryEditingUtil.createChooseTypeStep(classpathPanel, new ParameterizedRunnable<LibraryType>() {
      @Override
      public void run(LibraryType libraryType) {
        doCreateLibrary(classpathPanel, context, callback, contextButton, libraryType);
      }
    }));
    popup.showUnderneathOf(contextButton);
  }
  else {
    doCreateLibrary(classpathPanel, context, callback, contextButton, null);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:AddNewLibraryDependencyAction.java


示例3: actionPerformed

import com.intellij.openapi.ui.popup.ListPopup; //导入依赖的package包/类
@Override
public void actionPerformed(@NotNull AnActionEvent e) {
  Project project = e.getRequiredData(CommonDataKeys.PROJECT);
  VcsLogUi logUi = e.getRequiredData(VcsLogDataKeys.VCS_LOG_UI);
  VcsLogSettings settings = ServiceManager.getService(project, VcsLogSettings.class);

  ListPopup popup = JBPopupFactory.getInstance()
    .createActionGroupPopup(null, new MySettingsActionGroup(settings, logUi), 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);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:VcsLogQuickSettingsActions.java


示例4: actionPerformed

import com.intellij.openapi.ui.popup.ListPopup; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
  final VcsLogUi logUI = e.getRequiredData(VcsLogDataKeys.VCS_LOG_UI);

  ActionGroup settingsGroup =
    new DefaultActionGroup(ContainerUtil.map(PermanentGraph.SortType.values(), new Function<PermanentGraph.SortType, AnAction>() {
      @Override
      public AnAction fun(PermanentGraph.SortType sortType) {
        return new SelectIntelliSortTypeAction(logUI, sortType);
      }
    }));


  ListPopup popup = JBPopupFactory.getInstance()
    .createActionGroupPopup(null, settingsGroup, 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);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:IntelliSortChooserPopupAction.java


示例5: showPopup

import com.intellij.openapi.ui.popup.ListPopup; //导入依赖的package包/类
protected void showPopup(DataContext context, ListPopup popup, JComponent contextComponent) {
  Component focusedComponent = contextComponent != null ? contextComponent : PlatformDataKeys.CONTEXT_COMPONENT.getData(context);
  if (focusedComponent != null) {
    if (popup instanceof PopupFactoryImpl.ActionGroupPopup && focusedComponent instanceof JLabel) {
      ((PopupFactoryImpl.ActionGroupPopup)popup).showUnderneathOfLabel((JLabel)focusedComponent);
    } else {
      popup.showUnderneathOf(focusedComponent);
    }
  }
  else {
    Rectangle r;
    int x;
    int y;
    focusedComponent = WindowManagerEx.getInstanceEx().getFocusedComponent((Project)null);
    r = WindowManagerEx.getInstanceEx().getScreenBounds();
    x = r.x + r.width / 2;
    y = r.y + r.height / 2;
    Point point = new Point(x, y);
    SwingUtilities.convertPointToScreen(point, focusedComponent.getParent());

    popup.showInScreenCoordinates(focusedComponent.getParent(), point);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:WelcomePopupAction.java


示例6: MultipleTextValuesPresentationWrapper

import com.intellij.openapi.ui.popup.ListPopup; //导入依赖的package包/类
private MultipleTextValuesPresentationWrapper(@NotNull final StatusBarWidget.MultipleTextValuesPresentation presentation) {
  super();
  myPresentation = presentation;

  putClientProperty(UIUtil.CENTER_TOOLTIP_DEFAULT, Boolean.TRUE);
  setToolTipText(presentation.getTooltipText());
  new ClickListener() {
    @Override
    public boolean onClick(@NotNull MouseEvent e, int clickCount) {
      final ListPopup popup = myPresentation.getPopupStep();
      if (popup == null) return false;
      final Dimension dimension = popup.getContent().getPreferredSize();
      final Point at = new Point(0, -dimension.height);
      popup.show(new RelativePoint(e.getComponent(), at));
      return true;
    }
  }.installOn(this);


  setOpaque(false);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:IdeStatusBarImpl.java


示例7: showPopup

import com.intellij.openapi.ui.popup.ListPopup; //导入依赖的package包/类
private void showPopup(MouseEvent e) {
  if (!myActionEnabled) {
    return;
  }
  DataContext dataContext = getContext();
  AnAction group = ActionManager.getInstance().getAction("ChangeLineSeparators");
  if (!(group instanceof ActionGroup)) {
    return;
  }

  ListPopup popup = JBPopupFactory.getInstance().createActionGroupPopup(
    "Line separator",
    (ActionGroup)group,
    dataContext,
    JBPopupFactory.ActionSelectionAid.SPEEDSEARCH,
    false
  );
  Dimension dimension = popup.getContent().getPreferredSize();
  Point at = new Point(0, -dimension.height);
  popup.show(new RelativePoint(e.getComponent(), at));
  Disposer.register(this, popup); // destroy popup on unexpected project close
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:LineSeparatorPanel.java


示例8: createPopup

import com.intellij.openapi.ui.popup.ListPopup; //导入依赖的package包/类
@Nullable
public ListPopup createPopup(@NotNull DataContext dataContext) {
  final VirtualFile virtualFile = CommonDataKeys.VIRTUAL_FILE.getData(dataContext);
  if (virtualFile == null) return null;
  boolean enabled = checkEnabled(virtualFile);
  if (!enabled) return null;
  Editor editor = CommonDataKeys.EDITOR.getData(dataContext);
  FileDocumentManager documentManager = FileDocumentManager.getInstance();
  final Document document = documentManager.getDocument(virtualFile);
  if (!allowDirectories && virtualFile.isDirectory() || document == null && !virtualFile.isDirectory()) return null;

  final byte[] bytes;
  try {
    bytes = virtualFile.isDirectory() ? null : virtualFile.contentsToByteArray();
  }
  catch (IOException e) {
    return null;
  }
  DefaultActionGroup group = createActionGroup(virtualFile, editor, document, bytes, null);

  return JBPopupFactory.getInstance().createActionGroupPopup(getTemplatePresentation().getText(),
    group, dataContext, JBPopupFactory.ActionSelectionAid.SPEEDSEARCH, false);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:ChangeFileEncodingAction.java


示例9: actionPerformed

import com.intellij.openapi.ui.popup.ListPopup; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
  show(getFile(e), new ShowAction() {
    @Override
    public void show(final ListPopup popup) {
      DataManager dataManager = DataManager.getInstance();
      if (dataManager != null) {
        dataManager.getDataContextFromFocus().doWhenDone(new Consumer<DataContext>() {
          @Override
          public void consume(DataContext context) {
            popup.showInBestPositionFor(context);
          }
        });
      }
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:ShowFilePathAction.java


示例10: createPopup

import com.intellij.openapi.ui.popup.ListPopup; //导入依赖的package包/类
private static ListPopup createPopup(final ArrayList<VirtualFile> files, final ArrayList<Icon> icons) {
  final BaseListPopupStep<VirtualFile> step = new BaseListPopupStep<VirtualFile>("File Path", files, icons) {
    @NotNull
    @Override
    public String getTextFor(final VirtualFile value) {
      return value.getPresentableName();
    }

    @Override
    public PopupStep onChosen(final VirtualFile selectedValue, final boolean finalChoice) {
      final File selectedFile = new File(getPresentableUrl(selectedValue));
      if (selectedFile.exists()) {
        ApplicationManager.getApplication().executeOnPooledThread(new Runnable() {
          @Override
          public void run() {
            openFile(selectedFile);
          }
        });
      }
      return FINAL_CHOICE;
    }
  };

  return JBPopupFactory.getInstance().createListPopup(step);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:ShowFilePathAction.java


示例11: createLanguagePopup

import com.intellij.openapi.ui.popup.ListPopup; //导入依赖的package包/类
private ListPopup createLanguagePopup() {
  DefaultActionGroup actions = new DefaultActionGroup();
  for (final Language language : getEditorsProvider().getSupportedLanguages(myProject, mySourcePosition)) {
    //noinspection ConstantConditions
    actions.add(new AnAction(language.getDisplayName(), null, language.getAssociatedFileType().getIcon()) {
      @Override
      public void actionPerformed(@NotNull AnActionEvent e) {
        XExpression currentExpression = getExpression();
        setExpression(new XExpressionImpl(currentExpression.getExpression(), language, currentExpression.getCustomInfo()));
        requestFocusInEditor();
      }
    });
  }

  DataContext dataContext = DataManager.getInstance().getDataContext(getComponent());
  return JBPopupFactory.getInstance().createActionGroupPopup("Choose language", actions, dataContext,
                                                             JBPopupFactory.ActionSelectionAid.SPEEDSEARCH,
                                                             false);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:XDebuggerEditorBase.java


示例12: actionPerformed

import com.intellij.openapi.ui.popup.ListPopup; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
  final DefaultActionGroup dag = new DefaultActionGroup();
  dag.add(myUsual);
  dag.add(myNumbered);
  dag.add(new Separator());
  dag.add(mySoftWrapsAction);
  final ListPopup popup = JBPopupFactory.getInstance().createActionGroupPopup(null, dag, e.getDataContext(),
                                                                                   JBPopupFactory.ActionSelectionAid.SPEEDSEARCH,
                                                                                   false);
  if (e.getInputEvent() instanceof MouseEvent) {
    popup.show(new RelativePoint((MouseEvent)e.getInputEvent()));
  } else {
    // todo correct
    /*final Dimension dimension = popup.getContent().getPreferredSize();
    final Point at = new Point(-dimension.width / 2, 0);
    popup.show(new RelativePoint(myParent, at));*/
    popup.showInBestPositionFor(e.getDataContext());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:ChangesFragmentedDiffPanel.java


示例13: actionPerformed

import com.intellij.openapi.ui.popup.ListPopup; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
  final AnAction[] actions = getChildren(e);
  if (actions.length > 1) {
    final DefaultActionGroup group = new DefaultActionGroup();
    for (final AnAction action : actions) {
      group.add(action);
    }

    final DataContext dataContext = e.getDataContext();
    final ListPopup groupPopup =
      JBPopupFactory.getInstance().createActionGroupPopup(null,
                                                          group, dataContext, JBPopupFactory.ActionSelectionAid.NUMBERING, true);

    showPopup(groupPopup, e);
  }
  else if (actions.length == 1) {
    actions[0].actionPerformed(e);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:AddDomElementAction.java


示例14: createComboBoxButton

import com.intellij.openapi.ui.popup.ListPopup; //导入依赖的package包/类
@Override
protected FlatComboButton createComboBoxButton(Presentation presentation) {
  if (myShowDisabledActions) {
    return new FlatComboButton(presentation) {
      @Override
      protected JBPopup createPopup(Runnable onDispose) {
        ListPopup popup = JBPopupFactory.getInstance().createActionGroupPopup(
          null, createPopupActionGroup(this), getDataContext(), JBPopupFactory.ActionSelectionAid.SPEEDSEARCH, true, onDispose,
          getMaxRows());
        popup.setMinimumSize(new Dimension(getMinWidth(), getMinHeight()));
        return popup;
      }
    };
  }
  return super.createComboBoxButton(presentation);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:AbstractComboBoxAction.java


示例15: showIntentionPopup

import com.intellij.openapi.ui.popup.ListPopup; //导入依赖的package包/类
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<ErrorWithFix>();
  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());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:QuickFixManager.java


示例16: actionPerformed

import com.intellij.openapi.ui.popup.ListPopup; //导入依赖的package包/类
protected void actionPerformed(final GuiEditor editor, final List<RadComponent> selection, final AnActionEvent e) {
  Processor<ComponentItem> processor = new Processor<ComponentItem>() {
    public boolean process(final ComponentItem selectedValue) {
      if (selectedValue != null) {
        myLastCreatedComponent = selectedValue;
        editor.getMainProcessor().startInsertProcessor(selectedValue, getCreateLocation(editor, selection));
      }
      return true;
    }
  };

  PaletteListPopupStep step = new PaletteListPopupStep(editor, myLastCreatedComponent, processor,
                                                       UIDesignerBundle.message("create.component.title"));
  final ListPopup listPopup = JBPopupFactory.getInstance().createListPopup(step);

  if (selection.size() > 0) {
    FormEditingUtil.showPopupUnderComponent(listPopup, selection.get(0));
  }
  else {
    listPopup.showInCenterOf(editor.getRootContainer().getDelegee());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:CreateComponentAction.java


示例17: selectBranchAndPerformAction

import com.intellij.openapi.ui.popup.ListPopup; //导入依赖的package包/类
private static void selectBranchAndPerformAction(@NotNull VcsLogDataPack dataPack,
                                                 @NotNull AnActionEvent event,
                                                 @NotNull final Consumer<String> consumer,
                                                 @NotNull Collection<VirtualFile> visibleRoots) {
  ActionGroup actionGroup = BranchFilterPopupComponent.constructActionGroup(dataPack, null, new Function<String, AnAction>() {
    @Override
    public AnAction fun(final String s) {
      return new DumbAwareAction(s) {
        @Override
        public void actionPerformed(AnActionEvent e) {
          consumer.consume(s);
        }
      };
    }
  }, visibleRoots);
  ListPopup popup = JBPopupFactory.getInstance().createActionGroupPopup("Select branch to compare", actionGroup, event.getDataContext(),
                                                                        false, false, false, null, -1, null);
  InputEvent inputEvent = event.getInputEvent();
  if (inputEvent instanceof MouseEvent) {
    popup.show(new RelativePoint((MouseEvent)inputEvent));
  }
  else {
    popup.showInBestPositionFor(event.getDataContext());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:DeepCompareAction.java


示例18: createComboBoxButton

import com.intellij.openapi.ui.popup.ListPopup; //导入依赖的package包/类
@Override
protected ComboBoxButton createComboBoxButton(Presentation presentation) {
  if (myShowDisabledActions) {
    return new ComboBoxButton(presentation) {
      @Override
      protected JBPopup createPopup(Runnable onDispose) {
        ListPopup popup = JBPopupFactory.getInstance().createActionGroupPopup(
          null, createPopupActionGroup(this), getDataContext(), JBPopupFactory.ActionSelectionAid.SPEEDSEARCH, true, onDispose,
          getMaxRows());
        popup.setMinimumSize(new Dimension(getMinWidth(), getMinHeight()));
        return popup;
      }
    };
  }
  return super.createComboBoxButton(presentation);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:AbstractComboBoxAction.java


示例19: doSmartStep

import com.intellij.openapi.ui.popup.ListPopup; //导入依赖的package包/类
/**
 * Override this if you haven't PsiMethod, like in Kotlin.
 * @param position
 * @param session
 * @param fileEditor
 * @return false to continue for another handler or for default action (step into)
 */
public boolean doSmartStep(SourcePosition position, final DebuggerSession session, TextEditor fileEditor) {
  final List<PsiMethod> methods = findReferencedMethods(position);
  if (methods.size() > 0) {
    if (methods.size() == 1) {
      session.stepInto(true, getSmartStepFilter(methods.get(0)));
    }
    else {
      final PsiMethodListPopupStep popupStep = new PsiMethodListPopupStep(methods, new PsiMethodListPopupStep.OnChooseRunnable() {
        public void execute(PsiMethod chosenMethod) {
          session.stepInto(true, getSmartStepFilter(chosenMethod));
        }
      });
      final ListPopup popup = JBPopupFactory.getInstance().createListPopup(popupStep);
      final RelativePoint point = DebuggerUIUtil.calcPopupLocation(((TextEditor)fileEditor).getEditor(), position.getLine());
      popup.show(point);
    }
    return true;
  }
  return false;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:28,代码来源:JvmSmartStepIntoHandler.java


示例20: createLanguagePopup

import com.intellij.openapi.ui.popup.ListPopup; //导入依赖的package包/类
private ListPopup createLanguagePopup() {
  DefaultActionGroup actions = new DefaultActionGroup();
  for (final CodeFragmentFactory fragmentFactory : DebuggerUtilsEx.getCodeFragmentFactories(myContext)) {
    actions.add(new AnAction(fragmentFactory.getFileType().getLanguage().getDisplayName(), null, fragmentFactory.getFileType().getIcon()) {
      @Override
      public void actionPerformed(AnActionEvent e) {
        setFactory(fragmentFactory);
        setText(getText());
        IdeFocusManager.getInstance(getProject()).requestFocus(DebuggerEditorImpl.this, true);
      }
    });
  }

  DataContext dataContext = DataManager.getInstance().getDataContext(this);
  return JBPopupFactory.getInstance().createActionGroupPopup("Choose language", actions, dataContext,
                                                                        JBPopupFactory.ActionSelectionAid.SPEEDSEARCH,
                                                                        false);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:19,代码来源:DebuggerEditorImpl.java



注:本文中的com.intellij.openapi.ui.popup.ListPopup类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Registry类代码示例发布时间:2022-05-21
下一篇:
Java NotPersistent类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap