Unnamed: 0
int64 0
305k
| body
stringlengths 7
52.9k
| name
stringlengths 1
185
|
|---|---|---|
290,000
|
List<String> () { return myEnvFilePaths; }
|
getEnvFilePaths
|
290,001
|
void () { String text = StringUtil.trimStart(getText(), stringifyEnvs(myData)); if (myEnvFilePaths.isEmpty() || text.isEmpty()) return; List<String> paths = ContainerUtil.filter(ContainerUtil.map(text.split(";"), s -> s.trim()), s -> !s.isEmpty()); for (int i = 0; i < Math.min(myEnvFilePaths.size(), paths.size()); i++) { myEnvFilePaths.set(i, paths.get(i)); } }
|
updateEnvFilesFromText
|
290,002
|
List<EnvironmentVariable> (Map<String, String> map, final boolean readOnly) { return ContainerUtil.map(map.entrySet(), entry -> new EnvironmentVariable(entry.getKey(), entry.getValue(), readOnly) { @Override public boolean getNameIsWriteable() { return !readOnly; } }); }
|
convertToVariables
|
290,003
|
boolean () { return !readOnly; }
|
getNameIsWriteable
|
290,004
|
boolean (@NotNull EnvironmentVariable v) { return !v.getNameIsWriteable() && !Objects.equals(v.getValue(), myParentDefaults.get(v.getName())); }
|
isModifiedSysEnv
|
290,005
|
boolean (@NotNull Attribute attribute) { return attribute.getName().equals(Constants.NAME) && attribute.getParent().getName().equals("configuration"); }
|
skipPathMacros
|
290,006
|
boolean (@NotNull Element element) { if (!element.getName().equals("env")) { return false; } var name = element.getAttributeValue(Constants.NAME); var value = element.getAttributeValue(Constants.VALUE); return name != null && value != null && EnvironmentUtil.containsEnvKeySubstitution(name, value); }
|
skipPathMacros
|
290,007
|
boolean (@NotNull Attribute attribute) { final Element parent = attribute.getParent(); if (parent != null && Constants.OPTION.equals(parent.getName())) { final Element grandParent = parent.getParentElement(); return grandParent != null && "configuration".equals(grandParent.getName()); } return false; }
|
recursePathMacros
|
290,008
|
void (final @NotNull RunContentDescriptor descriptor) { if (descriptor.getComponent() != null && REGISTRY.add(descriptor)) { Disposer.register(descriptor, new Disposable() { @Override public void dispose() { REGISTRY.remove(descriptor); } }); } }
|
register
|
290,009
|
void () { REGISTRY.remove(descriptor); }
|
dispose
|
290,010
|
void (@NotNull AnActionEvent e) { List<RunContentDescriptor> descriptors = new ArrayList<>(REGISTRY); for (RunContentDescriptor descriptor : descriptors) { if (descriptor.getComponent() == null) { REGISTRY.remove(descriptor); } else { Project project = e.getProject(); if (project != null) { RunContentManager runContentManager = RunContentManager.getInstance(project); // check if the descriptor belongs to the current project if (runContentManager.getToolWindowByDescriptor(descriptor) != null) { ExecutionUtil.restart(descriptor); } } } } }
|
actionPerformed
|
290,011
|
ActionUpdateThread () { return ActionUpdateThread.BGT; }
|
getActionUpdateThread
|
290,012
|
void (@NotNull AnActionEvent e) { e.getPresentation().setEnabled(e.getProject() != null); }
|
update
|
290,013
|
ExecutionEnvironment (@NotNull ExecutionEnvironment environment, @Nullable ProgramRunner runner) { if (runner == null || runner.equals(environment.getRunner())) { return environment; } else { return new ExecutionEnvironmentBuilder(environment).runner(runner).build(); } }
|
fix
|
290,014
|
void (final @NotNull AnAction action) { myRunnerActions.add(action); }
|
addAction
|
290,015
|
RunContentDescriptor () { RunProfile profile = myEnvironment.getRunProfile(); if (ApplicationManager.getApplication().isUnitTestMode()) { return new RunContentDescriptor(profile, myExecutionResult, myUi); } ExecutionConsole console = myExecutionResult.getExecutionConsole(); RunContentDescriptor contentDescriptor = new RunContentDescriptor(profile, myExecutionResult, myUi); AnAction[] consoleActionsToMerge; AnAction[] additionalActionsToMerge; Content consoleContent = null; if (console != null) { if (console instanceof ExecutionConsoleEx) { ((ExecutionConsoleEx)console).buildUi(myUi); } else { consoleContent = buildConsoleUiDefault(myUi, console); } initLogConsoles(profile, contentDescriptor, console); } if (consoleContent != null && myUi.getContentManager().getContentCount() == 1 && console instanceof TerminalExecutionConsole) { // TerminalExecutionConsole provides too few toolbar actions. Such console toolbar doesn't look good, but occupy // valuable space. // Let's show terminal console actions right in the main toolbar iff console content is the only one. // Otherwise (with multiple contents), it's unclear what content will be affected by a console action from // the main toolbar. consoleActionsToMerge = ((TerminalExecutionConsole)console).createConsoleActions(); // clear console toolbar actions to remove the console toolbar consoleContent.setActions(new DefaultActionGroup(), ActionPlaces.RUNNER_TOOLBAR, console.getComponent()); additionalActionsToMerge = AnAction.EMPTY_ARRAY; } else if (consoleContent != null && myUi.getContentManager().getContentCount() == 1 && console instanceof RunContentActionsContributor contributor) { consoleActionsToMerge = contributor.getActions(); additionalActionsToMerge = contributor.getAdditionalActions(); contributor.hideOriginalActions(); } else { consoleActionsToMerge = AnAction.EMPTY_ARRAY; additionalActionsToMerge = AnAction.EMPTY_ARRAY; } AnAction[] restartActions = contentDescriptor.getRestartActions(); initToolbars(restartActions, consoleActionsToMerge, additionalActionsToMerge); CustomActionsListener.subscribe(this, () -> { DefaultActionGroup updatedToolbar = createActionToolbar(restartActions, consoleActionsToMerge, additionalActionsToMerge); toolbar.removeAll(); toolbar.addAll(updatedToolbar.getChildren(null)); }); if (profile instanceof RunConfigurationBase) { if (console instanceof ObservableConsoleView && !ApplicationManager.getApplication().isUnitTestMode()) { ((ObservableConsoleView)console).addChangeListener(new ConsoleToFrontListener((RunConfigurationBase)profile, myProject, myEnvironment.getExecutor(), contentDescriptor, myUi), this); } } return contentDescriptor; }
|
createDescriptor
|
290,016
|
void (AnAction @NotNull [] restartActions, AnAction @NotNull [] consoleActions, AnAction @NotNull [] additionalActions) { toolbar = createActionToolbar(restartActions, consoleActions, additionalActions); if (UIExperiment.isNewDebuggerUIEnabled()) { var isVerticalToolbar = Registry.get("debugger.new.tool.window.layout.toolbar").isOptionEnabled("Vertical"); if (Registry.is("debugger.new.tool.window.layout.single.content", false)) { mySupplier = new RunTabSupplier(toolbar) { { setMoveToolbar(!isVerticalToolbar); } @Override public @Nullable ActionGroup getToolbarActions() { return isVerticalToolbar ? ActionGroup.EMPTY_GROUP : super.getToolbarActions(); } @Override public @NotNull List<AnAction> getContentActions() { return List.of(myUi.getOptions().getLayoutActions()); } @Override public @NotNull String getMainToolbarPlace() { return ActionPlaces.RUNNER_TOOLBAR; } @Override public @NotNull String getContentToolbarPlace() { return ActionPlaces.RUNNER_TOOLBAR; } }; } if (myUi instanceof RunnerLayoutUiImpl) { ((RunnerLayoutUiImpl)myUi).setLeftToolbarVisible(isVerticalToolbar); } if (isVerticalToolbar) { myUi.getOptions().setLeftToolbar(toolbar, ActionPlaces.RUNNER_TOOLBAR); } else { // wrapped into DefaultActionGroup to prevent loading all actions instantly DefaultActionGroup topToolbar = new DefaultActionGroupWithDelegate(toolbar); topToolbar.add(new EmptyWhenDuplicate(toolbar, group -> group instanceof RunTab.ToolbarActionGroup)); myUi.getOptions().setTopLeftToolbar(topToolbar, ActionPlaces.RUNNER_TOOLBAR); } } else { myUi.getOptions().setLeftToolbar(toolbar, ActionPlaces.RUNNER_TOOLBAR); } }
|
initToolbars
|
290,017
|
List<AnAction> () { return List.of(myUi.getOptions().getLayoutActions()); }
|
getContentActions
|
290,018
|
String () { return ActionPlaces.RUNNER_TOOLBAR; }
|
getMainToolbarPlace
|
290,019
|
String () { return ActionPlaces.RUNNER_TOOLBAR; }
|
getContentToolbarPlace
|
290,020
|
String (@Nullable ExecutionConsole console) { if (console instanceof ExecutionConsoleEx) { String id = ((ExecutionConsoleEx)console).getExecutionConsoleId(); if (id != null) { return JAVA_RUNNER + '.' + id; } } return JAVA_RUNNER; }
|
getRunnerType
|
290,021
|
Content (@NotNull RunnerLayoutUi ui, @NotNull ExecutionConsole console) { Content consoleContent = ui.createContent(ExecutionConsole.CONSOLE_CONTENT_ID, console.getComponent(), CommonBundle.message("title.console"), null, console.getPreferredFocusableComponent()); consoleContent.setCloseable(false); addAdditionalConsoleEditorActions(console, consoleContent); ui.addContent(consoleContent, 0, PlaceInGrid.bottom, false); return consoleContent; }
|
buildConsoleUiDefault
|
290,022
|
void (final ExecutionConsole console, final Content consoleContent) { final DefaultActionGroup consoleActions = new DefaultActionGroup(); if (console instanceof ConsoleView) { for (AnAction action : ((ConsoleView)console).createConsoleActions()) { consoleActions.add(action); } } consoleContent.setActions(consoleActions, ActionPlaces.RUNNER_TOOLBAR, console.getComponent()); }
|
addAdditionalConsoleEditorActions
|
290,023
|
DefaultActionGroup (AnAction @NotNull [] restartActions, AnAction @NotNull [] consoleActions, AnAction @NotNull [] additionalActions) { boolean isNewLayout = UIExperiment.isNewDebuggerUIEnabled(); String mainGroupId = isNewLayout ? RUN_TOOL_WINDOW_TOP_TOOLBAR_GROUP : RUN_TOOL_WINDOW_TOP_TOOLBAR_OLD_GROUP; ActionGroup toolbarGroup = (ActionGroup)CustomActionsSchema.getInstance().getCorrectedAction(mainGroupId); AnAction[] mainChildren = toolbarGroup.getChildren(null); DefaultActionGroup actionGroup = new DefaultActionGroupWithDelegate(toolbarGroup); actionGroup.addAll(mainChildren); DefaultActionGroup afterRunActions = new DefaultActionGroup(restartActions); if (!isNewLayout) { afterRunActions.add(new CreateAction(AllIcons.General.Settings)); afterRunActions.addSeparator(); } MoreActionGroup moreGroup = null; if (isNewLayout) { moreGroup = new MoreActionGroup(); ActionGroup moreActionGroup = (ActionGroup)CustomActionsSchema.getInstance().getCorrectedAction(RUN_TOOL_WINDOW_TOP_TOOLBAR_MORE_GROUP); moreGroup.addAll(removeDuplicatesExceptSeparators(moreActionGroup.getChildren(null), Arrays.asList(mainChildren))); } addActionsWithConstraints(afterRunActions.getChildren(null), new Constraints(AFTER, IdeActions.ACTION_RERUN), actionGroup, moreGroup); DefaultActionGroup afterStopActions = new DefaultActionGroup(myExecutionResult.getActions()); if (consoleActions.length > 0) { afterStopActions.addSeparator(); afterStopActions.addAll(consoleActions); } if (!isNewLayout) { for (AnAction anAction : myRunnerActions) { if (anAction != null) { afterStopActions.add(anAction); } else { afterStopActions.addSeparator(); } } addActionsWithConstraints(afterStopActions.getChildren(null), new Constraints(AFTER, IdeActions.ACTION_STOP_PROGRAM), actionGroup, null); actionGroup.addSeparator(); actionGroup.add(myUi.getOptions().getLayoutActions()); actionGroup.addSeparator(); actionGroup.add(PinToolwindowTabAction.getPinAction()); } else { afterStopActions.addSeparator(); afterStopActions.addAll(myRunnerActions); addActionsWithConstraints(afterStopActions.getChildren(null), new Constraints(AFTER, IdeActions.ACTION_STOP_PROGRAM), actionGroup, moreGroup); moreGroup.addSeparator(); if (additionalActions.length > 0) { moreGroup.addSeparator(); moreGroup.addAll(additionalActions); } actionGroup.add(moreGroup); moreGroup.add(new CreateAction()); } return actionGroup; }
|
createActionToolbar
|
290,024
|
RunContentDescriptor (@Nullable RunContentDescriptor reuseContent) { RunContentDescriptor descriptor = createDescriptor(); Disposer.register(descriptor, this); Disposer.register(myProject, descriptor); RunContentManagerImpl.copyContentAndBehavior(descriptor, reuseContent); myRunContentDescriptor = descriptor; return descriptor; }
|
showRunContent
|
290,025
|
void (@NotNull String text, @NotNull ConsoleViewContentType type) { if (myProject.isDisposed() || myUi.isDisposed()) { return; } if (((type == ConsoleViewContentType.NORMAL_OUTPUT) && myShowConsoleOnStdOut || (type == ConsoleViewContentType.ERROR_OUTPUT) && myShowConsoleOnStdErr) && myFocused.compareAndSet(false, true)) { RunContentManager.getInstance(myProject).toFrontRunContent(myExecutor, myRunContentDescriptor); myUi.selectAndFocus(myUi.findContent(ExecutionConsole.CONSOLE_CONTENT_ID), false, false); } }
|
textAdded
|
290,026
|
Component (@Nullable AnActionEvent e) { if (e == null) return null; SingleContentSupplier supplier = e.getData(SingleContentSupplier.KEY); return supplier != null ? supplier.getTabs().getComponent() : null; }
|
getEventComponent
|
290,027
|
boolean (@Nullable Component parent) { for (Component component : UIUtil.uiTraverser(parent)) { if (component instanceof ActionToolbarImpl) { ActionGroup group = ((ActionToolbarImpl)component).getActionGroup(); if (myDuplicatePredicate.test(group)) { return true; } } } return false; }
|
isToolbarDuplicatedAnywhere
|
290,028
|
ActionGroup () { return myDelegate; }
|
getDelegate
|
290,029
|
GlobalSearchScope () { return mySearchScope; }
|
getSearchScope
|
290,030
|
void (AnAction[] actions, Constraints constraints, DefaultActionGroup actionGroup, @Nullable DefaultActionGroup moreGroup) { addActionsWithConstraints(Arrays.asList(actions), constraints, actionGroup, moreGroup); }
|
addActionsWithConstraints
|
290,031
|
void (List<AnAction> actions, Constraints constraints, DefaultActionGroup actionGroup, @Nullable DefaultActionGroup moreGroup) { for (AnAction action : ContainerUtil.reverse(actions)) { if (moreGroup != null && action.getTemplatePresentation().getClientProperty(PREFERRED_PLACE) == PreferredPlace.MORE_GROUP) { moreGroup.add(action); } else { actionGroup.add(action, constraints); } } }
|
addActionsWithConstraints
|
290,032
|
List<AnAction> (AnAction[] actionsToFilter, Collection<AnAction> mainActions) { HashSet<AnAction> visited = new HashSet<>(mainActions); return filter(actionsToFilter, action -> action instanceof Separator || !visited.contains(action)); }
|
removeDuplicatesExceptSeparators
|
290,033
|
ActionUpdateThread () { return ActionUpdateThread.EDT; }
|
getActionUpdateThread
|
290,034
|
void (@NotNull AnActionEvent event) { Presentation presentation = event.getPresentation(); ExecutionEnvironment environment = getEnvironment(event); if (environment != null) { RunnerAndConfigurationSettings settings = environment.getRunnerAndConfigurationSettings(); RunConfiguration configuration = settings == null ? null : settings.getConfiguration(); if (configuration != null && RunDashboardManager.getInstance(configuration.getProject()).isShowInDashboard(configuration)) { presentation.setEnabledAndVisible(false); return; } presentation.setText(ExecutionBundle.messagePointer("rerun.configuration.action.name", StringUtil.escapeMnemonics(environment.getRunProfile().getName()))); Icon rerunIcon = ExperimentalUI.isNewUI() ? environment.getExecutor().getRerunIcon() : environment.getExecutor().getIcon(); boolean isRestart = ActionPlaces.TOUCHBAR_GENERAL.equals(event.getPlace()) || ExecutionManagerImpl.isProcessRunning(getDescriptor(event)); presentation.setIcon(isRestart && !ExperimentalUI.isNewUI() ? AllIcons.Actions.Restart : rerunIcon); presentation.setEnabled(isEnabled(event)); return; } presentation.setEnabledAndVisible(false); }
|
update
|
290,035
|
void (@NotNull AnActionEvent event) { ExecutionEnvironment environment = getEnvironment(event); if (environment != null) { ExecutionUtil.restart(environment); } }
|
actionPerformed
|
290,036
|
boolean (@NotNull AnActionEvent event) { RunContentDescriptor descriptor = getDescriptor(event); ProcessHandler processHandler = descriptor == null ? null : descriptor.getProcessHandler(); ExecutionEnvironment environment = getEnvironment(event); Project project = getEventProject(event); if (environment == null || project == null) { return false; } RunnerAndConfigurationSettings settings = environment.getRunnerAndConfigurationSettings(); return (!DumbService.isDumb(project) || settings == null || settings.getType().isDumbAware()) && !ExecutionManager.getInstance(project).isStarting(environment) && !(processHandler != null && processHandler.isProcessTerminating()); }
|
isEnabled
|
290,037
|
boolean () { return true; }
|
isDumbAware
|
290,038
|
void () { myRunContentDescriptor = null; myEnvironment = null; logConsoleManager = null; }
|
dispose
|
290,039
|
LogConsoleManagerBase () { if (logConsoleManager == null) { logConsoleManager = new LogConsoleManagerBase(myProject, mySearchScope) { @Override protected Icon getDefaultIcon() { return AllIcons.Debugger.Console; } @Override protected RunnerLayoutUi getUi() { return myUi; } @Override public ProcessHandler getProcessHandler() { return myRunContentDescriptor == null ? null : myRunContentDescriptor.getProcessHandler(); } }; } return logConsoleManager; }
|
getLogConsoleManager
|
290,040
|
Icon () { return AllIcons.Debugger.Console; }
|
getDefaultIcon
|
290,041
|
RunnerLayoutUi () { return myUi; }
|
getUi
|
290,042
|
ProcessHandler () { return myRunContentDescriptor == null ? null : myRunContentDescriptor.getProcessHandler(); }
|
getProcessHandler
|
290,043
|
void (@NotNull RunProfile runConfiguration, @NotNull RunContentDescriptor contentDescriptor, @Nullable ExecutionConsole console) { ProcessHandler processHandler = contentDescriptor.getProcessHandler(); if (runConfiguration instanceof RunConfigurationBase configuration) { if (myManager == null) { myManager = new LogFilesManager(myProject, getLogConsoleManager(), contentDescriptor); } myManager.addLogConsoles(configuration, processHandler); if (processHandler != null) { OutputFileUtil.attachDumpListener(configuration, processHandler, console); } } }
|
initLogConsoles
|
290,044
|
void (@NotNull AnActionEvent e) { e.getPresentation().setEnabledAndVisible(getChildren(null).length > 0); }
|
update
|
290,045
|
ActionUpdateThread () { return ActionUpdateThread.EDT; }
|
getActionUpdateThread
|
290,046
|
boolean () { return true; }
|
isDumbAware
|
290,047
|
JBTabs () { RunnerContentUi contentUi = RunnerContentUi.KEY.getData((DataProvider)myUi); return Objects.requireNonNull(contentUi).getTabs(); }
|
getTabs
|
290,048
|
List<AnAction> () { return List.of(layoutActionGroup); }
|
getContentActions
|
290,049
|
void (@Nullable ActionToolbar mainToolbar, @Nullable ActionToolbar contentToolbar) { JBTabs tabs = getTabs(); if (tabs instanceof JBTabsEx) { ((JBTabsEx)tabs).setHideTopPanel(true); } }
|
init
|
290,050
|
void () { JBTabs tabs = getTabs(); if (tabs instanceof JBTabsEx) { ((JBTabsEx)tabs).setHideTopPanel(false); } }
|
reset
|
290,051
|
boolean (@NotNull TabInfo tab) { List<Content> gridContents = ((GridImpl)tab.getComponent()).getContents(); return gridContents.size() > 0 && gridContents.get(0).isCloseable(); }
|
isClosable
|
290,052
|
void (@NotNull TabInfo tab) { GridImpl grid = (GridImpl)tab.getComponent(); ViewContext context = ViewContext.CONTEXT_KEY.getData(grid); Content[] content = ViewContext.CONTENT_KEY.getData(grid); if (context == null || content == null || content.length == 0) { SingleContentSupplier.super.close(tab); return; } context.getContentManager().removeContent(content[0], context.isToDisposeRemovedContent()); }
|
close
|
290,053
|
void (@NotNull TabInfo tabInfo, @NotNull Content content) { myTabInfoContentMap.put(tabInfo, content); }
|
addSubContent
|
290,054
|
Collection<Content> () { return myTabInfoContentMap.values(); }
|
getSubContents
|
290,055
|
boolean () { return myMoveToolbar; }
|
isMoveToolbar
|
290,056
|
void (boolean moveToolbar) { myMoveToolbar = moveToolbar; }
|
setMoveToolbar
|
290,057
|
boolean () { return true; }
|
isDumbAware
|
290,058
|
ActionUpdateThread () { return ActionUpdateThread.BGT; }
|
getActionUpdateThread
|
290,059
|
ActionRemoteBehavior () { return ActionRemoteBehavior.BackendOnly; }
|
getBehavior
|
290,060
|
AnAction[] (DataContext dataContext, @Nullable String place) { if (dataContext.getData(ExecutorAction.getOrderKey()) != null) return EMPTY_ARRAY; final ConfigurationContext context = ConfigurationContext.getFromContext(dataContext, place); //!!! to rule??? if (!Registry.is("suggest.all.run.configurations.from.context") && findExisting(context) != null) { return EMPTY_ARRAY; } return createChildActions(context, getConfigurationsFromContext(context)).toArray(EMPTY_ARRAY); }
|
getChildren
|
290,061
|
List<AnAction> (@NotNull ConfigurationContext context, @NotNull List<? extends ConfigurationFromContext> configurations) { if (configurations.size() <= 1) { return Collections.emptyList(); } final List<AnAction> childActions = new ArrayList<>(); for (final ConfigurationFromContext fromContext : configurations) { final ConfigurationType configurationType = fromContext.getConfigurationType(); final String actionName = childActionName(fromContext); //noinspection DialogTitleCapitalization final AnAction anAction = new AnAction(actionName, configurationType.getDisplayName(), fromContext.getConfiguration().getIcon()) { @Override public void actionPerformed(@NotNull AnActionEvent e) { perform(fromContext, ConfigurationContext.getFromContext(e.getDataContext(), e.getPlace())); } }; anAction.getTemplatePresentation().setText(actionName, false); childActions.add(anAction); } return childActions; }
|
createChildActions
|
290,062
|
void (@NotNull AnActionEvent e) { perform(fromContext, ConfigurationContext.getFromContext(e.getDataContext(), e.getPlace())); }
|
actionPerformed
|
290,063
|
List<ConfigurationFromContext> (ConfigurationContext context) { final List<ConfigurationFromContext> fromContext = context.getConfigurationsFromContext(); if (fromContext == null) { return Collections.emptyList(); } final List<ConfigurationFromContext> enabledConfigurations = new ArrayList<>(); for (ConfigurationFromContext configurationFromContext : fromContext) { if (isEnabledFor(configurationFromContext.getConfiguration(), context)) { enabledConfigurations.add(configurationFromContext); } } return enabledConfigurations; }
|
getConfigurationsFromContext
|
290,064
|
boolean (RunConfiguration configuration) { return true; }
|
isEnabledFor
|
290,065
|
boolean (RunConfiguration configuration, ConfigurationContext context) { return isEnabledFor(configuration); }
|
isEnabledFor
|
290,066
|
void (final @NotNull AnActionEvent e) { final DataContext dataContext = e.getDataContext(); final ConfigurationContext context = ConfigurationContext.getFromContext(dataContext, e.getPlace()); final RunnerAndConfigurationSettings existing = findExisting(context); if (existing == null || dataContext.getData(ExecutorAction.getOrderKey()) != null) { final List<ConfigurationFromContext> producers = getConfigurationsFromContext(context); if (producers.isEmpty()) return; perform(getOrderedConfiguration(dataContext, producers), context); return; } if (LOG.isDebugEnabled()) { String configurationClass = existing.getConfiguration().getClass().getName(); LOG.debug(String.format("Use existing run configuration: %s", configurationClass)); } perform(context); }
|
actionPerformed
|
290,067
|
ConfigurationFromContext (DataContext dataContext, List<? extends ConfigurationFromContext> producers) { Integer order = dataContext.getData(ExecutorAction.getOrderKey()); if (order != null && order < producers.size()) { return producers.get(order); } return producers.get(0); }
|
getOrderedConfiguration
|
290,068
|
void (final ConfigurationFromContext configurationFromContext, final ConfigurationContext context) { int eventCount = IdeEventQueue.getInstance().getEventCount(); RunnerAndConfigurationSettings configurationSettings = configurationFromContext.getConfigurationSettings(); context.setConfiguration(configurationSettings); configurationFromContext.onFirstRun(context, () -> { if (LOG.isDebugEnabled()) { RunnerAndConfigurationSettings settings = context.getConfiguration(); RunConfiguration configuration = settings == null ? null : settings.getConfiguration(); String configurationClass = configuration == null ? null : configuration.getClass().getName(); LOG.debug(String.format("Create run configuration: %s", configurationClass)); } // Reset event counter if some UI was shown as // stated in `ConfigurationFromContext.onFirstRun` javadoc. // Can be removed if pre-cached context is used in ConfigurationFromContext. if (!Utils.isAsyncDataContext(context.getDataContext()) && eventCount != IdeEventQueue.getInstance().getEventCount()) { IdeEventQueue.getInstance().setEventCount(eventCount); } perform(configurationSettings, context); }); }
|
perform
|
290,069
|
void (RunnerAndConfigurationSettings configurationSettings, ConfigurationContext context) { perform(context); }
|
perform
|
290,070
|
void (@NotNull AnActionEvent e) { fullUpdate(e); }
|
beforeActionPerformedUpdate
|
290,071
|
void (final @NotNull AnActionEvent event) { boolean doFullUpdate = !ApplicationManager.getApplication().isDispatchThread() || ApplicationManager.getApplication().isUnitTestMode(); VirtualFile vFile = event.getDataContext().getData(CommonDataKeys.VIRTUAL_FILE); ThreeState hadAnythingRunnable = vFile == null ? ThreeState.UNSURE : RunLineMarkerProvider.hadAnythingRunnable(vFile); if (doFullUpdate || hadAnythingRunnable == ThreeState.UNSURE) { fullUpdate(event); return; } boolean success = !alreadyExceededTimeoutOnSimilarAction() && ProgressIndicatorUtils.withTimeout(Registry.intValue("run.configuration.update.timeout"), () -> { fullUpdate(event); return true; }) != null; if (!success) { recordUpdateTimeout(); approximatePresentationByPreviousAvailability(event, hadAnythingRunnable); event.getPresentation().setPerformGroup(false); } }
|
update
|
290,072
|
boolean () { return Objects.equals(IdeEventQueue.getInstance().getEventCount(), ourLastTimeoutStamp); }
|
alreadyExceededTimeoutOnSimilarAction
|
290,073
|
void () { ourLastTimeoutStamp = IdeEventQueue.getInstance().getEventCount(); }
|
recordUpdateTimeout
|
290,074
|
void (AnActionEvent event, ThreeState hadAnythingRunnable) { event.getPresentation().copyFrom(getTemplatePresentation()); event.getPresentation().setEnabledAndVisible(hadAnythingRunnable == ThreeState.YES); }
|
approximatePresentationByPreviousAvailability
|
290,075
|
void (@NotNull AnActionEvent event) { DataContext dataContext = event.getDataContext(); ConfigurationContext context = ConfigurationContext.getFromEvent(event); Presentation presentation = event.getPresentation(); RunnerAndConfigurationSettings existing = findExisting(context); RunnerAndConfigurationSettings configuration = existing; if (configuration == null) { configuration = context.getConfiguration(); } if (configuration == null){ presentation.setEnabledAndVisible(false); presentation.setPerformGroup(false); } else{ isDumbAware = configuration.getType().isDumbAware(); presentation.setEnabledAndVisible(true); VirtualFile vFile = dataContext.getData(CommonDataKeys.VIRTUAL_FILE); if (vFile != null) { RunLineMarkerProvider.markRunnable(vFile, true); } final List<ConfigurationFromContext> fromContext = getConfigurationsFromContext(context); if (existing == null && fromContext.isEmpty()) { presentation.setEnabledAndVisible(false); presentation.setPerformGroup(false); return; } if ((existing == null || dataContext.getData(ExecutorAction.getOrderKey()) != null) && !fromContext.isEmpty()) { ConfigurationFromContext configurationFromContext = getOrderedConfiguration(dataContext, fromContext); configuration = configurationFromContext.getConfigurationSettings(); context.setConfiguration(configurationFromContext.getConfigurationSettings()); } final String name = suggestRunActionName(configuration.getConfiguration()); boolean performGroup = existing != null || fromContext.size() <= 1 || dataContext.getData(ExecutorAction.getOrderKey()) != null; updatePresentation(presentation, performGroup ? name : "", context); presentation.setPerformGroup(performGroup); } }
|
fullUpdate
|
290,076
|
boolean () { return isDumbAware; }
|
isDumbAware
|
290,077
|
String (@NotNull LocatableConfiguration configuration) { return suggestRunActionName((RunConfiguration)configuration); }
|
suggestRunActionName
|
290,078
|
Executor () { return super.getAlternativeExecutor(); }
|
getDefaultExecutor
|
290,079
|
Executor () { return super.getDefaultExecutor(); }
|
getAlternativeExecutor
|
290,080
|
String () { return "debug.configuration.alternate.action.ad"; }
|
getAdKey
|
290,081
|
ActionUpdateThread () { return ActionUpdateThread.BGT; }
|
getActionUpdateThread
|
290,082
|
void (@NotNull AnActionEvent e) { RunContentDescriptor descriptor = StopAction.getRecentlyStartedContentDescriptor(e.getDataContext()); boolean isConsoleSelected = descriptor != null && isConsoleSelected(descriptor); ProcessHandler handler = descriptor != null ? descriptor.getProcessHandler() : null; e.getPresentation().setEnabledAndVisible(isConsoleSelected && handler != null && !handler.isProcessTerminated()); }
|
update
|
290,083
|
boolean (@NotNull RunContentDescriptor descriptor) { RunnerLayoutUi runnerLayoutUi = descriptor.getRunnerLayoutUi(); if (runnerLayoutUi == null) return false; ContentManager contentManager = runnerLayoutUi.getContentManager(); Content selectedContent = contentManager.getSelectedContent(); return selectedContent != null && ExecutionConsole.CONSOLE_CONTENT_ID.equals(selectedContent.getUserData(ViewImpl.ID)); }
|
isConsoleSelected
|
290,084
|
void (@NotNull AnActionEvent e) { RunContentDescriptor descriptor = StopAction.getRecentlyStartedContentDescriptor(e.getDataContext()); ProcessHandler activeProcessHandler = descriptor != null ? descriptor.getProcessHandler() : null; if (activeProcessHandler == null || activeProcessHandler.isProcessTerminated()) return; ConsoleView console = e.getData(LangDataKeys.CONSOLE_VIEW); if (console instanceof TerminalExecutionConsole) { sendEOFToPtyProcess(activeProcessHandler.getProcessInput()); return; } try (OutputStream input = activeProcessHandler.getProcessInput()) { if (input != null) { if (console != null) { console.print("^D\n", ConsoleViewContentType.SYSTEM_OUTPUT); } } } catch (IOException ignored) { } }
|
actionPerformed
|
290,085
|
void (OutputStream outputStream) { if (outputStream != null) { try { outputStream.write(Ascii.EOT); outputStream.flush(); } catch (IOException ignored) { } } }
|
sendEOFToPtyProcess
|
290,086
|
ActionUpdateThread () { return ActionUpdateThread.BGT; }
|
getActionUpdateThread
|
290,087
|
void (@NotNull AnActionEvent e) { e.getPresentation().setEnabled(!getCancellableProcesses(e.getProject()).isEmpty()); }
|
update
|
290,088
|
void (@NotNull AnActionEvent e) { final DataContext dataContext = e.getDataContext(); Project project = e.getProject(); List<StopAction.HandlerItem> handlerItems = getItemsList(getCancellableProcesses(project)); if (handlerItems.isEmpty()) { return; } final JBList<StopAction.HandlerItem> list = new JBList<>(handlerItems); list.setCellRenderer(new GroupedItemsListRenderer<>(new ListItemDescriptorAdapter<>() { @Override public @Nullable String getTextFor(StopAction.HandlerItem item) { return item.displayName; } @Override public @Nullable Icon getIconFor(StopAction.HandlerItem item) { return item.icon; } @Override public boolean hasSeparatorAboveOf(StopAction.HandlerItem item) { return item.hasSeparator; } })); JBPopup popup = JBPopupFactory.getInstance().createListPopupBuilder(list) .setMovable(true) .setTitle(handlerItems.size() == 1 ? ExecutionBundle.message("confirm.background.process.stop") : ExecutionBundle.message("stop.background.process")) .setNamerForFiltering(o -> o.displayName) .setItemChosenCallback(() -> { List valuesList = list.getSelectedValuesList(); for (Object o : valuesList) { if (o instanceof StopAction.HandlerItem) ((StopAction.HandlerItem)o).stop(); } }) .setRequestFocus(true) .createPopup(); 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()))) { popup.showUnderneathOf(component); } else if (project == null) { popup.showInBestPositionFor(dataContext); } else { popup.showCenteredInCurrentWindow(project); } }
|
actionPerformed
|
290,089
|
boolean (StopAction.HandlerItem item) { return item.hasSeparator; }
|
hasSeparatorAboveOf
|
290,090
|
ActionUpdateThread () { return ActionUpdateThread.EDT; }
|
getActionUpdateThread
|
290,091
|
void (@NotNull AnActionEvent e) { ConsoleView data = e.getData(LangDataKeys.CONSOLE_VIEW); boolean enabled = data != null && data.getContentSize() > 0; e.getPresentation().setEnabled(enabled); }
|
update
|
290,092
|
void (final @NotNull AnActionEvent e) { final ConsoleView consoleView = e.getData(LangDataKeys.CONSOLE_VIEW); if (consoleView != null) { consoleView.clear(); } }
|
actionPerformed
|
290,093
|
void (final ConfigurationContext context) { RunnerAndConfigurationSettings configuration = context.findExisting(); if (configuration == null) { configuration = context.getConfiguration(); } choosePolicy(context).perform(configuration, context); }
|
perform
|
290,094
|
void (RunnerAndConfigurationSettings configurationSettings, ConfigurationContext context) { choosePolicy(context).perform(configurationSettings, context); }
|
perform
|
290,095
|
void (final Presentation presentation, final @NotNull String actionText, final ConfigurationContext context) { choosePolicy(context).update(presentation, context, actionText); }
|
updatePresentation
|
290,096
|
BaseCreatePolicy (final ConfigurationContext context) { final RunnerAndConfigurationSettings configuration = findExisting(context); if (configuration == null) { return Holder.CREATE_AND_EDIT; } if (configuration.getConfiguration() instanceof SyntheticRunConfigurationBase) { return Holder.DISABLED; } return Holder.EDIT; }
|
choosePolicy
|
290,097
|
void (final Presentation presentation, final ConfigurationContext context, final @NotNull String actionText) { updateText(presentation, actionText); }
|
update
|
290,098
|
void (final Presentation presentation, final String actionText) { presentation.setText(ExecutionBundle.message("create.run.configuration.action.name"), false); }
|
updateText
|
290,099
|
void (RunnerAndConfigurationSettings configuration, ConfigurationContext context) { if (ApplicationManager.getApplication().isUnitTestMode() || RunDialog.editConfiguration(context.getProject(), configuration, ExecutionBundle.message("create.run.configuration.for.item.dialog.title", configuration.getName()))) { final RunManagerImpl runManager = (RunManagerImpl)context.getRunManager(); runManager.addConfiguration(configuration); runManager.setSelectedConfiguration(configuration); RunConfigurationOptionUsagesCollector.logAddNew(context.getProject(), configuration.getType().getId(), context.getPlace()); } }
|
perform
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.