Unnamed: 0
int64 0
305k
| body
stringlengths 7
52.9k
| name
stringlengths 1
185
|
|---|---|---|
290,100
|
void (RunnerAndConfigurationSettings configuration, ConfigurationContext context) { if (!ApplicationManager.getApplication().isUnitTestMode()) { RunDialog.editConfiguration(context.getProject(), configuration, ExecutionBundle.message("edit.run.configuration.for.item.dialog.title", configuration.getName())); } }
|
perform
|
290,101
|
void (Presentation presentation, ConfigurationContext context, @NotNull String actionText) { presentation.setEnabledAndVisible(false); }
|
update
|
290,102
|
void (Presentation presentation, String actionText) { }
|
updateText
|
290,103
|
void (RunnerAndConfigurationSettings configurationSettings, ConfigurationContext context) { }
|
perform
|
290,104
|
boolean (@NotNull AnActionEvent e) { return ActionPlaces.isMainMenuOrActionSearch(e.getPlace()) || ActionPlaces.NEW_UI_RUN_TOOLBAR.equals(e.getPlace()) || ActionPlaces.MAIN_TOOLBAR.equals(e.getPlace()) || ActionPlaces.NAVIGATION_BAR_TOOLBAR.equals(e.getPlace()) || ActionPlaces.TOUCHBAR_GENERAL.equals(e.getPlace()); }
|
isPlaceGlobal
|
290,105
|
ActionUpdateThread () { return ActionUpdateThread.BGT; }
|
getActionUpdateThread
|
290,106
|
void (final @NotNull AnActionEvent e) { boolean enable = false; Icon icon = getActionIcon(e); String description = getTemplatePresentation().getDescription(); Presentation presentation = e.getPresentation(); if (isPlaceGlobal(e)) { List<RunContentDescriptor> stoppableDescriptors = getActiveStoppableDescriptors(e.getProject()); int stopCount = stoppableDescriptors.size(); enable = stopCount >= 1; if (!enable && e.getPlace().equals(ActionPlaces.NEW_UI_RUN_TOOLBAR)) { presentation.setEnabledAndVisible(false); return; } if (stopCount > 1) { presentation.setText(getTemplatePresentation().getText() + "..."); String text = RunToolbarPopupKt.runCounterToString(e, stopCount); icon = IconUtil.addText(icon, text); } else if (stopCount == 1) { presentation.setText(ExecutionBundle.messagePointer("stop.configuration.action.name", StringUtil.escapeMnemonics( StringUtil.notNullize(stoppableDescriptors.get(0).getDisplayName())))); } } else { RunContentDescriptor contentDescriptor = e.getData(LangDataKeys.RUN_CONTENT_DESCRIPTOR); ProcessHandler processHandler = contentDescriptor == null ? null : contentDescriptor.getProcessHandler(); if (processHandler != null && !processHandler.isProcessTerminated()) { if (!processHandler.isProcessTerminating()) { enable = true; } else if (processHandler instanceof KillableProcess && ((KillableProcess)processHandler).canKillProcess()) { enable = true; icon = AllIcons.Debugger.KillProcess; description = ExecutionBundle.message("action.terminating.process.progress.kill.description"); } } RunProfile runProfile = e.getData(LangDataKeys.RUN_PROFILE); if (runProfile == null && contentDescriptor == null) { presentation.setText(getTemplatePresentation().getText()); } else { presentation.setText(ExecutionBundle.messagePointer("stop.configuration.action.name", StringUtil.escapeMnemonics(runProfile == null ? StringUtil.notNullize(contentDescriptor.getDisplayName()) : runProfile.getName()))); } } presentation.setEnabled(enable); presentation.setIcon(icon); presentation.setDescription(description); }
|
update
|
290,107
|
Icon (final @NotNull AnActionEvent e) { return getTemplatePresentation().getIcon(); }
|
getActionIcon
|
290,108
|
void (final @NotNull AnActionEvent e) { final DataContext dataContext = e.getDataContext(); Project project = e.getProject(); List<RunContentDescriptor> stoppableDescriptors = getActiveStoppableDescriptors(project); int stopCount = stoppableDescriptors.size(); if (isPlaceGlobal(e)) { if (stopCount == 1) { ExecutionManagerImpl.stopProcess(stoppableDescriptors.get(0)); return; } if (ActionPlaces.NEW_UI_RUN_TOOLBAR.equals(e.getPlace()) && project != null) { JBPopup popup = RunToolbarPopupKt.createStopPopup(dataContext, project); showStopPopup(e, dataContext, project, popup); return; } Pair<List<HandlerItem>, HandlerItem> handlerItems = getItemsList(project, stoppableDescriptors, getRecentlyStartedContentDescriptor(dataContext)); if (handlerItems == null || handlerItems.first.isEmpty()) { return; } HandlerItem stopAllItem = new HandlerItem(ExecutionBundle.message("stop.all", KeymapUtil.getFirstKeyboardShortcutText("Stop")), getActionIcon(e), true) { @Override void stop() { for (HandlerItem item : handlerItems.first) { if(item == this) continue; item.stop(); } } }; JBPopup activePopup = SoftReference.dereference(myActivePopupRef); if (activePopup != null) { stopAllItem.stop(); activePopup.cancel(); return; } List<HandlerItem> items = handlerItems.first; if (stopCount > 1) { items.add(stopAllItem); } IPopupChooserBuilder<HandlerItem> builder = JBPopupFactory.getInstance().createPopupChooserBuilder(items) .setRenderer(new GroupedItemsListRenderer<>(new ListItemDescriptorAdapter<>() { @Override public @Nullable String getTextFor(HandlerItem item) { return item.displayName; } @Override public @Nullable Icon getIconFor(HandlerItem item) { return item.icon; } @Override public boolean hasSeparatorAboveOf(HandlerItem item) { return item.hasSeparator; } })) .setMovable(true) .setTitle(items.size() == 1 ? ExecutionBundle.message("confirm.process.stop") : ExecutionBundle.message("stop.process")) .setNamerForFiltering(o -> o.displayName) .setItemsChosenCallback((valuesList) -> { for (HandlerItem item : valuesList) { item.stop(); } }) .addListener(new JBPopupListener() { @Override public void onClosed(@NotNull LightweightWindowEvent event) { myActivePopupRef = null; } }) .setRequestFocus(true); if (handlerItems.second != null) { builder.setSelectedValue(handlerItems.second, true); } JBPopup popup = builder .createPopup(); myActivePopupRef = new WeakReference<>(popup); showStopPopup(e, dataContext, project, popup); } else { ExecutionManagerImpl.stopProcess(getRecentlyStartedContentDescriptor(dataContext)); } }
|
actionPerformed
|
290,109
|
boolean (HandlerItem item) { return item.hasSeparator; }
|
hasSeparatorAboveOf
|
290,110
|
void (@NotNull LightweightWindowEvent event) { myActivePopupRef = null; }
|
onClosed
|
290,111
|
void (@NotNull AnActionEvent e, DataContext dataContext, Project project, JBPopup popup) { InputEvent inputEvent = e.getInputEvent(); Component component = inputEvent != null ? inputEvent.getComponent() : null; if (component != null && (ActionPlaces.MAIN_TOOLBAR.equals(e.getPlace()) || ActionPlaces.NAVIGATION_BAR_TOOLBAR.equals(e.getPlace())) || ActionPlaces.NEW_UI_RUN_TOOLBAR.equals(e.getPlace())) { popup.showUnderneathOf(component); } else if (project == null) { popup.showInBestPositionFor(dataContext); } else { popup.showCenteredInCurrentWindow(project); } }
|
showStopPopup
|
290,112
|
List<RunContentDescriptor> (@Nullable Project project) { List<RunContentDescriptor> runningProcesses = project != null ? ContainerUtil.map(getStoppableDescriptors(project), kotlin.Pair::getFirst) : Collections.emptyList(); if (runningProcesses.isEmpty()) { return Collections.emptyList(); } List<RunContentDescriptor> activeDescriptors = new SmartList<>(); for (RunContentDescriptor descriptor : runningProcesses) { if (canBeStopped(descriptor)) { activeDescriptors.add(descriptor); } } return activeDescriptors; }
|
getActiveStoppableDescriptors
|
290,113
|
boolean (@Nullable RunContentDescriptor descriptor) { @Nullable ProcessHandler processHandler = descriptor != null ? descriptor.getProcessHandler() : null; return processHandler != null && !processHandler.isProcessTerminated() && (!processHandler.isProcessTerminating() || processHandler instanceof KillableProcess && ((KillableProcess)processHandler).canKillProcess()); }
|
canBeStopped
|
290,114
|
String () { return displayName; }
|
toString
|
290,115
|
boolean (@NotNull Project project) { if (RunToolbarSlotManager.Companion.getInstance(project).getActive$intellij_platform_execution_impl()) { // Run Widget shows up only in Rider. In other IDEs it's a secret feature backed by the "ide.run.widget" Registry key. // The 'Run Current File' feature doesn't look great together with the Run Widget. return false; } if (PlatformUtils.isIntelliJ()) return true; if (PlatformUtils.isPhpStorm()) return true; if (PlatformUtils.isWebStorm()) return true; if (PlatformUtils.isRubyMine()) return true; if (PlatformUtils.isPyCharmPro()) return true; if (PlatformUtils.isPyCharmCommunity()) return true; if (PlatformUtils.isDataGrip()) return true; return Registry.is("run.current.file.item.in.run.configurations.combobox"); }
|
hasRunCurrentFileItem
|
290,116
|
boolean (@NotNull Project project) { return hasRunCurrentFileItem(project) || ExperimentalUI.isNewUI() || PlatformUtils.isCLion(); }
|
hasRunSubActions
|
290,117
|
ActionUpdateThread () { return ActionUpdateThread.BGT; }
|
getActionUpdateThread
|
290,118
|
void (@NotNull AnActionEvent e) { Presentation presentation = e.getPresentation(); Project project = e.getData(CommonDataKeys.PROJECT); if (ActionPlaces.isMainMenuOrActionSearch(e.getPlace())) { presentation.setDescription(ExecutionBundle.messagePointer("choose.run.configuration.action.description")); } try { if (project == null || project.isDisposed() || !project.isOpen() || RunManager.IS_RUN_MANAGER_INITIALIZED.get(project) != Boolean.TRUE) { updatePresentation(null, null, null, presentation, e.getPlace()); presentation.setEnabled(false); } else { updatePresentation(getSelectedExecutionTarget(e), getSelectedConfiguration(e), project, presentation, e.getPlace()); presentation.setEnabled(true); } } catch (IndexNotReadyException e1) { presentation.setEnabled(false); } }
|
update
|
290,119
|
void (@Nullable ExecutionTarget target, @Nullable RunnerAndConfigurationSettings settings, @Nullable Project project, @NotNull Presentation presentation, String actionPlace) { presentation.putClientProperty(BUTTON_MODE, null); if (project != null && target != null && settings != null) { String name; if (!ExperimentalUI.isNewUI()) { // there's a separate combo-box for execution targets in new UI name = Executor.shortenNameIfNeeded(settings.getName()); if (target != DefaultExecutionTarget.INSTANCE && !target.isExternallyManaged()) { name += " | " + target.getDisplayName(); } else { if (!ExecutionTargetManager.canRun(settings.getConfiguration(), target)) { name += " | " + ExecutionBundle.message("run.configurations.combo.action.nothing.to.run.on"); } } } else { name = StringUtil.shortenTextWithEllipsis( settings.getName(), RedesignedRunWidgetKt.CONFIGURATION_NAME_NON_TRIM_MAX_LENGTH, RedesignedRunWidgetKt.CONFIGURATION_NAME_TRIM_SUFFIX_LENGTH, true); } presentation.setText(name, false); if (!ApplicationManager.getApplication().isUnitTestMode()) { setConfigurationIcon(presentation, settings, project, true); } } else { if (project != null && hasRunCurrentFileItem(project)) { presentation.setText(ExecutionBundle.messagePointer("run.configurations.combo.run.current.file.selected")); presentation.setIcon(null); return; } presentation.putClientProperty(BUTTON_MODE, Boolean.TRUE); presentation.setText(ExecutionBundle.messagePointer("action.presentation.RunConfigurationsComboBoxAction.text")); presentation.setDescription(ActionsBundle.actionDescription(IdeActions.ACTION_EDIT_RUN_CONFIGURATIONS)); if (ActionPlaces.TOUCHBAR_GENERAL.equals(actionPlace)) presentation.setIcon(AllIcons.General.Add); else presentation.setIcon(null); } }
|
updatePresentation
|
290,120
|
void (final Presentation presentation, final RunnerAndConfigurationSettings settings, final Project project) { setConfigurationIcon(presentation, settings, project, true); }
|
setConfigurationIcon
|
290,121
|
void (final Presentation presentation, final RunnerAndConfigurationSettings settings, final Project project, final boolean withLiveIndicator) { try { presentation.setIcon(RunManagerEx.getInstanceEx(project).getConfigurationIcon(settings, withLiveIndicator)); } catch (IndexNotReadyException ignored) { } }
|
setConfigurationIcon
|
290,122
|
void (@NotNull AnActionEvent e) { if (ActionPlaces.TOUCHBAR_GENERAL.equals(e.getPlace())) { final Presentation presentation = e.getPresentation(); if (Boolean.TRUE.equals(presentation.getClientProperty(BUTTON_MODE))) { InputEvent inputEvent = e.getInputEvent(); Component component = inputEvent != null ? inputEvent.getComponent() : null; if (component != null) { performWhenButton(component, ActionPlaces.TOUCHBAR_GENERAL); } return; } } super.actionPerformed(e); }
|
actionPerformed
|
290,123
|
boolean () { return true; }
|
shouldShowDisabledActions
|
290,124
|
JComponent (@NotNull Presentation presentation, @NotNull String place) { ComboBoxButton button = new RunConfigurationsComboBoxButton(presentation); if (isNoWrapping(place)) return button; NonOpaquePanel panel = new NonOpaquePanel(new BorderLayout()); Border border = UIUtil.isUnderDefaultMacTheme() ? JBUI.Borders.empty(0, 2) : JBUI.Borders.empty(0, 5, 0, 4); panel.setBorder(border); panel.add(button); return panel; }
|
createCustomComponent
|
290,125
|
void (@NotNull Component src, String place) { ActionManager manager = ActionManager.getInstance(); manager.tryToExecute(manager.getAction(IdeActions.ACTION_EDIT_RUN_CONFIGURATIONS), new MouseEvent(src, MouseEvent.MOUSE_PRESSED, System.currentTimeMillis(), 0, 0, 0, 0,false, 0), src, place, true ); }
|
performWhenButton
|
290,126
|
DefaultActionGroup (@NotNull JComponent button, @NotNull DataContext context) { final DefaultActionGroup allActionsGroup = new DefaultActionGroup(); final Project project = CommonDataKeys.PROJECT.getData(DataManager.getInstance().getDataContext(button)); if (project == null) { return allActionsGroup; } AnAction editRunConfigurationAction = getEditRunConfigurationAction(); if(editRunConfigurationAction != null) { allActionsGroup.add(editRunConfigurationAction); } allActionsGroup.add(new SaveTemporaryAction()); allActionsGroup.addSeparator(); if (!ExperimentalUI.isNewUI()) { // no need for targets list in `All configurations` in new UI, since there is a separate combobox for them addTargetGroup(project, allActionsGroup); } allActionsGroup.add(new RunCurrentFileAction(executor -> true)); allActionsGroup.addSeparator(ExecutionBundle.message("run.configurations.popup.existing.configurations.separator.text")); addRunConfigurations(allActionsGroup, project, settings -> createFinalAction(settings, project), folderName -> DefaultActionGroup.createPopupGroup(() -> folderName), null); return allActionsGroup; }
|
createPopupActionGroup
|
290,127
|
int (@NotNull DefaultActionGroup allActionsGroup, @NotNull Project project, @NotNull Function<? super RunnerAndConfigurationSettings, ? extends AnAction> createAction, @NotNull Function<? super @NlsSafe String, ? extends DefaultActionGroup> createFolder, @Nullable BiFunction<? super RunnerAndConfigurationSettings, String, ? extends AnAction> createSubAction) { int allConfigurationsNumber = 0; for (Map<String, List<RunnerAndConfigurationSettings>> structure : RunManagerImpl.getInstanceImpl(project).getConfigurationsGroupedByTypeAndFolder(true).values()) { final DefaultActionGroup actionGroup = new DefaultActionGroup(); for (Map.Entry<String, List<RunnerAndConfigurationSettings>> entry : structure.entrySet()) { @NlsSafe String folderName = entry.getKey(); DefaultActionGroup group = folderName == null ? actionGroup : createFolder.apply(folderName); group.getTemplatePresentation().setIcon(AllIcons.Nodes.Folder); List<RunnerAndConfigurationSettings> configurationsList = entry.getValue(); for (RunnerAndConfigurationSettings settings : configurationsList) { group.add(createAction.apply(settings)); if (createSubAction != null && group != actionGroup) { // Inline run configuration from folder to the top level popup. It may be hidden by default but shown on search. actionGroup.add(createSubAction.apply(settings, folderName)); } } if (group != actionGroup) { actionGroup.add(group); } allConfigurationsNumber += configurationsList.size(); } allActionsGroup.add(actionGroup); allActionsGroup.addSeparator(); } return allConfigurationsNumber; }
|
addRunConfigurations
|
290,128
|
void (Project project, DefaultActionGroup allActionsGroup) { RunnerAndConfigurationSettings selected = RunManager.getInstance(project).getSelectedConfiguration(); if (selected != null) { ExecutionTarget activeTarget = ExecutionTargetManager.getActiveTarget(project); for (ExecutionTarget eachTarget : ExecutionTargetManager.getTargetsToChooseFor(project, selected.getConfiguration())) { allActionsGroup.add(new SelectTargetAction(project, eachTarget, eachTarget.equals(activeTarget))); } allActionsGroup.addSeparator(); } }
|
addTargetGroup
|
290,129
|
AnAction (final @NotNull RunnerAndConfigurationSettings configuration, final @NotNull Project project) { return new SelectConfigAction(configuration, project, executor -> true); }
|
createFinalAction
|
290,130
|
Dimension () { Dimension d = super.getPreferredSize(); d.width = Math.max(d.width, JBUIScale.scale(75)); return d; }
|
getPreferredSize
|
290,131
|
void () { DataContext context = DataManager.getInstance().getDataContext(this); final Project project = CommonDataKeys.PROJECT.getData(context); if (project != null && !ActionUtil.isDumbMode(project)) { new EditConfigurationsDialog(project).show(); return; } super.doShiftClick(); }
|
doShiftClick
|
290,132
|
void (ActionEvent event) { if (Boolean.TRUE.equals(getPresentation().getClientProperty(BUTTON_MODE))) { performWhenButton(this, ActionPlaces.UNKNOWN); return; } super.fireActionPerformed(event); }
|
fireActionPerformed
|
290,133
|
boolean (@NotNull Presentation presentation) { return !Boolean.TRUE.equals(presentation.getClientProperty(BUTTON_MODE)); }
|
isArrowVisible
|
290,134
|
void (final @NotNull AnActionEvent e) { final Project project = e.getData(CommonDataKeys.PROJECT); if (project != null) { RunnerAndConfigurationSettings settings = chooseTempSettings(project); if (settings != null) { final RunManager runManager = RunManager.getInstance(project); runManager.makeStable(settings); } } }
|
actionPerformed
|
290,135
|
void (final @NotNull AnActionEvent e) { final Presentation presentation = e.getPresentation(); final Project project = e.getData(CommonDataKeys.PROJECT); if (project == null) { disable(presentation); return; } RunnerAndConfigurationSettings settings = chooseTempSettings(project); if (settings == null) { disable(presentation); } else { presentation.setText(ExecutionBundle.messagePointer("save.temporary.run.configuration.action.name", Executor.shortenNameIfNeeded(settings.getName()))); //noinspection DialogTitleCapitalization presentation.setDescription(presentation.getText()); presentation.setEnabledAndVisible(true); } }
|
update
|
290,136
|
ActionUpdateThread () { return ActionUpdateThread.EDT; }
|
getActionUpdateThread
|
290,137
|
void (final Presentation presentation) { presentation.setEnabledAndVisible(false); }
|
disable
|
290,138
|
void (@NotNull DefaultActionGroup group, @NotNull Function<? super Executor, ? extends ExecutorRegistryImpl.ExecutorAction> actionCreator, @NotNull Function<? super Executor, Boolean> executorFilter) { for (Executor executor : Executor.EXECUTOR_EXTENSION_NAME.getExtensionList()) { if (executor instanceof ExecutorGroup) { for (Executor childExecutor : ((ExecutorGroup<?>)executor).childExecutors()) { if (executorFilter.apply(childExecutor)) { group.addAction(actionCreator.apply(childExecutor)); } } } else { if (executorFilter.apply(executor)) { group.addAction(actionCreator.apply(executor)); } } } }
|
addExecutorActions
|
290,139
|
void () { // Add actions similar to com.intellij.execution.actions.ChooseRunConfigurationPopup.ConfigurationActionsStep#buildActions addExecutorActions(this, ExecutorRegistryImpl.RunCurrentFileExecutorAction::new, myExecutorFilter); addSeparator(); addAction(new ExecutorRegistryImpl.EditRunConfigAndRunCurrentFileExecutorAction(DefaultRunExecutor.getRunExecutorInstance())); }
|
addSubActions
|
290,140
|
void (@NotNull AnActionEvent e) { e.getPresentation().setEnabledAndVisible(e.getProject() != null && hasRunCurrentFileItem(e.getProject())); }
|
update
|
290,141
|
ActionUpdateThread () { return ActionUpdateThread.EDT; }
|
getActionUpdateThread
|
290,142
|
void (@NotNull AnActionEvent e) { Project project = e.getProject(); if (project == null) return; RunManager.getInstance(project).setSelectedConfiguration(null); updatePresentation(null, null, project, e.getPresentation(), e.getPlace()); }
|
actionPerformed
|
290,143
|
void (@NotNull AnActionEvent e) { ExecutionTargetManager.setActiveTarget(myProject, myTarget); updatePresentation(ExecutionTargetManager.getActiveTarget(myProject), RunManager.getInstance(myProject).getSelectedConfiguration(), myProject, e.getPresentation(), e.getPlace()); }
|
actionPerformed
|
290,144
|
boolean () { RunnerAndConfigurationSettings configuration = RunManager.getInstance(myProject).getSelectedConfiguration(); return configuration == null || configuration.getType().isDumbAware(); }
|
isDumbAware
|
290,145
|
RunnerAndConfigurationSettings () { return myConfiguration; }
|
getConfiguration
|
290,146
|
void (final Presentation presentation) { setConfigurationIcon(presentation, myConfiguration, myProject); }
|
updateIcon
|
290,147
|
void () { // Add actions similar to com.intellij.execution.actions.ChooseRunConfigurationPopup.ConfigurationActionsStep#buildActions addExecutorActions(this, executor -> new ExecutorRegistryImpl.RunSpecifiedConfigExecutorAction(executor, myConfiguration, false), myExecutorFilter); addSeparator(ExperimentalUI.isNewUI() ? ExecutionBundle.message("choose.run.popup.separator") : null); if (!ExperimentalUI.isNewUI()) { Executor runExecutor = DefaultRunExecutor.getRunExecutorInstance(); addAction(new ExecutorRegistryImpl.RunSpecifiedConfigExecutorAction(runExecutor, myConfiguration, true)); } else { addAction(ActionManager.getInstance().getAction(IdeActions.ACTION_EDIT_RUN_CONFIGURATIONS)); } if (myConfiguration.isTemporary()) { String actionName = ExecutionBundle.message("choose.run.popup.save"); String description = ExecutionBundle.message("choose.run.popup.save.description"); addAction(new ActionWithWriteAccess(actionName, description, !ExperimentalUI.isNewUI() ? AllIcons.Actions.MenuSaveall : null) { @Override public void actionPerformed(@NotNull AnActionEvent e) { RunManager.getInstance(myProject).makeStable(myConfiguration); } }); } String actionName = ExecutionBundle.message("choose.run.popup.delete"); String description = ExecutionBundle.message("choose.run.popup.delete.description"); addAction(new ActionWithWriteAccess(actionName, description, !ExperimentalUI.isNewUI() ? AllIcons.Actions.Cancel : null) { @Override public void actionPerformed(@NotNull AnActionEvent e) { ChooseRunConfigurationPopup.deleteConfiguration(myProject, myConfiguration, null); } }); }
|
addSubActions
|
290,148
|
void (@NotNull AnActionEvent e) { RunManager.getInstance(myProject).makeStable(myConfiguration); }
|
actionPerformed
|
290,149
|
void (@NotNull AnActionEvent e) { ChooseRunConfigurationPopup.deleteConfiguration(myProject, myConfiguration, null); }
|
actionPerformed
|
290,150
|
void (final @NotNull AnActionEvent e) { RunManager.getInstance(myProject).setSelectedConfiguration(myConfiguration); updatePresentation(ExecutionTargetManager.getActiveTarget(myProject), myConfiguration, myProject, e.getPresentation(), e.getPlace()); }
|
actionPerformed
|
290,151
|
void (final @NotNull AnActionEvent e) { super.update(e); updateIcon(e.getPresentation()); }
|
update
|
290,152
|
ActionUpdateThread () { return ActionUpdateThread.BGT; }
|
getActionUpdateThread
|
290,153
|
void (final @NotNull AnActionEvent e) { final Project project = e.getProject(); if (project == null || project.isDisposed()) return; final Ref<Pair<? extends JComponent, String>> stateRef = new Ref<>(); final Ref<Balloon> balloonRef = new Ref<>(); final Timer timer = TimerUtil.createNamedTimer("runningLists", 250); ActionListener actionListener = new ActionListener() { @Override public void actionPerformed(ActionEvent actionEvent) { Balloon balloon = balloonRef.get(); if (project.isDisposed() || (balloon != null && balloon.isDisposed())) { timer.stop(); return; } ArrayList<Project> projects = new ArrayList<>(Arrays.asList(ProjectManager.getInstance().getOpenProjects())); //List should begin with current project projects.remove(project); projects.add(0, project); Pair<? extends JComponent, String> state = getCurrentState(projects); Pair<? extends JComponent, String> prevState = stateRef.get(); if (prevState != null && prevState.getSecond().equals(state.getSecond())) return; stateRef.set(state); BalloonBuilder builder = JBPopupFactory.getInstance().createBalloonBuilder(state.getFirst()); builder.setShowCallout(false) .setTitle(ExecutionBundle.message("show.running.list.balloon.title")) .setBlockClicksThroughBalloon(true) .setDialogMode(true) .setHideOnKeyOutside(false); IdeFrame frame = e.getData(IdeFrame.KEY); if (frame == null) { frame = WindowManagerEx.getInstanceEx().getFrameHelper(project); } if (balloon != null) { balloon.hide(); } builder.setClickHandler(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (e.getSource() instanceof MouseEvent mouseEvent) { Component component = mouseEvent.getComponent(); component = SwingUtilities.getDeepestComponentAt(component, mouseEvent.getX(), mouseEvent.getY()); Object value = ((JComponent)component).getClientProperty(KEY); if (value instanceof Trinity) { Project aProject = (Project)((Trinity<?, ?, ?>)value).first; JFrame aFrame = WindowManager.getInstance().getFrame(aProject); if (aFrame != null && !aFrame.isActive()) { IdeFocusManager.getGlobalInstance().doWhenFocusSettlesDown(() -> { IdeFocusManager.getGlobalInstance().requestFocus(aFrame, true); }); } RunContentManager.getInstance(aProject). toFrontRunContent((Executor)((Trinity<?, ?, ?>)value).second, (RunContentDescriptor)((Trinity<?, ?, ?>)value).third); } } } }, false); balloon = builder.createBalloon(); balloonRef.set(balloon); JComponent component = frame.getComponent(); RelativePoint point = new RelativePoint(component, new Point(component.getWidth(), 0)); balloon.show(point, Balloon.Position.below); } }; timer.addActionListener(actionListener); timer.setInitialDelay(0); timer.start(); }
|
actionPerformed
|
290,154
|
void (ActionEvent actionEvent) { Balloon balloon = balloonRef.get(); if (project.isDisposed() || (balloon != null && balloon.isDisposed())) { timer.stop(); return; } ArrayList<Project> projects = new ArrayList<>(Arrays.asList(ProjectManager.getInstance().getOpenProjects())); //List should begin with current project projects.remove(project); projects.add(0, project); Pair<? extends JComponent, String> state = getCurrentState(projects); Pair<? extends JComponent, String> prevState = stateRef.get(); if (prevState != null && prevState.getSecond().equals(state.getSecond())) return; stateRef.set(state); BalloonBuilder builder = JBPopupFactory.getInstance().createBalloonBuilder(state.getFirst()); builder.setShowCallout(false) .setTitle(ExecutionBundle.message("show.running.list.balloon.title")) .setBlockClicksThroughBalloon(true) .setDialogMode(true) .setHideOnKeyOutside(false); IdeFrame frame = e.getData(IdeFrame.KEY); if (frame == null) { frame = WindowManagerEx.getInstanceEx().getFrameHelper(project); } if (balloon != null) { balloon.hide(); } builder.setClickHandler(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (e.getSource() instanceof MouseEvent mouseEvent) { Component component = mouseEvent.getComponent(); component = SwingUtilities.getDeepestComponentAt(component, mouseEvent.getX(), mouseEvent.getY()); Object value = ((JComponent)component).getClientProperty(KEY); if (value instanceof Trinity) { Project aProject = (Project)((Trinity<?, ?, ?>)value).first; JFrame aFrame = WindowManager.getInstance().getFrame(aProject); if (aFrame != null && !aFrame.isActive()) { IdeFocusManager.getGlobalInstance().doWhenFocusSettlesDown(() -> { IdeFocusManager.getGlobalInstance().requestFocus(aFrame, true); }); } RunContentManager.getInstance(aProject). toFrontRunContent((Executor)((Trinity<?, ?, ?>)value).second, (RunContentDescriptor)((Trinity<?, ?, ?>)value).third); } } } }, false); balloon = builder.createBalloon(); balloonRef.set(balloon); JComponent component = frame.getComponent(); RelativePoint point = new RelativePoint(component, new Point(component.getWidth(), 0)); balloon.show(point, Balloon.Position.below); }
|
actionPerformed
|
290,155
|
void (ActionEvent e) { if (e.getSource() instanceof MouseEvent mouseEvent) { Component component = mouseEvent.getComponent(); component = SwingUtilities.getDeepestComponentAt(component, mouseEvent.getX(), mouseEvent.getY()); Object value = ((JComponent)component).getClientProperty(KEY); if (value instanceof Trinity) { Project aProject = (Project)((Trinity<?, ?, ?>)value).first; JFrame aFrame = WindowManager.getInstance().getFrame(aProject); if (aFrame != null && !aFrame.isActive()) { IdeFocusManager.getGlobalInstance().doWhenFocusSettlesDown(() -> { IdeFocusManager.getGlobalInstance().requestFocus(aFrame, true); }); } RunContentManager.getInstance(aProject). toFrontRunContent((Executor)((Trinity<?, ?, ?>)value).second, (RunContentDescriptor)((Trinity<?, ?, ?>)value).third); } } }
|
actionPerformed
|
290,156
|
ActionUpdateThread () { return ActionUpdateThread.BGT; }
|
getActionUpdateThread
|
290,157
|
void (@NotNull AnActionEvent e) { Project[] projects = ProjectManager.getInstance().getOpenProjects(); for (Project project : projects) { boolean enabled = project != null && !project.isDisposed() && !ExecutionManagerImpl.getInstance(project).getRunningDescriptors(Conditions.alwaysTrue()).isEmpty(); e.getPresentation().setEnabled(enabled); if (enabled) break; } }
|
update
|
290,158
|
boolean (RunConfiguration configuration, ConfigurationContext context) { return super.isEnabledFor(configuration) && isNewConfiguration(configuration, context); }
|
isEnabledFor
|
290,159
|
boolean (RunConfiguration configuration, ConfigurationContext context) { RunnerAndConfigurationSettings existing = context.findExisting(); return existing != null && !existing.getConfiguration().equals(configuration); }
|
isNewConfiguration
|
290,160
|
void (ConfigurationContext context) { final RunManagerEx runManager = (RunManagerEx)context.getRunManager(); DataContext dataContext = context.getDefaultDataContext(); ReadAction .nonBlocking(() -> findExisting(context)) .finishOnUiThread(ModalityState.nonModal(), existingConfiguration -> perform(runManager, existingConfiguration, dataContext)) .submit(AppExecutorUtil.getAppExecutorService()); }
|
perform
|
290,161
|
void (final RunnerAndConfigurationSettings configuration, ConfigurationContext context) { final RunManagerEx runManager = (RunManagerEx)context.getRunManager(); if (configuration == null) { RunnerAndConfigurationSettings contextConfiguration = context.getConfiguration(); if (contextConfiguration == null) { return; } runManager.setTemporaryConfiguration(contextConfiguration); perform(runManager, contextConfiguration, context.getDataContext()); } else { DataContext dataContext = context.getDefaultDataContext(); ReadAction .nonBlocking(() -> findExisting(context)) .finishOnUiThread(ModalityState.nonModal(), existingConfiguration -> { if (configuration != existingConfiguration) { RunConfigurationOptionUsagesCollector.logAddNew(context.getProject(), configuration.getType().getId(), context.getPlace()); runManager.setTemporaryConfiguration(configuration); perform(runManager, configuration, dataContext); } else { perform(runManager, configuration, dataContext); } }) .submit(AppExecutorUtil.getAppExecutorService()); } }
|
perform
|
290,162
|
void (RunManagerEx runManager, RunnerAndConfigurationSettings configuration, DataContext dataContext) { if (runManager.shouldSetRunConfigurationFromContext()) { runManager.setSelectedConfiguration(configuration); RunConfigurationStartHistory.getInstance(configuration.getConfiguration().getProject()).register(configuration); } if (LOG.isDebugEnabled()) { String configurationClass = configuration.getConfiguration().getClass().getName(); LOG.debug(String.format("Execute run configuration: %s", configurationClass)); } if (ApplicationManager.getApplication().isUnitTestMode()) { return; } ExecutionUtil.doRunConfiguration(configuration, myExecutor, null, null, dataContext); }
|
perform
|
290,163
|
boolean (@NotNull RunConfiguration configuration) { return getRunner(configuration) != null; }
|
isEnabledFor
|
290,164
|
void (final Presentation presentation, final @NotNull String actionText, final ConfigurationContext context) { presentation.setText(myExecutor.getStartActionText(actionText), true); Pair<Boolean, Boolean> b = isEnabledAndVisible(context); presentation.setEnabled(b.first); presentation.setVisible(b.second); }
|
updatePresentation
|
290,165
|
void (AnActionEvent event, ThreeState hadAnythingRunnable) { super.approximatePresentationByPreviousAvailability(event, hadAnythingRunnable); event.getPresentation().setText(myExecutor.getStartActionText() + "..."); }
|
approximatePresentationByPreviousAvailability
|
290,166
|
List<AnAction> (@NotNull ConfigurationContext context, @NotNull List<? extends ConfigurationFromContext> configurations) { final List<AnAction> childActions = new ArrayList<>(super.createChildActions(context, configurations)); boolean isMultipleConfigurationsFromAlternativeLocations = configurations.size() > 1 && configurations.get(0).isFromAlternativeLocation(); boolean isRunAction = myExecutor.getId().equals(DefaultRunExecutor.EXECUTOR_ID); if (isMultipleConfigurationsFromAlternativeLocations && isRunAction) { childActions.add(runAllConfigurationsAction(context, configurations)); } return childActions; }
|
createChildActions
|
290,167
|
AnAction (@NotNull ConfigurationContext context, @NotNull List<? extends ConfigurationFromContext> configurationsFromContext) { return new AnAction( CommonBundle.message("action.text.run.all"), ExecutionBundle.message("run.all.configurations.available.in.this.context"), AllIcons.RunConfigurations.Compound ) { @Override public void actionPerformed(@NotNull AnActionEvent e) { long groupId = ExecutionEnvironment.getNextUnusedExecutionId(); List<ConfigurationType> types = ContainerUtil.map(configurationsFromContext, context1 -> context1.getConfiguration().getType()); promptUserToUseRunDashboard(context.getProject(), types); for (ConfigurationFromContext configuration : configurationsFromContext) { ExecutionUtil.runConfiguration(configuration.getConfigurationSettings(), myExecutor, groupId); } } }; }
|
runAllConfigurationsAction
|
290,168
|
void (@NotNull AnActionEvent e) { long groupId = ExecutionEnvironment.getNextUnusedExecutionId(); List<ConfigurationType> types = ContainerUtil.map(configurationsFromContext, context1 -> context1.getConfiguration().getType()); promptUserToUseRunDashboard(context.getProject(), types); for (ConfigurationFromContext configuration : configurationsFromContext) { ExecutionUtil.runConfiguration(configuration.getConfigurationSettings(), myExecutor, groupId); } }
|
actionPerformed
|
290,169
|
Executor () { return myExecutor; }
|
getExecutor
|
290,170
|
void (final @NotNull AnActionEvent e) { Project project = e.getData(CommonDataKeys.PROJECT); if (project != null && project.isDisposed()) { return; } if (project == null) { //setup template project configurations project = ProjectManager.getInstance().getDefaultProject(); } RunnerAndConfigurationSettings configurationSettings = e.getData(RunToolbarPopupKt.getRUN_CONFIGURATION_KEY()); if (configurationSettings != null) { new EditConfigurationsDialog(project, new ProjectRunConfigurationConfigurable(project) { @Override protected RunnerAndConfigurationSettings getInitialSelectedConfiguration() { return configurationSettings; } }, e.getDataContext()).show(); } else { new EditConfigurationsDialog(project, e.getDataContext()).show(); } }
|
actionPerformed
|
290,171
|
RunnerAndConfigurationSettings () { return configurationSettings; }
|
getInitialSelectedConfiguration
|
290,172
|
void (final @NotNull AnActionEvent e) { Presentation presentation = e.getPresentation(); // we always show it enabled even in DumbMode, // 99% chances there will be some editable run configuration inside // and we don't want to check heavy conditions here presentation.setEnabled(true); if (e.getData(RunToolbarPopupKt.getRUN_CONFIGURATION_KEY()) != null) { presentation.setText(ExecutionBundle.message("choose.run.popup.edit")); presentation.setDescription(ExecutionBundle.message("choose.run.popup.edit.description")); if (!ExperimentalUI.isNewUI()) { presentation.setIcon(AllIcons.Actions.EditSource); } } else if (ActionPlaces.RUN_CONFIGURATIONS_COMBOBOX.equals(e.getPlace())) { presentation.setText(ExecutionBundle.messagePointer("edit.configuration.action")); presentation.setDescription(presentation.getText()); } }
|
update
|
290,173
|
ActionUpdateThread () { return ActionUpdateThread.BGT; }
|
getActionUpdateThread
|
290,174
|
void () { final String adText = getAdText(myAlternativeExecutor); if (adText != null) { myPopup.setAdText(adText); } myPopup.showCenteredInCurrentWindow(myProject); }
|
show
|
290,175
|
void (final RunListPopup popup) { popup.registerAction("alternateExecutor", KeyStroke.getKeyStroke("shift pressed SHIFT"), new AbstractAction() { @Override public void actionPerformed(ActionEvent e) { myCurrentExecutor = myAlternativeExecutor; updatePresentation(); } }); popup.registerAction("restoreDefaultExecutor", KeyStroke.getKeyStroke("released SHIFT"), new AbstractAction() { @Override public void actionPerformed(ActionEvent e) { myCurrentExecutor = myDefaultExecutor; updatePresentation(); } }); popup.registerAction("invokeAction", KeyStroke.getKeyStroke("shift ENTER"), new AbstractAction() { @Override public void actionPerformed(ActionEvent e) { popup.handleSelect(true); } }); popup.registerAction("editConfiguration", KeyStroke.getKeyStroke("F4"), new AbstractAction() { @Override public void actionPerformed(ActionEvent e) { myEditConfiguration = true; popup.handleSelect(true); } }); popup.registerAction("deleteConfiguration", KeyStroke.getKeyStroke("DELETE"), new AbstractAction() { @Override public void actionPerformed(ActionEvent e) { popup.removeSelected(); } }); popup.registerAction("speedsearch_bksp", KeyStroke.getKeyStroke("BACK_SPACE"), new AbstractAction() { @Override public void actionPerformed(ActionEvent e) { SpeedSearch speedSearch = popup.getSpeedSearch(); if (speedSearch.isHoldingFilter()) { speedSearch.backspace(); speedSearch.update(); } else { popup.removeSelected(); } } }); for (int i = 0; i < 10; i++) { addNumberAction(popup, i); } }
|
registerActions
|
290,176
|
void (ActionEvent e) { myCurrentExecutor = myAlternativeExecutor; updatePresentation(); }
|
actionPerformed
|
290,177
|
void (ActionEvent e) { myCurrentExecutor = myDefaultExecutor; updatePresentation(); }
|
actionPerformed
|
290,178
|
void (ActionEvent e) { popup.handleSelect(true); }
|
actionPerformed
|
290,179
|
void (ActionEvent e) { myEditConfiguration = true; popup.handleSelect(true); }
|
actionPerformed
|
290,180
|
void (ActionEvent e) { popup.removeSelected(); }
|
actionPerformed
|
290,181
|
void (ActionEvent e) { SpeedSearch speedSearch = popup.getSpeedSearch(); if (speedSearch.isHoldingFilter()) { speedSearch.backspace(); speedSearch.update(); } else { popup.removeSelected(); } }
|
actionPerformed
|
290,182
|
void (RunListPopup popup, int number) { Action action = createNumberAction(number, popup, myDefaultExecutor); Action action_ = createNumberAction(number, popup, myAlternativeExecutor); popup.registerAction(number + "Action", KeyStroke.getKeyStroke(String.valueOf(number)), action); popup.registerAction(number + "Action_", KeyStroke.getKeyStroke("shift pressed " + number), action_); popup.registerAction(number + "Action1", KeyStroke.getKeyStroke("NUMPAD" + number), action); popup.registerAction(number + "Action_1", KeyStroke.getKeyStroke("shift pressed NUMPAD" + number), action_); }
|
addNumberAction
|
290,183
|
void () { myPopup.setCaption(getExecutor().getActionName()); }
|
updatePresentation
|
290,184
|
void (ItemWrapper<?> itemWrapper, @Nullable Executor executor) { if (executor == null) { return; } final DataContext dataContext = DataManager.getInstance().getDataContext(); final Project project = CommonDataKeys.PROJECT.getData(dataContext); if (project != null) { itemWrapper.perform(project, executor, dataContext); } }
|
execute
|
290,185
|
void (@NotNull Project project, @NotNull RunnerAndConfigurationSettings configuration) { final Executor executor = getExecutor(); PropertiesComponent.getInstance().setValue("run.configuration.edit.ad", Boolean.toString(true)); if (RunDialog.editConfiguration(project, configuration, ExecutionBundle.message("dialog.title.edit.configuration.settings"), executor)) { RunManager.getInstance(project).setSelectedConfiguration(configuration); ExecutorRegistryImpl.RunnerHelper.run(project, configuration.getConfiguration(), configuration, DataContext.EMPTY_CONTEXT, executor); } }
|
editConfiguration
|
290,186
|
void (@NotNull Project project, @NotNull RunnerAndConfigurationSettings configurationSettings, @Nullable JBPopup popupToCancel) { RunManagerConfig runManagerConfig = RunManagerImpl.getInstanceImpl(project).getConfig(); boolean confirmed; if (runManagerConfig.isDeletionFromPopupRequiresConfirmation()) { if (popupToCancel != null) { popupToCancel.cancel(); } confirmed = MessageDialogBuilder.yesNo(CommonBundle.message("title.confirmation"), ExecutionBundle.message("are.you.sure.you.want.to.delete.0", configurationSettings.getName())) .doNotAsk(new DoNotAskOption.Adapter() { @Override public void rememberChoice(boolean isSelected, int exitCode) { runManagerConfig.setDeletionFromPopupRequiresConfirmation(!isSelected); } @Override public @NotNull String getDoNotShowMessage() { return ExecutionBundle.message("don.t.ask.again"); } @Override public boolean shouldSaveOptionsOnCancel() { return true; } }) .ask(project); } else { confirmed = true; } if (confirmed) { RunManager.getInstance(project).removeConfiguration(configurationSettings); } }
|
deleteConfiguration
|
290,187
|
void (boolean isSelected, int exitCode) { runManagerConfig.setDeletionFromPopupRequiresConfirmation(!isSelected); }
|
rememberChoice
|
290,188
|
String () { return ExecutionBundle.message("don.t.ask.again"); }
|
getDoNotShowMessage
|
290,189
|
boolean () { return true; }
|
shouldSaveOptionsOnCancel
|
290,190
|
Executor () { return myCurrentExecutor == null ? myDefaultExecutor : myCurrentExecutor; }
|
getExecutor
|
290,191
|
Action (final int number, final ListPopupImpl listPopup, final Executor executor) { return new MyAbstractAction(listPopup, number, executor); }
|
createNumberAction
|
290,192
|
int () { return myMnemonic; }
|
getMnemonic
|
290,193
|
boolean () { return myMnemonicsEnabled; }
|
digitMnemonicsEnabled
|
290,194
|
boolean () { return myChecked; }
|
isChecked
|
290,195
|
void (boolean checked) { myChecked = checked; }
|
setChecked
|
290,196
|
void (int mnemonic) { myMnemonic = mnemonic; }
|
setMnemonic
|
290,197
|
void (boolean mnemonicsEnabled) { myMnemonicsEnabled = mnemonicsEnabled; }
|
setMnemonicsEnabled
|
290,198
|
boolean () { return myAddSeparatorAbove; }
|
addSeparatorAbove
|
290,199
|
boolean () { return false; }
|
canBeDeleted
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.