本文整理汇总了Java中com.intellij.openapi.ui.popup.ListPopupStep类的典型用法代码示例。如果您正苦于以下问题:Java ListPopupStep类的具体用法?Java ListPopupStep怎么用?Java ListPopupStep使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ListPopupStep类属于com.intellij.openapi.ui.popup包,在下文中一共展示了ListPopupStep类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: buildStep
import com.intellij.openapi.ui.popup.ListPopupStep; //导入依赖的package包/类
private static ListPopupStep buildStep(@NotNull final List<Pair<AnAction, KeyStroke>> actions, final DataContext ctx) {
return new BaseListPopupStep<Pair<AnAction, KeyStroke>>("Choose an action", ContainerUtil.findAll(actions, new Condition<Pair<AnAction, KeyStroke>>() {
@Override
public boolean value(Pair<AnAction, KeyStroke> pair) {
final AnAction action = pair.getFirst();
final Presentation presentation = action.getTemplatePresentation().clone();
AnActionEvent event = new AnActionEvent(null, ctx,
ActionPlaces.UNKNOWN,
presentation,
ActionManager.getInstance(),
0);
ActionUtil.performDumbAwareUpdate(action, event, true);
return presentation.isEnabled() && presentation.isVisible();
}
})) {
@Override
public PopupStep onChosen(Pair<AnAction, KeyStroke> selectedValue, boolean finalChoice) {
invokeAction(selectedValue.getFirst(), ctx);
return FINAL_CHOICE;
}
};
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:IdeKeyEventDispatcher.java
示例2: buildStep
import com.intellij.openapi.ui.popup.ListPopupStep; //导入依赖的package包/类
private static ListPopupStep buildStep(@Nonnull final List<Pair<AnAction, KeyStroke>> actions, final DataContext ctx) {
return new BaseListPopupStep<Pair<AnAction, KeyStroke>>("Choose an action", ContainerUtil.findAll(actions, pair -> {
final AnAction action = pair.getFirst();
final Presentation presentation = action.getTemplatePresentation().clone();
AnActionEvent event = new AnActionEvent(null, ctx, ActionPlaces.UNKNOWN, presentation, ActionManager.getInstance(), 0);
ActionUtil.performDumbAwareUpdate(LaterInvocator.isInModalContext(), action, event, true);
return presentation.isEnabled() && presentation.isVisible();
})) {
@Override
public PopupStep onChosen(Pair<AnAction, KeyStroke> selectedValue, boolean finalChoice) {
invokeAction(selectedValue.getFirst(), ctx);
return FINAL_CHOICE;
}
};
}
开发者ID:consulo,项目名称:consulo,代码行数:17,代码来源:IdeKeyEventDispatcher.java
示例3: actionPerformed
import com.intellij.openapi.ui.popup.ListPopupStep; //导入依赖的package包/类
public void actionPerformed(AnActionEvent e) {
final JBPopupFactory popupFactory = JBPopupFactory.getInstance();
final ListPopupStep popupStep = popupFactory.createActionsStep(myGroup, e.getDataContext(), false, false,
myGroup.getTemplatePresentation().getText(), myToolbarComponent, false,
0, false);
popupFactory.createListPopup(popupStep).showUnderneathOf(myToolbarComponent);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:GroupToolbarAction.java
示例4: actionPerformed
import com.intellij.openapi.ui.popup.ListPopupStep; //导入依赖的package包/类
public void actionPerformed(AnActionEvent e) {
final JBPopupFactory popupFactory = JBPopupFactory.getInstance();
final ListPopupStep step = popupFactory.createActionsStep(myActionGroup, e.getDataContext(), false, false,
myActionGroup.getTemplatePresentation().getText(), myTree, true,
myPreselection != null ? myPreselection.getDefaultIndex() : 0, true);
final ListPopup listPopup = popupFactory.createListPopup(step);
listPopup.setHandleAutoSelectionBeforeShow(true);
if (e instanceof AnActionButton.AnActionEventWrapper) {
((AnActionButton.AnActionEventWrapper)e).showPopup(listPopup);
} else {
listPopup.showUnderneathOf(myNorthPanel);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:MasterDetailsComponent.java
示例5: ListPopupModel
import com.intellij.openapi.ui.popup.ListPopupStep; //导入依赖的package包/类
public ListPopupModel(ElementFilter filter, SpeedSearch speedSearch, ListPopupStep step) {
myFilter = filter;
myStep = step;
mySpeedSearch = speedSearch;
myOriginalList = new ArrayList<Object>(step.getValues());
rebuildLists();
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:ListPopupModel.java
示例6: customizeComponent
import com.intellij.openapi.ui.popup.ListPopupStep; //导入依赖的package包/类
@Override
protected void customizeComponent(JList list, Object value, boolean isSelected) {
super.customizeComponent(list, value, isSelected);
myLabel.setVisible(myHasSideBar);
ListPopupStep<Object> step = myPopup1.getListStep();
boolean isSelectable = step.isSelectable(value);
myLabel.setEnabled(isSelectable);
myLabel.setIcon(null);
if (isSelected) {
setSelected(myLabel);
}
else {
setDeselected(myLabel);
}
if (value instanceof Wrapper) {
Wrapper wrapper = (Wrapper)value;
final int mnemonic = wrapper.getMnemonic();
if (mnemonic != -1 && !myPopup1.getSpeedSearch().isHoldingFilter()) {
myLabel.setText(mnemonic + ".");
myLabel.setDisplayedMnemonicIndex(0);
}
else {
if (wrapper.isChecked()) {
myTextLabel.setIcon(isSelected ? RunConfigurationsComboBoxAction.CHECKED_SELECTED_ICON
: RunConfigurationsComboBoxAction.CHECKED_ICON);
}
else {
if (myTextLabel.getIcon() == null) {
myTextLabel.setIcon(RunConfigurationsComboBoxAction.EMPTY_ICON);
}
}
myLabel.setText("");
}
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:40,代码来源:ChooseRunConfigurationPopup.java
示例7: ResourceQualifierSwitcherPanel
import com.intellij.openapi.ui.popup.ListPopupStep; //导入依赖的package包/类
public ResourceQualifierSwitcherPanel(final Project project, @NotNull final VirtualFile file, BidirectionalMap<String, VirtualFile> qualifiers) {
super(new BorderLayout());
myProject = project;
myFile = file;
myQualifiers = qualifiers;
final String currentFileQualifier = qualifiers.getKeysByValue(file).get(0);
final JLabel label = new JLabel(currentFileQualifier);
label.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent event) {
if (event.getButton() != MouseEvent.BUTTON1 || event.getClickCount() != 1) {
return;
}
BidirectionalMap<String, VirtualFile> map = collectQualifiers(file.getParent().getParent(), file);
ListPopupStep popupStep = new BaseListPopupStep<String>("Choose Qualifier", new ArrayList<String>(map.keySet())) {
@Override
public PopupStep onChosen(String selectedValue, boolean finalChoice) {
switchToFile(selectedValue);
return FINAL_CHOICE;
}
};
ListPopup popup = JBPopupFactory.getInstance().createListPopup(popupStep);
popup.showUnderneathOf(label);
}
});
add(label, BorderLayout.WEST);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:29,代码来源:ResourceQualifierSwitcher.java
示例8: actionPerformed
import com.intellij.openapi.ui.popup.ListPopupStep; //导入依赖的package包/类
public void actionPerformed(AnActionEvent e) {
final JBPopupFactory popupFactory = JBPopupFactory.getInstance();
final ListPopupStep step = popupFactory.createActionsStep(myActionGroup, e.getDataContext(), false, false,
myActionGroup.getTemplatePresentation().getText(), myTree, true,
myPreselection != null ? myPreselection.getDefaultIndex() : 0, true);
final ListPopup listPopup = popupFactory.createListPopup(step);
listPopup.setHandleAutoSelectionBeforeShow(true);
listPopup.showUnderneathOf(myNorthPanel);
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:10,代码来源:MasterDetailsComponent.java
示例9: customizeComponent
import com.intellij.openapi.ui.popup.ListPopupStep; //导入依赖的package包/类
@Override
protected void customizeComponent(JList list, Object value, boolean isSelected) {
ListPopupStep<Object> step = myPopup.getListStep();
boolean isSelectable = step.isSelectable(value);
myTextLabel.setEnabled(isSelectable);
if (step.isMnemonicsNavigationEnabled()) {
final int pos = step.getMnemonicNavigationFilter().getMnemonicPos(value);
if (pos != -1) {
String text = myTextLabel.getText();
text = text.substring(0, pos) + text.substring(pos + 1);
myTextLabel.setText(text);
myTextLabel.setDisplayedMnemonicIndex(pos);
}
}
else {
myTextLabel.setDisplayedMnemonicIndex(-1);
}
if (step.hasSubstep(value) && isSelectable) {
myNextStepLabel.setVisible(true);
final boolean isDark = ColorUtil.isDark(UIUtil.getListSelectionBackground());
myNextStepLabel.setIcon(isSelected ? isDark ? AllIcons.Icons.Ide.NextStepInverted
: AllIcons.Icons.Ide.NextStep
: AllIcons.Icons.Ide.NextStepGrayed);
}
else {
myNextStepLabel.setVisible(false);
//myNextStepLabel.setIcon(PopupIcons.EMPTY_ICON);
}
if (isSelected) {
setSelected(myNextStepLabel);
}
else {
setDeselected(myNextStepLabel);
}
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:39,代码来源:PopupListElementRenderer.java
示例10: actionPerformed
import com.intellij.openapi.ui.popup.ListPopupStep; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
final JBPopupFactory popupFactory = JBPopupFactory.getInstance();
final ListPopupStep step = popupFactory.createActionsStep(myActionGroup, e.getDataContext(), false, false,
myActionGroup.getTemplatePresentation().getText(), myTree, true,
myPreselection != null ? myPreselection.getDefaultIndex() : 0, true);
final ListPopup listPopup = popupFactory.createListPopup(step);
listPopup.setHandleAutoSelectionBeforeShow(true);
listPopup.showUnderneathOf(myNorthPanel);
}
开发者ID:consulo,项目名称:consulo,代码行数:11,代码来源:MasterDetailsComponent.java
示例11: ListPopupModel
import com.intellij.openapi.ui.popup.ListPopupStep; //导入依赖的package包/类
public ListPopupModel(ElementFilter filter, SpeedSearch speedSearch, ListPopupStep step) {
myFilter = filter;
myStep = step;
mySpeedSearch = speedSearch;
myOriginalList = new ArrayList<>(step.getValues());
rebuildLists();
}
开发者ID:consulo,项目名称:consulo,代码行数:8,代码来源:ListPopupModel.java
示例12: FlatSpeedSearchPopup
import com.intellij.openapi.ui.popup.ListPopupStep; //导入依赖的package包/类
protected FlatSpeedSearchPopup(@Nullable WizardPopup parent,
@Nonnull ListPopupStep step,
@Nonnull DataContext dataContext,
@Nullable Object value) {
super(parent, step, null, dataContext, null, -1);
setParentValue(value);
}
开发者ID:consulo,项目名称:consulo,代码行数:8,代码来源:FlatSpeedSearchPopup.java
示例13: customizeComponent
import com.intellij.openapi.ui.popup.ListPopupStep; //导入依赖的package包/类
@Override
protected void customizeComponent(JList list, Object value, boolean isSelected) {
super.customizeComponent(list, value, isSelected);
myLabel.setVisible(myHasSideBar);
ListPopupStep<Object> step = myPopup1.getListStep();
boolean isSelectable = step.isSelectable(value);
myLabel.setEnabled(isSelectable);
myLabel.setIcon(null);
if (isSelected) {
setSelected(myLabel);
}
else {
setDeselected(myLabel);
}
if (value instanceof Wrapper) {
Wrapper wrapper = (Wrapper)value;
final int mnemonic = wrapper.getMnemonic();
if (mnemonic != -1 && !myPopup1.getSpeedSearch().isHoldingFilter()) {
myLabel.setText(mnemonic + ".");
myLabel.setDisplayedMnemonicIndex(0);
}
else {
if (wrapper.isChecked()) {
myTextLabel.setIcon(isSelected ? RunConfigurationsComboBoxAction.CHECKED_SELECTED_ICON : RunConfigurationsComboBoxAction.CHECKED_ICON);
}
else {
if (myTextLabel.getIcon() == null) {
myTextLabel.setIcon(RunConfigurationsComboBoxAction.EMPTY_ICON);
}
}
myLabel.setText("");
}
}
}
开发者ID:consulo,项目名称:consulo,代码行数:39,代码来源:ChooseRunConfigurationPopup.java
示例14: MockConfirmation
import com.intellij.openapi.ui.popup.ListPopupStep; //导入依赖的package包/类
public MockConfirmation(ListPopupStep aStep, String onYesText) {
super(aStep);
myOnYesText = onYesText;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:MockConfirmation.java
示例15: customizeComponent
import com.intellij.openapi.ui.popup.ListPopupStep; //导入依赖的package包/类
@Override
protected void customizeComponent(JList list, Object value, boolean isSelected) {
ListPopupStep<Object> step = myPopup.getListStep();
boolean isSelectable = step.isSelectable(value);
myTextLabel.setEnabled(isSelectable);
if (!isSelected && step instanceof BaseListPopupStep) {
Color bg = ((BaseListPopupStep)step).getBackgroundFor(value);
Color fg = ((BaseListPopupStep)step).getForegroundFor(value);
if (fg != null) myTextLabel.setForeground(fg);
if (bg != null) UIUtil.setBackgroundRecursively(myComponent, bg);
}
if (step.isMnemonicsNavigationEnabled()) {
final int pos = step.getMnemonicNavigationFilter().getMnemonicPos(value);
if (pos != -1) {
String text = myTextLabel.getText();
text = text.substring(0, pos) + text.substring(pos + 1);
myTextLabel.setText(text);
myTextLabel.setDisplayedMnemonicIndex(pos);
}
}
else {
myTextLabel.setDisplayedMnemonicIndex(-1);
}
if (step.hasSubstep(value) && isSelectable) {
myNextStepLabel.setVisible(true);
final boolean isDark = ColorUtil.isDark(UIUtil.getListSelectionBackground());
myNextStepLabel.setIcon(isSelected ? isDark ? AllIcons.Icons.Ide.NextStepInverted
: AllIcons.Icons.Ide.NextStep
: AllIcons.Icons.Ide.NextStepGrayed);
}
else {
myNextStepLabel.setVisible(false);
//myNextStepLabel.setIcon(PopupIcons.EMPTY_ICON);
}
setSelected(myNextStepLabel, isSelected);
if (myShortcutLabel != null) {
myShortcutLabel.setText("");
if (value instanceof ShortcutProvider) {
ShortcutSet set = ((ShortcutProvider)value).getShortcut();
if (set != null) {
Shortcut shortcut = ArrayUtil.getFirstElement(set.getShortcuts());
if (shortcut != null) {
myShortcutLabel.setText(" " + KeymapUtil.getShortcutText(shortcut));
}
}
}
setSelected(myShortcutLabel, isSelected);
myShortcutLabel.setForeground(isSelected ? UIManager.getColor("MenuItem.acceleratorSelectionForeground") : UIManager.getColor("MenuItem.acceleratorForeground"));
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:56,代码来源:PopupListElementRenderer.java
示例16: RunListPopup
import com.intellij.openapi.ui.popup.ListPopupStep; //导入依赖的package包/类
public RunListPopup(ListPopupStep step) {
super(step);
registerActions(this);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:ChooseRunConfigurationPopup.java
示例17: createPopup
import com.intellij.openapi.ui.popup.ListPopupStep; //导入依赖的package包/类
@Override
protected WizardPopup createPopup(WizardPopup parent, PopupStep step, Object parentValue) {
return new RunListPopup(parent, (ListPopupStep)step, parentValue);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:ChooseRunConfigurationPopup.java
示例18: createPopup
import com.intellij.openapi.ui.popup.ListPopupStep; //导入依赖的package包/类
@Override
protected WizardPopup createPopup(WizardPopup parent, PopupStep step, Object parentValue) {
ChildPopup popup = new ChildPopup(parent, (ListPopupStep)step, parentValue);
initPopup(popup);
return popup;
}
开发者ID:Abnaxos,项目名称:guards,代码行数:7,代码来源:GuardPopupController.java
示例19: ChildPopup
import com.intellij.openapi.ui.popup.ListPopupStep; //导入依赖的package包/类
ChildPopup(WizardPopup aParent, ListPopupStep aStep, Object parentValue) {
super(aParent, aStep, parentValue);
}
开发者ID:Abnaxos,项目名称:guards,代码行数:4,代码来源:GuardPopupController.java
示例20: customizeComponent
import com.intellij.openapi.ui.popup.ListPopupStep; //导入依赖的package包/类
@Override
protected void customizeComponent(JList<? extends E> list, E value, boolean isSelected) {
ListPopupStep<Object> step = myPopup.getListStep();
boolean isSelectable = step.isSelectable(value);
myTextLabel.setEnabled(isSelectable);
if (!isSelected && step instanceof BaseListPopupStep) {
Color bg = ((BaseListPopupStep)step).getBackgroundFor(value);
Color fg = ((BaseListPopupStep)step).getForegroundFor(value);
if (fg != null) myTextLabel.setForeground(fg);
if (bg != null) UIUtil.setBackgroundRecursively(myComponent, bg);
}
if (step.isMnemonicsNavigationEnabled()) {
final int pos = step.getMnemonicNavigationFilter().getMnemonicPos(value);
if (pos != -1) {
String text = myTextLabel.getText();
text = text.substring(0, pos) + text.substring(pos + 1);
myTextLabel.setText(text);
myTextLabel.setDisplayedMnemonicIndex(pos);
}
}
else {
myTextLabel.setDisplayedMnemonicIndex(-1);
}
if (step.hasSubstep(value) && isSelectable) {
myNextStepLabel.setVisible(true);
final boolean isDark = ColorUtil.isDark(UIUtil.getListSelectionBackground());
myNextStepLabel.setIcon(isSelected ? isDark ? AllIcons.Icons.Ide.NextStepInverted
: AllIcons.Icons.Ide.NextStep
: AllIcons.Icons.Ide.NextStepGrayed);
}
else {
myNextStepLabel.setVisible(false);
//myNextStepLabel.setIcon(PopupIcons.EMPTY_ICON);
}
setSelected(myNextStepLabel, isSelected);
if (myShortcutLabel != null) {
myShortcutLabel.setEnabled(isSelectable);
myShortcutLabel.setText("");
if (value instanceof ShortcutProvider) {
ShortcutSet set = ((ShortcutProvider)value).getShortcut();
if (set != null) {
Shortcut shortcut = ArrayUtil.getFirstElement(set.getShortcuts());
if (shortcut != null) {
myShortcutLabel.setText(" " + KeymapUtil.getShortcutText(shortcut));
}
}
}
setSelected(myShortcutLabel, isSelected);
myShortcutLabel.setForeground(isSelected ? UIManager.getColor("MenuItem.acceleratorSelectionForeground") : UIManager.getColor("MenuItem.acceleratorForeground"));
}
}
开发者ID:consulo,项目名称:consulo,代码行数:57,代码来源:PopupListElementRenderer.java
注:本文中的com.intellij.openapi.ui.popup.ListPopupStep类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论