本文整理汇总了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);
}
示例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);
}
示例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);
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
示例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())));
}