use of com.intellij.openapi.ui.popup.ListPopup in project intellij-community by JetBrains.
the class InvokeQuickFixAction method actionPerformed.
@Override
public void actionPerformed(AnActionEvent e) {
final ActionGroup fixes = (ActionGroup) ActionManager.getInstance().getAction("QuickFixes");
if (fixes.getChildren(e).length == 0) {
Messages.showInfoMessage(myView, "There are no applicable quick fixes", "Nothing Found to Fix");
return;
}
DataContext dataContext = e.getDataContext();
final ListPopup popup = JBPopupFactory.getInstance().createActionGroupPopup(InspectionsBundle.message("inspection.tree.popup.title"), fixes, dataContext, JBPopupFactory.ActionSelectionAid.SPEEDSEARCH, false);
InspectionResultsView.showPopup(e, popup);
}
use of com.intellij.openapi.ui.popup.ListPopup in project intellij-community by JetBrains.
the class ListenerNavigateButton method showNavigatePopup.
public static void showNavigatePopup(final RadComponent component, final boolean showIfEmpty) {
final DefaultActionGroup actionGroup = prepareActionGroup(component);
if (actionGroup != null && actionGroup.getChildrenCount() == 0 && showIfEmpty) {
actionGroup.add(new MyNavigateAction(UIDesignerBundle.message("navigate.to.listener.empty"), null));
}
if (actionGroup != null && actionGroup.getChildrenCount() > 0) {
final DataContext context = DataManager.getInstance().getDataContext(component.getDelegee());
final JBPopupFactory factory = JBPopupFactory.getInstance();
final ListPopup popup = factory.createActionGroupPopup(UIDesignerBundle.message("navigate.to.listener.title"), actionGroup, context, JBPopupFactory.ActionSelectionAid.NUMBERING, true);
FormEditingUtil.showPopupUnderComponent(popup, component);
}
}
use of com.intellij.openapi.ui.popup.ListPopup in project intellij-community by JetBrains.
the class CreateComponentAction method actionPerformed.
protected void actionPerformed(final GuiEditor editor, final List<RadComponent> selection, final AnActionEvent e) {
Processor<ComponentItem> processor = 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());
}
}
use of com.intellij.openapi.ui.popup.ListPopup in project intellij-community by JetBrains.
the class DeepCompareAction method selectBranchAndPerformAction.
private static void selectBranchAndPerformAction(@NotNull VcsLogDataPack dataPack, @NotNull AnActionEvent event, @NotNull final Consumer<String> consumer, @NotNull Collection<VirtualFile> visibleRoots) {
ActionGroup actionGroup = new BranchPopupBuilder(dataPack, visibleRoots, null) {
@NotNull
@Override
protected AnAction createAction(@NotNull final String name) {
return new DumbAwareAction(name) {
@Override
public void actionPerformed(AnActionEvent e) {
consumer.consume(name);
}
};
}
}.build();
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());
}
}
use of com.intellij.openapi.ui.popup.ListPopup in project intellij-community by JetBrains.
the class AbstractQuickFixManager method showPopup.
private void showPopup() {
if (myHint == null || !myHint.isVisible()) {
return;
}
List<ErrorInfo> errorInfos = getErrorInfos();
if (!ErrorInfo.haveFixes(errorInfos)) {
return;
}
ListPopup popup = JBPopupFactory.getInstance().createListPopup(new FirstStep(errorInfos));
popup.showUnderneathOf(myHint.getComponent());
}
Aggregations