本文整理匯總了Java中com.intellij.debugger.DebugUIEnvironment類的典型用法代碼示例。如果您正苦於以下問題:Java DebugUIEnvironment類的具體用法?Java DebugUIEnvironment怎麽用?Java DebugUIEnvironment使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
DebugUIEnvironment類屬於com.intellij.debugger包,在下文中一共展示了DebugUIEnvironment類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: attachVirtualMachine
import com.intellij.debugger.DebugUIEnvironment; //導入依賴的package包/類
@Nullable
public RunContentDescriptor attachVirtualMachine(DebugUIEnvironment environment) throws ExecutionException {
final DebugEnvironment modelEnvironment = environment.getEnvironment();
final DebuggerSession debuggerSession = DebuggerManagerEx.getInstanceEx(myProject).attachVirtualMachine(modelEnvironment);
if (debuggerSession == null) {
return null;
}
final DebugProcessImpl debugProcess = debuggerSession.getProcess();
if (debugProcess.isDetached() || debugProcess.isDetaching()) {
debuggerSession.dispose();
return null;
}
if (modelEnvironment.isRemote()) {
// optimization: that way BatchEvaluator will not try to lookup the class file in remote VM
// which is an expensive operation when executed first time
debugProcess.putUserData(BatchEvaluator.REMOTE_SESSION_KEY, Boolean.TRUE);
}
XDebugSession debugSession =
XDebuggerManager.getInstance(myProject).startSessionAndShowTab(modelEnvironment.getSessionName(), environment.getReuseContent(), new XDebugProcessStarter() {
@Override
@NotNull
public XDebugProcess start(@NotNull XDebugSession session) {
return JavaDebugProcess.create(session, debuggerSession);
}
});
return debugSession.getRunContentDescriptor();
}
示例2: startDebugSession
import com.intellij.debugger.DebugUIEnvironment; //導入依賴的package包/類
@Override
public void startDebugSession(@NotNull JavaDebugConnectionData info, @NotNull ExecutionEnvironment executionEnvironment, @NotNull RemoteServer<?> server)
throws ExecutionException {
final Project project = executionEnvironment.getProject();
final DebuggerPanelsManager manager = DebuggerPanelsManager.getInstance(project);
final JavaDebugServerModeHandler serverModeHandler = info.getServerModeHandler();
boolean serverMode = serverModeHandler != null;
final RemoteConnection remoteConnection = new RemoteConnection(true, info.getHost(), String.valueOf(info.getPort()), serverMode);
DebugEnvironment debugEnvironment = new RemoteServerDebugEnvironment(project, remoteConnection, executionEnvironment.getRunProfile());
DebugUIEnvironment debugUIEnvironment = new RemoteServerDebugUIEnvironment(debugEnvironment, executionEnvironment);
RunContentDescriptor debugContentDescriptor = manager.attachVirtualMachine(debugUIEnvironment);
LOG.assertTrue(debugContentDescriptor != null);
ProcessHandler processHandler = debugContentDescriptor.getProcessHandler();
LOG.assertTrue(processHandler != null);
if (serverMode) {
serverModeHandler.attachRemote();
DebuggerManager.getInstance(executionEnvironment.getProject())
.addDebugProcessListener(processHandler, new DebugProcessAdapter() {
public void processDetached(DebugProcess process, boolean closedByUser) {
try {
serverModeHandler.detachRemote();
}
catch (ExecutionException e) {
LOG.info(e);
}
}
});
}
}
示例3: attachVirtualMachine
import com.intellij.debugger.DebugUIEnvironment; //導入依賴的package包/類
@Nullable
public RunContentDescriptor attachVirtualMachine(DebugUIEnvironment environment) throws ExecutionException
{
final DebugEnvironment modelEnvironment = environment.getEnvironment();
final DebuggerSession debuggerSession = DebuggerManagerEx.getInstanceEx(myProject).attachVirtualMachine(modelEnvironment);
if(debuggerSession == null)
{
return null;
}
final DebugProcessImpl debugProcess = debuggerSession.getProcess();
if(debugProcess.isDetached() || debugProcess.isDetaching())
{
debuggerSession.dispose();
return null;
}
if(modelEnvironment.isRemote())
{
// optimization: that way BatchEvaluator will not try to lookup the class file in remote VM
// which is an expensive operation when executed first time
debugProcess.putUserData(BatchEvaluator.REMOTE_SESSION_KEY, Boolean.TRUE);
}
XDebugSession debugSession = XDebuggerManager.getInstance(myProject).startSessionAndShowTab(modelEnvironment.getSessionName(), environment.getReuseContent(), new XDebugProcessStarter()
{
@Override
@NotNull
public XDebugProcess start(@NotNull XDebugSession session)
{
return JavaDebugProcess.create(session, debuggerSession);
}
});
return debugSession.getRunContentDescriptor();
}