mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
cleanup
GitOrigin-RevId: 156dd6f810acbf885860bcc28acbd455bc791eab
This commit is contained in:
committed by
intellij-monorepo-bot
parent
0f9af1cf11
commit
af7464a887
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.execution;
|
||||
|
||||
import com.intellij.execution.configurations.RunConfiguration;
|
||||
@@ -60,7 +60,6 @@ public abstract class BeforeRunTaskProvider<T extends BeforeRunTask> {
|
||||
* @return {@code true} a promise returning true, if the task was changed
|
||||
*/
|
||||
public Promise<Boolean> configureTask(@NotNull DataContext context, @NotNull RunConfiguration configuration, @NotNull T task) {
|
||||
//noinspection deprecation
|
||||
return Promises.resolvedPromise(configureTask(configuration, task));
|
||||
}
|
||||
|
||||
|
||||
@@ -42,10 +42,10 @@ public final class ExecutorRegistryImpl extends ExecutorRegistry implements Disp
|
||||
public static final String RUN_CONTEXT_GROUP = "RunContextGroupInner";
|
||||
|
||||
private List<Executor> myExecutors = new ArrayList<>();
|
||||
private final Map<String, Executor> myId2Executor = new THashMap<>();
|
||||
private final Map<String, Executor> myIdToExecutor = new THashMap<>();
|
||||
private final Set<String> myContextActionIdSet = new THashSet<>();
|
||||
private final Map<String, AnAction> myId2Action = new THashMap<>();
|
||||
private final Map<String, AnAction> myContextActionId2Action = new THashMap<>();
|
||||
private final Map<String, AnAction> myIdToAction = new THashMap<>();
|
||||
private final Map<String, AnAction> myContextActionIdToAction = new THashMap<>();
|
||||
|
||||
// [Project, ExecutorId, RunnerId]
|
||||
private final Set<Trinity<Project, String, String>> myInProgress = Collections.synchronizedSet(new THashSet<>());
|
||||
@@ -55,7 +55,7 @@ public final class ExecutorRegistryImpl extends ExecutorRegistry implements Disp
|
||||
}
|
||||
|
||||
synchronized void initExecutor(@NotNull Executor executor) {
|
||||
if (myId2Executor.get(executor.getId()) != null) {
|
||||
if (myIdToExecutor.get(executor.getId()) != null) {
|
||||
LOG.error("Executor with id: \"" + executor.getId() + "\" was already registered!");
|
||||
}
|
||||
|
||||
@@ -66,25 +66,25 @@ public final class ExecutorRegistryImpl extends ExecutorRegistry implements Disp
|
||||
final AnAction toolbarAction;
|
||||
final AnAction runContextAction;
|
||||
if (executor instanceof ExecutorGroup) {
|
||||
final ActionGroup toolbarActionGroup = new ExecutorGroupActionGroup((ExecutorGroup)executor, ExecutorAction::new);
|
||||
final ActionGroup toolbarActionGroup = new ExecutorGroupActionGroup((ExecutorGroup<?>)executor, ExecutorAction::new);
|
||||
toolbarActionGroup.setPopup(true);
|
||||
final Presentation presentation = toolbarActionGroup.getTemplatePresentation();
|
||||
presentation.setIcon(executor.getIcon());
|
||||
presentation.setText(executor.getStartActionText());
|
||||
presentation.setDescription(executor.getDescription());
|
||||
toolbarAction = toolbarActionGroup;
|
||||
runContextAction = new ExecutorGroupActionGroup((ExecutorGroup)executor, RunContextAction::new);
|
||||
runContextAction = new ExecutorGroupActionGroup((ExecutorGroup<?>)executor, RunContextAction::new);
|
||||
}
|
||||
else {
|
||||
toolbarAction = new ExecutorAction(executor);
|
||||
runContextAction = new RunContextAction(executor);
|
||||
}
|
||||
final Executor.ActionWrapper customizer = executor.runnerActionsGroupExecutorActionCustomizer();
|
||||
registerAction(executor.getId(), customizer != null ? customizer.wrap(toolbarAction) : toolbarAction, RUNNERS_GROUP, myId2Action);
|
||||
registerAction(executor.getContextActionId(), runContextAction, RUN_CONTEXT_GROUP, myContextActionId2Action);
|
||||
registerAction(executor.getId(), customizer != null ? customizer.wrap(toolbarAction) : toolbarAction, RUNNERS_GROUP, myIdToAction);
|
||||
registerAction(executor.getContextActionId(), runContextAction, RUN_CONTEXT_GROUP, myContextActionIdToAction);
|
||||
|
||||
myExecutors.add(executor);
|
||||
myId2Executor.put(executor.getId(), executor);
|
||||
myIdToExecutor.put(executor.getId(), executor);
|
||||
myContextActionIdSet.add(executor.getContextActionId());
|
||||
}
|
||||
|
||||
@@ -102,11 +102,11 @@ public final class ExecutorRegistryImpl extends ExecutorRegistry implements Disp
|
||||
|
||||
synchronized void deinitExecutor(@NotNull Executor executor) {
|
||||
myExecutors.remove(executor);
|
||||
myId2Executor.remove(executor.getId());
|
||||
myIdToExecutor.remove(executor.getId());
|
||||
myContextActionIdSet.remove(executor.getContextActionId());
|
||||
|
||||
unregisterAction(executor.getId(), RUNNERS_GROUP, myId2Action);
|
||||
unregisterAction(executor.getContextActionId(), RUN_CONTEXT_GROUP, myContextActionId2Action);
|
||||
unregisterAction(executor.getId(), RUNNERS_GROUP, myIdToAction);
|
||||
unregisterAction(executor.getContextActionId(), RUN_CONTEXT_GROUP, myContextActionIdToAction);
|
||||
}
|
||||
|
||||
private static void unregisterAction(@NotNull String actionId, @NotNull String groupId, @NotNull Map<String, AnAction> map) {
|
||||
@@ -130,7 +130,7 @@ public final class ExecutorRegistryImpl extends ExecutorRegistry implements Disp
|
||||
|
||||
@Override
|
||||
public Executor getExecutorById(final String executorId) {
|
||||
return myId2Executor.get(executorId);
|
||||
return myIdToExecutor.get(executorId);
|
||||
}
|
||||
|
||||
private void init() {
|
||||
@@ -225,7 +225,7 @@ public final class ExecutorRegistryImpl extends ExecutorRegistry implements Disp
|
||||
return false;
|
||||
}
|
||||
}
|
||||
final ProgramRunner runner = ProgramRunner.getRunner(myExecutor.getId(), configuration);
|
||||
ProgramRunner<?> runner = ProgramRunner.getRunner(myExecutor.getId(), configuration);
|
||||
if (runner == null
|
||||
|| !ExecutionTargetManager.canRun(configuration, pair.getTarget())
|
||||
|| isStarting(project, myExecutor.getId(), runner.getRunnerId())) {
|
||||
@@ -365,7 +365,7 @@ public final class ExecutorRegistryImpl extends ExecutorRegistry implements Disp
|
||||
private final ExecutorGroup<?> myExecutorGroup;
|
||||
private final Function<? super Executor, ? extends AnAction> myChildConverter;
|
||||
|
||||
private ExecutorGroupActionGroup(ExecutorGroup executorGroup, Function<? super Executor, ? extends AnAction> childConverter) {
|
||||
private ExecutorGroupActionGroup(ExecutorGroup<?> executorGroup, Function<? super Executor, ? extends AnAction> childConverter) {
|
||||
myExecutorGroup = executorGroup;
|
||||
myChildConverter = childConverter;
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ public abstract class ExecutionManagerImpl extends ExecutionManager implements D
|
||||
@Nullable RunnerAndConfigurationSettings configuration) {
|
||||
ExecutionEnvironmentBuilder builder = new ExecutionEnvironmentBuilder(project, executor);
|
||||
|
||||
ProgramRunner runner = ProgramRunnerUtil.getRunner(executor.getId(), configuration);
|
||||
ProgramRunner<?> runner = ProgramRunnerUtil.getRunner(executor.getId(), configuration);
|
||||
if (runner == null && configuration != null) {
|
||||
LOG.error("Cannot find runner for " + configuration.getName());
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.execution.impl
|
||||
|
||||
import com.intellij.execution.ExecutionManager
|
||||
@@ -150,7 +150,7 @@ private class ProcessExecutionListener(private val project: Project,
|
||||
|
||||
project.messageBus.syncPublisher(ExecutionManager.EXECUTION_TOPIC).processTerminated(executorId, environment, processHandler, event.exitCode)
|
||||
|
||||
SaveAndSyncHandler.getInstance()?.scheduleRefresh()
|
||||
SaveAndSyncHandler.getInstance().scheduleRefresh()
|
||||
}
|
||||
|
||||
override fun processWillTerminate(event: ProcessEvent, shouldNotBeUsed: Boolean) {
|
||||
|
||||
@@ -505,6 +505,7 @@ public final class TouchBarsManager {
|
||||
// System.out.println("ERROR: RunnersGroup for touchbar isn't a group");
|
||||
return;
|
||||
}
|
||||
|
||||
final ActionGroup g = (ActionGroup)runButtons;
|
||||
for (Executor exec: ExecutorRegistry.getInstance().getRegisteredExecutors()) {
|
||||
if (exec != null && (exec.getId().equals(ToolWindowId.RUN) || exec.getId().equals(ToolWindowId.DEBUG))) {
|
||||
|
||||
Reference in New Issue
Block a user