当前位置: 首页>>代码示例>>Java>>正文


Java DebuggerSession.isAttached方法代码示例

本文整理汇总了Java中com.intellij.debugger.impl.DebuggerSession.isAttached方法的典型用法代码示例。如果您正苦于以下问题:Java DebuggerSession.isAttached方法的具体用法?Java DebuggerSession.isAttached怎么用?Java DebuggerSession.isAttached使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.debugger.impl.DebuggerSession的用法示例。


在下文中一共展示了DebuggerSession.isAttached方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: actionPerformed

import com.intellij.debugger.impl.DebuggerSession; //导入方法依赖的package包/类
public void actionPerformed(AnActionEvent e) {
  final Project project = CommonDataKeys.PROJECT.getData(e.getDataContext());
  if (project == null) {
    return;
  }
  DebuggerContextImpl context = (DebuggerManagerEx.getInstanceEx(project)).getContext();

  final DebuggerSession session = context.getDebuggerSession();
  if(session != null && session.isAttached()) {
    final DebugProcessImpl process = context.getDebugProcess();
    if (process != null) {
      process.getManagerThread().invoke(new DebuggerCommandImpl() {
        protected void action() throws Exception {
          final List<ThreadState> threads = ThreadDumpAction.buildThreadStates(process.getVirtualMachineProxy());
          ApplicationManager.getApplication().invokeLater(new Runnable() {
            public void run() {
              ExportToTextFileAction.export(project, ThreadDumpPanel.createToFileExporter(project, threads));
            }
          }, ModalityState.NON_MODAL);
        }
      });
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:ExportThreadsAction.java

示例2: findHotSwappableBlazeDebuggerSession

import com.intellij.debugger.impl.DebuggerSession; //导入方法依赖的package包/类
@Nullable
static HotSwappableDebugSession findHotSwappableBlazeDebuggerSession(Project project) {
  DebuggerManagerEx debuggerManager = DebuggerManagerEx.getInstanceEx(project);
  DebuggerSession session = debuggerManager.getContext().getDebuggerSession();
  if (session == null || !session.isAttached()) {
    return null;
  }
  JavaDebugProcess process = session.getProcess().getXdebugProcess();
  if (process == null) {
    return null;
  }
  ExecutionEnvironment env = ((XDebugSessionImpl) process.getSession()).getExecutionEnvironment();
  if (env == null || ClassFileManifestBuilder.getManifest(env) == null) {
    return null;
  }
  RunProfile runProfile = env.getRunProfile();
  if (!(runProfile instanceof BlazeCommandRunConfiguration)) {
    return null;
  }
  return new HotSwappableDebugSession(session, env, (BlazeCommandRunConfiguration) runProfile);
}
 
开发者ID:bazelbuild,项目名称:intellij,代码行数:22,代码来源:BlazeHotSwapManager.java

示例3: compilationFinished

import com.intellij.debugger.impl.DebuggerSession; //导入方法依赖的package包/类
public void compilationFinished(boolean aborted, int errors, int warnings, CompileContext compileContext) {
  final Map<String, List<String>> generated = myGeneratedPaths.getAndSet(new HashMap<String, List<String>>());
  if (myProject.isDisposed()) {
    return;
  }

  if (errors == 0 && !aborted && myPerformHotswapAfterThisCompilation) {
    for (HotSwapVetoableListener listener : myListeners) {
      if (!listener.shouldHotSwap(compileContext)) {
        return;
      }
    }

    final List<DebuggerSession> sessions = new ArrayList<DebuggerSession>();
    Collection<DebuggerSession> debuggerSessions = DebuggerManagerEx.getInstanceEx(myProject).getSessions();
    for (final DebuggerSession debuggerSession : debuggerSessions) {
      if (debuggerSession.isAttached() && debuggerSession.getProcess().canRedefineClasses()) {
        sessions.add(debuggerSession);
      }
    }
    if (!sessions.isEmpty()) {
      hotSwapSessions(sessions, generated);
    }
  }
  myPerformHotswapAfterThisCompilation = true;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:27,代码来源:HotSwapUIImpl.java

示例4: actionPerformed

import com.intellij.debugger.impl.DebuggerSession; //导入方法依赖的package包/类
public void actionPerformed(AnActionEvent e)
{
	Project project = e.getData(CommonDataKeys.PROJECT);
	if(project == null)
	{
		return;
	}

	DebuggerManagerEx debuggerManager = DebuggerManagerEx.getInstanceEx(project);
	DebuggerSession session = debuggerManager.getContext().getDebuggerSession();

	if(session != null && session.isAttached())
	{
		HotSwapUI.getInstance(project).reloadChangedClasses(session, DebuggerSettings.getInstance().COMPILE_BEFORE_HOTSWAP);
	}
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:17,代码来源:HotSwapAction.java

示例5: reloadChangedClasses

import com.intellij.debugger.impl.DebuggerSession; //导入方法依赖的package包/类
@Override
public void reloadChangedClasses(final DebuggerSession session, boolean compileBeforeHotswap)
{
	dontAskHotswapAfterThisCompilation();
	if(compileBeforeHotswap)
	{
		CompilerManager.getInstance(session.getProject()).make(null);
	}
	else
	{
		if(session.isAttached())
		{
			hotSwapSessions(Collections.singletonList(session), null);
		}
	}
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:17,代码来源:HotSwapUIImpl.java

示例6: scanForModifiedClasses

import com.intellij.debugger.impl.DebuggerSession; //导入方法依赖的package包/类
public Map<DebuggerSession, Map<String, HotSwapFile>> scanForModifiedClasses( List<DebuggerSession> sessions, HotSwapProgress swapProgress )
{
  Map<DebuggerSession, Map<String, HotSwapFile>> modifiedClasses = new HashMap<>();

  MultiProcessCommand scanClassesCommand = new MultiProcessCommand();

  swapProgress.setCancelWorker( scanClassesCommand::cancel );

  for( final DebuggerSession debuggerSession : sessions )
  {
    if( debuggerSession.isAttached() )
    {
      scanClassesCommand.addCommand( debuggerSession.getProcess(), new DebuggerCommandImpl()
      {
        protected void action() throws Exception
        {
          swapProgress.setDebuggerSession( debuggerSession );
          Map<String, HotSwapFile> sessionClasses = scanForModifiedClasses( debuggerSession, swapProgress );
          if( !sessionClasses.isEmpty() )
          {
            modifiedClasses.put( debuggerSession, sessionClasses );
          }
        }
      } );
    }
  }

  swapProgress.setTitle( DebuggerBundle.message( "progress.hotswap.scanning.classes" ) );
  scanClassesCommand.run();

  if( swapProgress.isCancelled() )
  {
    for( DebuggerSession session : sessions )
    {
      session.setModifiedClassesScanRequired( true );
    }
    return new HashMap<>();
  }
  return modifiedClasses;
}
 
开发者ID:manifold-systems,项目名称:manifold-ij,代码行数:41,代码来源:HotSwapComponent.java

示例7: actionPerformed

import com.intellij.debugger.impl.DebuggerSession; //导入方法依赖的package包/类
public void actionPerformed(AnActionEvent e) {
  DataContext dataContext = e.getDataContext();
  Project project = CommonDataKeys.PROJECT.getData(dataContext);
  if(project == null) {
    return;
  }

  DebuggerManagerEx debuggerManager = DebuggerManagerEx.getInstanceEx(project);
  DebuggerSession session = debuggerManager.getContext().getDebuggerSession();

  if(session != null && session.isAttached()) {
    HotSwapUI.getInstance(project).reloadChangedClasses(session, DebuggerSettings.getInstance().COMPILE_BEFORE_HOTSWAP);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:HotSwapAction.java

示例8: actionPerformed

import com.intellij.debugger.impl.DebuggerSession; //导入方法依赖的package包/类
public void actionPerformed(AnActionEvent e) {
  final Project project = CommonDataKeys.PROJECT.getData(e.getDataContext());
  if (project == null) {
    return;
  }
  DebuggerContextImpl context = (DebuggerManagerEx.getInstanceEx(project)).getContext();

  final DebuggerSession session = context.getDebuggerSession();
  if(session != null && session.isAttached()) {
    final DebugProcessImpl process = context.getDebugProcess();
    process.getManagerThread().invoke(new DebuggerCommandImpl() {
      protected void action() throws Exception {
        final VirtualMachineProxyImpl vm = process.getVirtualMachineProxy();
        vm.suspend();
        try {
          final List<ThreadState> threads = buildThreadStates(vm);
          ApplicationManager.getApplication().invokeLater(new Runnable() {
            public void run() {
              XDebugSession xSession = session.getXDebugSession();
              if (xSession != null) {
                DebuggerUtilsEx.addThreadDump(project, threads, xSession.getUI(), session);
              }
            }
          }, ModalityState.NON_MODAL);
        }
        finally {
          vm.resume();
        }
      }
    });
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:ThreadDumpAction.java

示例9: reloadChangedClasses

import com.intellij.debugger.impl.DebuggerSession; //导入方法依赖的package包/类
public void reloadChangedClasses(final DebuggerSession session, boolean compileBeforeHotswap) {
  dontAskHotswapAfterThisCompilation();
  if (compileBeforeHotswap) {
    CompilerManager.getInstance(session.getProject()).make(null);
  }
  else {
    if (session.isAttached()) {
      hotSwapSessions(Collections.singletonList(session), null);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:HotSwapUIImpl.java

示例10: actionPerformed

import com.intellij.debugger.impl.DebuggerSession; //导入方法依赖的package包/类
public void actionPerformed(AnActionEvent e) {
  DataContext dataContext = e.getDataContext();
  Project project = PlatformDataKeys.PROJECT.getData(dataContext);
  if(project == null) {
    return;
  }

  DebuggerManagerEx debuggerManager = DebuggerManagerEx.getInstanceEx(project);
  DebuggerSession session = debuggerManager.getContext().getDebuggerSession();

  if(session != null && session.isAttached()) {
    HotSwapUI.getInstance(project).reloadChangedClasses(session, DebuggerSettings.getInstance().COMPILE_BEFORE_HOTSWAP);
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:15,代码来源:HotSwapAction.java

示例11: actionPerformed

import com.intellij.debugger.impl.DebuggerSession; //导入方法依赖的package包/类
public void actionPerformed(AnActionEvent e) {
  final Project project = PlatformDataKeys.PROJECT.getData(e.getDataContext());
  if (project == null) {
    return;
  }
  DebuggerContextImpl context = (DebuggerManagerEx.getInstanceEx(project)).getContext();

  final DebuggerSession session = context.getDebuggerSession();
  if(session != null && session.isAttached()) {
    final DebugProcessImpl process = context.getDebugProcess();
    process.getManagerThread().invoke(new DebuggerCommandImpl() {
      protected void action() throws Exception {
        final VirtualMachineProxyImpl vm = process.getVirtualMachineProxy();
        vm.suspend();
        try {
          final List<ThreadState> threads = buildThreadStates(vm);
          ApplicationManager.getApplication().invokeLater(new Runnable() {
            public void run() {
              final DebuggerSessionTab sessionTab = DebuggerPanelsManager.getInstance(project).getSessionTab();
              if (sessionTab != null) {
                sessionTab.addThreadDump(threads);
              }
            }
          }, ModalityState.NON_MODAL);
        }
        finally {
          vm.resume();
        }
      }
    });
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:33,代码来源:ThreadDumpAction.java

示例12: compilationFinished

import com.intellij.debugger.impl.DebuggerSession; //导入方法依赖的package包/类
@Override
public void compilationFinished(boolean aborted, int errors, int warnings, CompileContext compileContext)
{
	final Map<String, List<String>> generated = myGeneratedPaths.getAndSet(new HashMap<>());
	if(myProject.isDisposed())
	{
		return;
	}

	HotSwapUIImpl hotSwapUI = (HotSwapUIImpl) HotSwapUI.getInstance(myProject);

	if(errors == 0 && !aborted && hotSwapUI.myPerformHotswapAfterThisCompilation)
	{
		for(HotSwapVetoableListener listener : hotSwapUI.myListeners)
		{
			if(!listener.shouldHotSwap(compileContext))
			{
				return;
			}
		}

		final List<DebuggerSession> sessions = new ArrayList<>();
		Collection<DebuggerSession> debuggerSessions = DebuggerManagerEx.getInstanceEx(myProject).getSessions();
		for(final DebuggerSession debuggerSession : debuggerSessions)
		{
			if(debuggerSession.isAttached() && debuggerSession.getProcess().canRedefineClasses())
			{
				sessions.add(debuggerSession);
			}
		}
		if(!sessions.isEmpty())
		{
			hotSwapUI.hotSwapSessions(sessions, generated);
		}
	}
	hotSwapUI.myPerformHotswapAfterThisCompilation = true;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:38,代码来源:HotSwapUIImpl.java

示例13: canShowHint

import com.intellij.debugger.impl.DebuggerSession; //导入方法依赖的package包/类
@Override
public boolean canShowHint(@NotNull final Project project) {
  DebuggerSession debuggerSession = DebuggerManagerEx.getInstanceEx(project).getContext().getDebuggerSession();
  return debuggerSession != null && debuggerSession.isAttached();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:QuickEvaluateActionHandler.java

示例14: canHotSwap

import com.intellij.debugger.impl.DebuggerSession; //导入方法依赖的package包/类
public static boolean canHotSwap(@NotNull DebuggerSession debuggerSession) {
  return debuggerSession.isAttached() && debuggerSession.getProcess().canRedefineClasses();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:HotSwapUIImpl.java

示例15: canShowHint

import com.intellij.debugger.impl.DebuggerSession; //导入方法依赖的package包/类
public boolean canShowHint(@NotNull final Project project) {
  DebuggerSession debuggerSession = DebuggerManagerEx.getInstanceEx(project).getContext().getDebuggerSession();
  return debuggerSession != null && debuggerSession.isAttached();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:5,代码来源:QuickEvaluateActionHandler.java


注:本文中的com.intellij.debugger.impl.DebuggerSession.isAttached方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。