当前位置: 首页>>代码示例>>Java>>正文


Java ListPopup.setMinimumSize方法代码示例

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


在下文中一共展示了ListPopup.setMinimumSize方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: 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

示例2: 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

示例3: actionPerformed

import com.intellij.openapi.ui.popup.ListPopup; //导入方法依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
  JComponent button = (JComponent)e.getPresentation().getClientProperty(CUSTOM_COMPONENT_PROPERTY);
  if (button == null) {
    Component contextComponent = e.getData(PlatformDataKeys.CONTEXT_COMPONENT);
    JRootPane rootPane = UIUtil.getParentOfType(JRootPane.class, contextComponent);
    if (rootPane != null) {
      button = (ComboBoxButton)
        UIUtil.uiTraverser().withRoot(rootPane).bfsTraversal().filter(new Condition<Component>() {
          @Override
          public boolean value(Component component) {
            return component instanceof ComboBoxButton && ((ComboBoxButton)component).getMyAction() == ComboBoxAction.this;
          }
        }).first();
    }
    if (button == null) return;
  }
  if (!button.isShowing()) return;
  if (button instanceof ComboBoxButton) {
    ((ComboBoxButton)button).showPopup();
  } else {
    DataContext context = e.getDataContext();
    Project project = e.getProject();
    if (project == null) return;
    DefaultActionGroup group = createPopupActionGroup(button);
    ListPopup popup = JBPopupFactory.getInstance().createActionGroupPopup(
      myPopupTitle, group, context, false, shouldShowDisabledActions(), false, null, getMaxRows(), getPreselectCondition());
    popup.setMinimumSize(new Dimension(getMinWidth(), getMinHeight()));
    popup.showCenteredInCurrentWindow(project);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:32,代码来源:ComboBoxAction.java

示例4: createPopup

import com.intellij.openapi.ui.popup.ListPopup; //导入方法依赖的package包/类
protected JBPopup createPopup(Runnable onDispose) {
  DefaultActionGroup group = createPopupActionGroup(this);

  DataContext context = getDataContext();
  ListPopup popup = JBPopupFactory.getInstance().createActionGroupPopup(
    myPopupTitle, group, context, false, shouldShowDisabledActions(), false, onDispose, getMaxRows(), getPreselectCondition());
  popup.setMinimumSize(new Dimension(getMinWidth(), getMinHeight()));
  return popup;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:ComboBoxAction.java

示例5: createPopup

import com.intellij.openapi.ui.popup.ListPopup; //导入方法依赖的package包/类
protected JBPopup createPopup(Runnable onDispose) {
  DefaultActionGroup group = createPopupActionGroup(this);

  DataContext context = getDataContext();
  myDataContext = null;
  final ListPopup popup = JBPopupFactory.getInstance()
    .createActionGroupPopup(null, group, context, JBPopupFactory.ActionSelectionAid.SPEEDSEARCH, true, onDispose, getMaxRows());
  popup.setMinimumSize(new Dimension(getMinWidth(), getMinHeight()));
  return popup;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:FlatComboAction.java

示例6: createPopup

import com.intellij.openapi.ui.popup.ListPopup; //导入方法依赖的package包/类
protected JBPopup createPopup(Runnable onDispose) {
  DefaultActionGroup group = createPopupActionGroup(this);

  DataContext context = getDataContext();
  myDataContext = null;
  final ListPopup popup = JBPopupFactory.getInstance().createActionGroupPopup(
    null, group, context, JBPopupFactory.ActionSelectionAid.SPEEDSEARCH, false, onDispose, getMaxRows());
  popup.setMinimumSize(new Dimension(getMinWidth(), getMinHeight()));
  return popup;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:11,代码来源:ComboBoxAction.java

示例7: createPopup

import com.intellij.openapi.ui.popup.ListPopup; //导入方法依赖的package包/类
protected JBPopup createPopup(Runnable onDispose) {
  DefaultActionGroup group = myComboBoxAction.createPopupActionGroup(this);

  DataContext context = getDataContext();
  ListPopup popup = JBPopupFactory.getInstance()
          .createActionGroupPopup(myComboBoxAction.getPopupTitle(), group, context, false, myComboBoxAction.shouldShowDisabledActions(), false, onDispose,
                                  myComboBoxAction.getMaxRows(), myComboBoxAction.getPreselectCondition());
  popup.setMinimumSize(new Dimension(myComboBoxAction.getMinWidth(), myComboBoxAction.getMinHeight()));
  return popup;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:11,代码来源:ComboBoxButton.java

示例8: invoke

import com.intellij.openapi.ui.popup.ListPopup; //导入方法依赖的package包/类
@Override
public void invoke(@NotNull final Project project, final Editor editor, @NotNull PsiElement element) throws IncorrectOperationException {

    Set<String> vars = new HashSet<String>();
    boolean isFunc = false;

    if (guessFunction(element)) {
        vars = WeexFileUtil.getAllFunctionNames(element);
        isFunc = true;
    } else {
        vars = WeexFileUtil.getAllVarNames(element).keySet();
        isFunc = false;
    }
    final boolean isFuncFinal = isFunc;

    ListPopup listPopup = JBPopupFactory.getInstance()
            .createListPopup(new BaseListPopupStep<String>(null, vars.toArray(new String[vars.size()])) {

                @Override
                public Icon getIconFor(String value) {
                    return isFuncFinal ? PlatformIcons.FUNCTION_ICON : PlatformIcons.VARIABLE_ICON;
                }

                @Override
                public PopupStep onChosen(final String selectedValue, final boolean finalChoice) {
                    new WriteCommandAction(project) {
                        @Override
                        protected void run(@NotNull Result result) throws Throwable {
                            editor.getDocument().insertString(editor.getCaretModel().getOffset(), "{{" + selectedValue + "}}");
                            int start = editor.getSelectionModel().getSelectionStart();
                            int end = editor.getSelectionModel().getSelectionEnd();
                            editor.getDocument().replaceString(start, end, "");
                        }
                    }.execute();
                    return super.onChosen(selectedValue, finalChoice);

                }
            });
    listPopup.setMinimumSize(new Dimension(240, -1));
    listPopup.showInBestPositionFor(editor);
}
 
开发者ID:misakuo,项目名称:weex-language-support,代码行数:42,代码来源:TagTextIntention.java

示例9: showContentPopup

import com.intellij.openapi.ui.popup.ListPopup; //导入方法依赖的package包/类
@Override
public void showContentPopup(ListPopup listPopup) {
  final int width = myComboLabel.getSize().width;
  listPopup.setMinimumSize(new Dimension(width, 0));
  listPopup.show(new RelativePoint(myComboLabel, new Point(-2, myComboLabel.getHeight())));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:ComboContentLayout.java


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