當前位置: 首頁>>代碼示例>>Java>>正文


Java DebugUIEnvironment類代碼示例

本文整理匯總了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();
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:30,代碼來源:DebuggerPanelsManager.java

示例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);
          }
        }
      });
  }
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:30,代碼來源:JavaDebuggerLauncherImpl.java

示例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();
}
 
開發者ID:consulo,項目名稱:consulo-java,代碼行數:35,代碼來源:DebuggerPanelsManager.java


注:本文中的com.intellij.debugger.DebugUIEnvironment類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。