本文整理汇总了Java中com.intellij.execution.executors.DefaultDebugExecutor类的典型用法代码示例。如果您正苦于以下问题:Java DefaultDebugExecutor类的具体用法?Java DefaultDebugExecutor怎么用?Java DefaultDebugExecutor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DefaultDebugExecutor类属于com.intellij.execution.executors包,在下文中一共展示了DefaultDebugExecutor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: hyperlinkActivated
import com.intellij.execution.executors.DefaultDebugExecutor; //导入依赖的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: createContentDescriptor
import com.intellij.execution.executors.DefaultDebugExecutor; //导入依赖的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);
}
}
示例3: attachVM
import com.intellij.execution.executors.DefaultDebugExecutor; //导入依赖的package包/类
protected DebuggerSession attachVM(final RemoteConnection remoteConnection, final boolean pollConnection)
throws InvocationTargetException, InterruptedException {
final RemoteState remoteState = new RemoteStateState(myProject, remoteConnection);
final DebuggerSession[] debuggerSession = new DebuggerSession[1];
UIUtil.invokeAndWaitIfNeeded(new Runnable() {
@Override
public void run() {
try {
debuggerSession[0] = attachVirtualMachine(remoteState, new ExecutionEnvironmentBuilder(myProject, DefaultDebugExecutor.getDebugExecutorInstance())
.runProfile(new MockConfiguration())
.build(), remoteConnection, pollConnection);
}
catch (ExecutionException e) {
fail(e.getMessage());
}
}
});
debuggerSession[0].getProcess().getProcessHandler().addProcessListener(new ProcessAdapter() {
@Override
public void onTextAvailable(ProcessEvent event, Key outputType) {
print(event.getText(), outputType);
}
});
return debuggerSession[0];
}
示例4: execute
import com.intellij.execution.executors.DefaultDebugExecutor; //导入依赖的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;
}
示例5: attachNotificationTo
import com.intellij.execution.executors.DefaultDebugExecutor; //导入依赖的package包/类
protected void attachNotificationTo(final Content content) {
if (myConsole instanceof ObservableConsoleView) {
ObservableConsoleView observable = (ObservableConsoleView)myConsole;
observable.addChangeListener(new ObservableConsoleView.ChangeListener() {
@Override
public void contentAdded(final Collection<ConsoleViewContentType> types) {
if (types.contains(ConsoleViewContentType.ERROR_OUTPUT) || types.contains(ConsoleViewContentType.NORMAL_OUTPUT)) {
content.fireAlert();
}
}
}, content);
RunProfile profile = getRunProfile();
if (profile instanceof RunConfigurationBase && !ApplicationManager.getApplication().isUnitTestMode()) {
observable.addChangeListener(new RunContentBuilder.ConsoleToFrontListener((RunConfigurationBase)profile,
myProject,
DefaultDebugExecutor.getDebugExecutorInstance(),
myRunContentDescriptor,
myUi),
content);
}
}
}
示例6: removeSession
import com.intellij.execution.executors.DefaultDebugExecutor; //导入依赖的package包/类
public void removeSession(@NotNull final XDebugSessionImpl session) {
XDebugSessionTab sessionTab = session.getSessionTab();
mySessions.remove(session.getDebugProcess().getProcessHandler());
if (sessionTab != null) {
RunContentDescriptor descriptor = sessionTab.getRunContentDescriptor();
if (descriptor != null) {
// in test-mode RunContentWithExecutorListener.contentRemoved events are not sent (see RunContentManagerImpl.showRunContent)
// so we make sure the mySessions and mySessionData are cleared correctly when session is disposed
Disposer.register(descriptor, new Disposable() {
@Override
public void dispose() {
mySessions.remove(session.getDebugProcess().getProcessHandler());
}
});
}
if (!myProject.isDisposed() && !ApplicationManager.getApplication().isUnitTestMode() && XDebuggerSettingsManager.getInstanceImpl().getGeneralSettings().isHideDebuggerOnProcessTermination()) {
ExecutionManager.getInstance(myProject).getContentManager().hideRunContent(DefaultDebugExecutor.getDebugExecutorInstance(), descriptor);
}
}
if (myActiveSession.compareAndSet(session, null)) {
onActiveSessionChanged();
}
}
示例7: patchProjectAreaExtensions
import com.intellij.execution.executors.DefaultDebugExecutor; //导入依赖的package包/类
private static void patchProjectAreaExtensions(@NotNull final Project project) {
Executor debugExecutor = DefaultDebugExecutor.getDebugExecutorInstance();
unregisterAction(debugExecutor.getId(), ExecutorRegistryImpl.RUNNERS_GROUP);
unregisterAction(debugExecutor.getContextActionId(), ExecutorRegistryImpl.RUN_CONTEXT_GROUP);
ExtensionsArea projectArea = Extensions.getArea(project);
for (SelectInTarget target : Extensions.getExtensions(SelectInTarget.EP_NAME, project)) {
if (ToolWindowId.FAVORITES_VIEW.equals(target.getToolWindowId()) ||
ToolWindowId.STRUCTURE_VIEW.equals(target.getToolWindowId())) {
projectArea.getExtensionPoint(SelectInTarget.EP_NAME).unregisterExtension(target);
}
}
for (AbstractProjectViewPane pane : Extensions.getExtensions(AbstractProjectViewPane.EP_NAME, project)) {
if (pane.getId().equals(ScopeViewPane.ID)) {
Disposer.dispose(pane);
projectArea.getExtensionPoint(AbstractProjectViewPane.EP_NAME).unregisterExtension(pane);
}
}
}
示例8: canRun
import com.intellij.execution.executors.DefaultDebugExecutor; //导入依赖的package包/类
@Override
public boolean canRun(@NotNull final String executorId, @NotNull final RunProfile profile) {
if (!DefaultDebugExecutor.EXECUTOR_ID.equals(executorId)) {
// If not debug at all
return false;
}
/**
* Any python configuration is debuggable unless it explicitly declares itself as DebugAwareConfiguration and denies it
* with canRunUnderDebug == false
*/
if (profile instanceof WrappingRunConfiguration) {
// If configuration is wrapper -- unwrap it and check
return isDebuggable(((WrappingRunConfiguration<?>)profile).getPeer());
}
return isDebuggable(profile);
}
示例9: canRun
import com.intellij.execution.executors.DefaultDebugExecutor; //导入依赖的package包/类
@Override
public boolean canRun(String executorId, RunProfile profile) {
BlazeAndroidRunConfigurationHandler handler =
BlazeAndroidRunConfigurationHandler.getHandlerFrom(profile);
if (handler == null) {
return false;
}
// In practice, the stock runner will probably handle all non-incremental-install configs.
if (DefaultDebugExecutor.EXECUTOR_ID.equals(executorId)
|| DefaultRunExecutor.EXECUTOR_ID.equals(executorId)) {
return true;
}
// Otherwise, the configuration must be a Blaze incremental install configuration running with
// an incremental install executor.
if (!(handler instanceof BlazeAndroidBinaryRunConfigurationHandler)) {
return false;
}
AndroidBinaryLaunchMethod launchMethod =
((BlazeAndroidBinaryRunConfigurationHandler) handler).getState().getLaunchMethod();
return (AndroidBinaryLaunchMethod.MOBILE_INSTALL.equals(launchMethod)
|| AndroidBinaryLaunchMethod.MOBILE_INSTALL_V2.equals(launchMethod))
&& (IncrementalInstallDebugExecutor.EXECUTOR_ID.equals(executorId)
|| IncrementalInstallRunExecutor.EXECUTOR_ID.equals(executorId));
}
示例10: closeOldSession
import com.intellij.execution.executors.DefaultDebugExecutor; //导入依赖的package包/类
/**
* Closes old session only for debug mode
*
* @param project
* @param parameters
*/
private void closeOldSession(final Project project, EmbeddedLinuxJVMRunConfigurationRunnerParameters parameters) {
final String configurationName = AppCommandLineState.getRunConfigurationName(parameters.getPort());
final Collection<RunContentDescriptor> descriptors =
ExecutionHelper.findRunningConsoleByTitle(project, configurationName::equals);
if (descriptors.size() > 0) {
final RunContentDescriptor descriptor = descriptors.iterator().next();
final ProcessHandler processHandler = descriptor.getProcessHandler();
final Content content = descriptor.getAttachedContent();
if (processHandler != null && content != null) {
final Executor executor = DefaultDebugExecutor.getDebugExecutorInstance();
if (processHandler.isProcessTerminated()) {
ExecutionManager.getInstance(project).getContentManager()
.removeRunContent(executor, descriptor);
} else {
content.getManager().setSelectedContent(content);
ToolWindow window = ToolWindowManager.getInstance(project).getToolWindow(executor.getToolWindowId());
window.activate(null, false, true);
}
}
}
}
示例11: getState
import com.intellij.execution.executors.DefaultDebugExecutor; //导入依赖的package包/类
@Override
public RunProfileState getState(@NotNull Executor executor, final @NotNull ExecutionEnvironment env) throws ExecutionException {
if (DefaultDebugExecutor.EXECUTOR_ID.equals(executor.getId())) {
List<String> goals = null;
if (RunType.Test.equals(runType)) {
RunnerAndConfigurationSettings settings = env.getRunnerAndConfigurationSettings();
if (settings != null && settings.getConfiguration() instanceof MvnRunConfiguration) {
goals = disableFork(((MvnRunConfiguration) settings.getConfiguration()).getGoals());
}
}
if ((RunType.Jetty.equals(runType) || RunType.Tomcat.equals(runType)) || goals != null) {
return new DebugServerCommandLineState(env, this, goals);
}
}
return super.getState(executor, env);
}
示例12: attachNotificationTo
import com.intellij.execution.executors.DefaultDebugExecutor; //导入依赖的package包/类
protected void attachNotificationTo(final Content content) {
if (myConsole instanceof ObservableConsoleView) {
ObservableConsoleView observable = (ObservableConsoleView)myConsole;
observable.addChangeListener(new ObservableConsoleView.ChangeListener() {
@Override
public void contentAdded(final Collection<ConsoleViewContentType> types) {
if (types.contains(ConsoleViewContentType.ERROR_OUTPUT) || types.contains(ConsoleViewContentType.NORMAL_OUTPUT)) {
content.fireAlert();
}
}
}, content);
RunProfile profile = getRunProfile();
if (profile instanceof RunConfigurationBase && !ApplicationManager.getApplication().isUnitTestMode()) {
final RunConfigurationBase runConfigurationBase = (RunConfigurationBase)profile;
observable.addChangeListener(new RunContentBuilder.ConsoleToFrontListener(runConfigurationBase,
getProject(),
DefaultDebugExecutor.getDebugExecutorInstance(),
myRunContentDescriptor,
getUi()),
content);
}
}
}
示例13: createContentDescriptor
import com.intellij.execution.executors.DefaultDebugExecutor; //导入依赖的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);
}
}
示例14: attachNotificationTo
import com.intellij.execution.executors.DefaultDebugExecutor; //导入依赖的package包/类
protected void attachNotificationTo(final Content content) {
if (myConsole instanceof ObservableConsoleView) {
ObservableConsoleView observable = (ObservableConsoleView)myConsole;
observable.addChangeListener(types -> {
if (types.contains(ConsoleViewContentType.ERROR_OUTPUT) || types.contains(ConsoleViewContentType.NORMAL_OUTPUT)) {
content.fireAlert();
}
}, content);
RunProfile profile = getRunProfile();
if (profile instanceof RunConfigurationBase && !ApplicationManager.getApplication().isUnitTestMode()) {
observable.addChangeListener(
new RunContentBuilder.ConsoleToFrontListener((RunConfigurationBase)profile, myProject, DefaultDebugExecutor.getDebugExecutorInstance(),
myRunContentDescriptor, myUi), content);
}
}
}
示例15: hyperlinkActivated
import com.intellij.execution.executors.DefaultDebugExecutor; //导入依赖的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);
}
}
}