use of com.intellij.openapi.ui.popup.ListPopup in project intellij-community by JetBrains.
the class PlaySavedMacros method actionPerformed.
@Override
public void actionPerformed(final AnActionEvent e) {
final ListPopup popup = JBPopupFactory.getInstance().createActionGroupPopup("Play Saved Macros", new MacrosGroup(), e.getDataContext(), JBPopupFactory.ActionSelectionAid.SPEEDSEARCH, false);
final Project project = e.getProject();
if (project != null) {
popup.showCenteredInCurrentWindow(project);
} else {
popup.showInFocusCenter();
}
}
use of com.intellij.openapi.ui.popup.ListPopup in project intellij-community by JetBrains.
the class EncodingPanel method showPopup.
private void showPopup(@NotNull MouseEvent e) {
if (!actionEnabled) {
return;
}
DataContext dataContext = getContext();
ListPopup popup = new ChangeFileEncodingAction().createPopup(dataContext);
if (popup != null) {
Dimension dimension = popup.getContent().getPreferredSize();
Point at = new Point(0, -dimension.height);
popup.show(new RelativePoint(e.getComponent(), at));
// destroy popup on unexpected project close
Disposer.register(this, popup);
}
}
use of com.intellij.openapi.ui.popup.ListPopup in project intellij-community by JetBrains.
the class ChangeFileEncodingAction method actionPerformed.
@Override
public final void actionPerformed(final AnActionEvent e) {
DataContext dataContext = e.getDataContext();
ListPopup popup = createPopup(dataContext);
if (popup != null) {
popup.showInBestPositionFor(dataContext);
}
}
use of com.intellij.openapi.ui.popup.ListPopup in project intellij-community by JetBrains.
the class BeforeRunStepsPanel method doAddAction.
void doAddAction(AnActionButton button) {
if (isUnknown()) {
return;
}
final JBPopupFactory popupFactory = JBPopupFactory.getInstance();
final BeforeRunTaskProvider<BeforeRunTask>[] providers = Extensions.getExtensions(BeforeRunTaskProvider.EXTENSION_POINT_NAME, myRunConfiguration.getProject());
Set<Key> activeProviderKeys = getActiveProviderKeys();
DefaultActionGroup actionGroup = new DefaultActionGroup(null, false);
for (final BeforeRunTaskProvider<BeforeRunTask> provider : providers) {
if (provider.createTask(myRunConfiguration) == null)
continue;
if (activeProviderKeys.contains(provider.getId()) && provider.isSingleton())
continue;
AnAction providerAction = new AnAction(provider.getName(), null, provider.getIcon()) {
@Override
public void actionPerformed(AnActionEvent e) {
BeforeRunTask task = provider.createTask(myRunConfiguration);
if (task != null) {
provider.configureTask(myRunConfiguration, task);
if (!provider.canExecuteTask(myRunConfiguration, task))
return;
} else {
return;
}
task.setEnabled(true);
Set<RunConfiguration> configurationSet = new HashSet<>();
getAllRunBeforeRuns(task, configurationSet);
if (configurationSet.contains(myRunConfiguration)) {
JOptionPane.showMessageDialog(BeforeRunStepsPanel.this, ExecutionBundle.message("before.launch.panel.cyclic_dependency_warning", myRunConfiguration.getName(), provider.getDescription(task)), ExecutionBundle.message("warning.common.title"), JOptionPane.WARNING_MESSAGE);
return;
}
addTask(task);
myListener.fireStepsBeforeRunChanged();
}
};
actionGroup.add(providerAction);
}
final ListPopup popup = popupFactory.createActionGroupPopup(ExecutionBundle.message("add.new.run.configuration.acrtion.name"), actionGroup, SimpleDataContext.getProjectContext(myRunConfiguration.getProject()), false, false, false, null, -1, Conditions.<AnAction>alwaysTrue());
popup.show(button.getPreferredPopupPoint());
}
use of com.intellij.openapi.ui.popup.ListPopup in project intellij-community by JetBrains.
the class ExportHTMLAction method actionPerformed.
@Override
public void actionPerformed(AnActionEvent e) {
final ListPopup popup = JBPopupFactory.getInstance().createListPopup(new BaseListPopupStep<String>(InspectionsBundle.message("inspection.action.export.popup.title"), HTML, XML) {
@Override
public PopupStep onChosen(final String selectedValue, final boolean finalChoice) {
return doFinalStep(() -> exportHTML(Comparing.strEqual(selectedValue, HTML)));
}
});
InspectionResultsView.showPopup(e, popup);
}
Aggregations