本文整理汇总了Java中com.intellij.execution.Executor类的典型用法代码示例。如果您正苦于以下问题:Java Executor类的具体用法?Java Executor怎么用?Java Executor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Executor类属于com.intellij.execution包,在下文中一共展示了Executor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: hyperlinkActivated
import com.intellij.execution.Executor; //导入依赖的package包/类
@Override
protected void hyperlinkActivated(HyperlinkEvent e) {
final Module moduleByName = ModuleManager.getInstance(myProject).findModuleByName(e.getDescription());
if (moduleByName != null) {
myConfiguration.getConfigurationModule().setModule(moduleByName);
try {
Executor executor = myIsDebug ? DefaultDebugExecutor.getDebugExecutorInstance()
: DefaultRunExecutor.getRunExecutorInstance();
ExecutionEnvironmentBuilder.create(myProject, executor, myConfiguration).contentToReuse(null).buildAndExecute();
Balloon balloon = myToolWindowManager.getToolWindowBalloon(myTestRunDebugId);
if (balloon != null) {
balloon.hide();
}
}
catch (ExecutionException e1) {
LOG.error(e1);
}
}
}
示例2: showHelperProcessRunContent
import com.intellij.execution.Executor; //导入依赖的package包/类
public static final ConsoleView showHelperProcessRunContent(String header, OSProcessHandler runHandler, Project project, Executor defaultExecutor) {
ProcessTerminatedListener.attach(runHandler);
ConsoleViewImpl consoleView = new ConsoleViewImpl(project, true);
DefaultActionGroup toolbarActions = new DefaultActionGroup();
JPanel panel = new JPanel((LayoutManager) new BorderLayout());
panel.add((Component) consoleView.getComponent(), "Center");
ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar("unknown", (ActionGroup) toolbarActions, false);
toolbar.setTargetComponent(consoleView.getComponent());
panel.add((Component) toolbar.getComponent(), "West");
RunContentDescriptor runDescriptor = new RunContentDescriptor((ExecutionConsole) consoleView,
(ProcessHandler) runHandler, (JComponent) panel, header, AllIcons.RunConfigurations.Application);
AnAction[]
consoleActions = consoleView.createConsoleActions();
toolbarActions.addAll((AnAction[]) Arrays.copyOf(consoleActions, consoleActions.length));
toolbarActions.add((AnAction) new StopProcessAction("Stop process", "Stop process", (ProcessHandler) runHandler));
toolbarActions.add((AnAction) new CloseAction(defaultExecutor, runDescriptor, project));
consoleView.attachToProcess((ProcessHandler) runHandler);
// ExecutionManager.getInstance(environment.getProject()).getContentManager().showRunContent(environment.getExecutor(), runDescriptor);
showConsole(project, defaultExecutor, runDescriptor);
return (ConsoleView) consoleView;
}
示例3: createRunner
import com.intellij.execution.Executor; //导入依赖的package包/类
@Override
public BlazeCommandRunConfigurationRunner createRunner(
Executor executor, ExecutionEnvironment environment) throws ExecutionException {
Project project = environment.getProject();
Module module = getModule();
AndroidFacet facet = module != null ? AndroidFacet.getInstance(module) : null;
ProjectViewSet projectViewSet = ProjectViewManager.getInstance(project).getProjectViewSet();
BlazeAndroidRunConfigurationValidationUtil.validateExecution(module, facet, projectViewSet);
ImmutableList<String> blazeFlags =
configState
.getCommonState()
.getExpandedBuildFlags(project, projectViewSet, BlazeCommandName.TEST);
ImmutableList<String> exeFlags =
ImmutableList.copyOf(configState.getCommonState().getExeFlagsState().getExpandedFlags());
BlazeAndroidRunContext runContext =
createRunContext(project, facet, environment, blazeFlags, exeFlags);
return new BlazeAndroidRunConfigurationRunner(
module,
runContext,
getCommonState().getDeployTargetManager(),
getCommonState().getDebuggerManager(),
configuration.getUniqueID());
}
示例4: getCurrentCoverageSuite
import com.intellij.execution.Executor; //导入依赖的package包/类
@Nullable
private CoverageSuitesBundle getCurrentCoverageSuite() {
if (myModel == null) {
return null;
}
final RunProfile runConf = myModel.getProperties().getConfiguration();
if (runConf instanceof ModuleBasedConfiguration) {
// if coverage supported for run configuration
if (CoverageEnabledConfiguration.isApplicableTo((ModuleBasedConfiguration) runConf)) {
// Get coverage settings
Executor executor = myProperties.getExecutor();
if (executor != null && executor.getId().equals(CoverageExecutor.EXECUTOR_ID)) {
return CoverageDataManager.getInstance(myProperties.getProject()).getCurrentSuitesBundle();
}
}
}
return null;
}
示例5: createContentDescriptor
import com.intellij.execution.Executor; //导入依赖的package包/类
@Override
@Nullable
protected RunContentDescriptor createContentDescriptor(RunProfileState state, ExecutionEnvironment env)
throws ExecutionException {
// Now we figure out if it the Debug button has been hit
Executor executor = env.getExecutor();
// If was the debug, then we do some extra magic
if (executor instanceof DefaultDebugExecutor) {
// Get hold of the JavaParameters
JavaCommandLine javaCommandLine = (JavaCommandLine) state;
JavaParameters javaParameters = javaCommandLine.getJavaParameters();
// Making the assumption that it's JVM 7 onwards
javaParameters.getVMParametersList().addParametersString(XDEBUG);
// Debugger port
String debuggerPort = DebuggerUtils.getInstance().findAvailableDebugAddress(true);
String remotePort = JDWP + debuggerPort;
javaParameters.getVMParametersList().addParametersString(remotePort);
// Creating a 'Remote' configuration on the fly
RemoteConnection connection = new RemoteConnection(true, LOCALHOST, debuggerPort, false);
// Attaches the remote configuration to the VM and then starts it up
return super.attachVirtualMachine(state, env, connection, true);
} else {
// If it was something else then we don't do anything special
return super.createContentDescriptor(state, env);
}
}
示例6: executeConfiguration
import com.intellij.execution.Executor; //导入依赖的package包/类
public void executeConfiguration(Project project, ModuleBasedConfiguration appCon) {
if (noProjectsAreOpen()) {
logger.warn("No open projects found, can't execute the project.");
return;
}
logger.info("Starting to build execution environment.");
RunManager runManager = RunManager.getInstance(project);
Executor executor = DefaultRunExecutor.getRunExecutorInstance();
RunnerAndConfigurationSettingsImpl selectedConfiguration =
getApplicationRunnerAndConfigurationSettings(runManager, appCon);
ProgramRunner runner = getRunner(executor, selectedConfiguration);
logger.info("Creating ExecutionEnvironment.");
ExecutionEnvironment environment =
new ExecutionEnvironment(
new DefaultRunExecutor(), runner, selectedConfiguration, project);
try {
logger.info("Executing project.");
runner.execute(environment);
} catch (ExecutionException e1) {
JavaExecutionUtil.showExecutionErrorMessage(e1, "Error", project);
}
}
示例7: getState
import com.intellij.execution.Executor; //导入依赖的package包/类
@Nullable
@Override
public RunProfileState getState(@NotNull Executor executor, @NotNull ExecutionEnvironment env) throws ExecutionException {
String serverName = getServerName();
if (serverName == null) {
throw new ExecutionException("Server is not specified");
}
RemoteServer<S> server = findServer();
if (server == null) {
throw new ExecutionException("Server '" + serverName + " not found");
}
if (myDeploymentSource == null) {
throw new ExecutionException("Deployment is not selected");
}
return new DeployToServerState(server, myDeploymentSource, myDeploymentConfiguration, env);
}
示例8: execute
import com.intellij.execution.Executor; //导入依赖的package包/类
@Nullable
@Override
public ExecutionResult execute(Executor executor, @NotNull ProgramRunner runner) throws ExecutionException {
final ServerConnection connection = ServerConnectionManager.getInstance().getOrCreateConnection(myServer);
final Project project = myEnvironment.getProject();
RemoteServersView.getInstance(project).showServerConnection(connection);
final DebugConnector<?,?> debugConnector;
if (DefaultDebugExecutor.getDebugExecutorInstance().equals(executor)) {
debugConnector = myServer.getType().createDebugConnector();
}
else {
debugConnector = null;
}
connection.deploy(new DeploymentTaskImpl(mySource, myConfiguration, project, debugConnector, myEnvironment),
new ParameterizedRunnable<String>() {
@Override
public void run(String s) {
RemoteServersView.getInstance(project).showDeployment(connection, s);
}
});
return null;
}
示例9: execute
import com.intellij.execution.Executor; //导入依赖的package包/类
@Override
public ExecutionResult execute(Executor executor, CommandLinePatcher... patchers) throws ExecutionException {
final ProcessHandler processHandler = startProcess(patchers);
final ConsoleView console = createAndAttachConsole(myConfiguration.getProject(), processHandler, executor);
List<AnAction> actions = Lists
.newArrayList(createActions(console, processHandler));
DefaultExecutionResult executionResult =
new DefaultExecutionResult(console, processHandler, actions.toArray(new AnAction[actions.size()]));
PyRerunFailedTestsAction rerunFailedTestsAction = new PyRerunFailedTestsAction(console);
if (console instanceof SMTRunnerConsoleView) {
rerunFailedTestsAction.init(((BaseTestsOutputConsoleView)console).getProperties());
rerunFailedTestsAction.setModelProvider(new Getter<TestFrameworkRunningModel>() {
@Override
public TestFrameworkRunningModel get() {
return ((SMTRunnerConsoleView)console).getResultsViewer();
}
});
}
executionResult.setRestartActions(rerunFailedTestsAction, new ToggleAutoTestAction());
return executionResult;
}
示例10: RemoteExternalSystemCommunicationManager
import com.intellij.execution.Executor; //导入依赖的package包/类
public RemoteExternalSystemCommunicationManager(@NotNull ExternalSystemProgressNotificationManager notificationManager) {
myProgressManager = (ExternalSystemProgressNotificationManagerImpl)notificationManager;
mySupport = new RemoteProcessSupport<Object, RemoteExternalSystemFacade, String>(RemoteExternalSystemFacade.class) {
@Override
protected void fireModificationCountChanged() {
}
@Override
protected String getName(Object o) {
return RemoteExternalSystemFacade.class.getName();
}
@Override
protected RunProfileState getRunProfileState(Object o, String configuration, Executor executor) throws ExecutionException {
return createRunProfileState(configuration);
}
};
ShutDownTracker.getInstance().registerShutdownTask(new Runnable() {
public void run() {
shutdown(false);
}
});
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:RemoteExternalSystemCommunicationManager.java
示例11: getState
import com.intellij.execution.Executor; //导入依赖的package包/类
@Nullable
@Override
public RunProfileState getState(@NotNull Executor executor, @NotNull ExecutionEnvironment env) throws ExecutionException {
final AbstractPythonRunConfiguration configuration = ((AbstractPythonRunConfiguration)getPeer());
// If configuration wants to take care about rerun itself
if (configuration instanceof TestRunConfigurationReRunResponsible) {
// TODO: Extract method
final Set<PsiElement> failedTestElements = new HashSet<PsiElement>();
for (final AbstractTestProxy proxy : getFailedTests(getProject())) {
final Location<?> location = proxy.getLocation(getProject(), GlobalSearchScope.allScope(getProject()));
if (location != null) {
failedTestElements.add(location.getPsiElement());
}
}
return ((TestRunConfigurationReRunResponsible)configuration).rerunTests(executor, env, failedTestElements);
}
return new FailedPythonTestCommandLineStateBase(configuration, env,
(PythonTestCommandLineStateBase)configuration.getState(executor, env));
}
示例12: getConsoleView
import com.intellij.execution.Executor; //导入依赖的package包/类
public static SMTRunnerConsoleView getConsoleView(
Project project,
BlazeCommandRunConfiguration configuration,
Executor executor,
BlazeTestUiSession testUiSession) {
SMTRunnerConsoleProperties properties =
new BlazeTestConsoleProperties(configuration, executor, testUiSession);
SMTRunnerConsoleView console =
(SMTRunnerConsoleView)
SMTestRunnerConnectionUtil.createConsole(BLAZE_FRAMEWORK, properties);
Disposer.register(project, console);
console
.getResultsViewer()
.getTreeView()
.getSelectionModel()
.setSelectionMode(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);
return console;
}
示例13: getActionName
import com.intellij.execution.Executor; //导入依赖的package包/类
private String getActionName(DataContext dataContext, @NotNull Executor executor) {
final ConfigurationContext context = ConfigurationContext.getFromContext(dataContext);
List<RunConfigurationProducer<?>> producers = RunConfigurationProducer.getProducers(context.getProject());
List<ConfigurationFromContext> list = ContainerUtil.mapNotNull(producers,
new Function<RunConfigurationProducer<?>, ConfigurationFromContext>() {
@Override
public ConfigurationFromContext fun(RunConfigurationProducer<?> producer) {
return createConfiguration(producer, context);
}
}
);
if (list.isEmpty()) return null;
ConfigurationFromContext configuration = list.get(myOrder < list.size() ? myOrder : 0);
String actionName = BaseRunConfigurationAction.suggestRunActionName((LocatableConfiguration)configuration.getConfiguration());
return executor.getStartActionText(actionName);
}
示例14: createConsoleView
import com.intellij.execution.Executor; //导入依赖的package包/类
@NotNull
private static RunContentDescriptor createConsoleView(@NotNull Project project, @NotNull PsiFile psiFile) {
ConsoleView consoleView = TextConsoleBuilderFactory.getInstance().createBuilder(project).getConsole();
DefaultActionGroup toolbarActions = new DefaultActionGroup();
JComponent panel = new JPanel(new BorderLayout());
panel.add(consoleView.getComponent(), BorderLayout.CENTER);
ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.UNKNOWN, toolbarActions, false);
toolbar.setTargetComponent(consoleView.getComponent());
panel.add(toolbar.getComponent(), BorderLayout.WEST);
final RunContentDescriptor descriptor = new RunContentDescriptor(consoleView, null, panel, psiFile.getName()) {
@Override
public boolean isContentReuseProhibited() {
return true;
}
};
Executor executor = DefaultRunExecutor.getRunExecutorInstance();
toolbarActions.addAll(consoleView.createConsoleActions());
toolbarActions.add(new CloseAction(executor, descriptor, project));
ExecutionManager.getInstance(project).getContentManager().showRunContent(executor, descriptor);
return descriptor;
}
示例15: execute
import com.intellij.execution.Executor; //导入依赖的package包/类
@Nullable
@Override
public ExecutionResult execute(Executor executor, @NotNull ProgramRunner runner) throws ExecutionException {
RunProfile profile = myEnvironment.getRunProfile();
if (profile instanceof AntRunConfiguration) {
AntRunConfiguration antRunConfiguration = (AntRunConfiguration)profile;
AntBuildTarget target = antRunConfiguration.getTarget();
if (target == null) return null;
ProcessHandler processHandler = ExecutionHandler
.executeRunConfiguration(antRunConfiguration, myEnvironment.getDataContext(), new ArrayList<BuildFileProperty>(),
new AntBuildListener() {
@Override
public void buildFinished(int state, int errorCount) {
}
});
if (processHandler == null) return null;
return new DefaultExecutionResult(null, processHandler);
}
return null;
}