• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java DebuggerSession类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: scanForModifiedClassesWithProgress

import com.intellij.debugger.impl.DebuggerSession; //导入依赖的package包/类
private Map<DebuggerSession, Map<String, HotSwapFile>> scanForModifiedClassesWithProgress( List<DebuggerSession> sessions, HotSwapProgressImpl progress )
{
  Ref<Map<DebuggerSession, Map<String, HotSwapFile>>> result = Ref.create( null );
  ProgressManager.getInstance().runProcess(
    () -> {
      try
      {
        result.set( scanForModifiedClasses( sessions, progress ) );
      }
      finally
      {
        progress.finished();
      }
    }, progress.getProgressIndicator() );
  return result.get();
}
 
开发者ID:manifold-systems,项目名称:manifold-ij,代码行数:17,代码来源:HotSwapComponent.java


示例2: scanForModifiedClasses

import com.intellij.debugger.impl.DebuggerSession; //导入依赖的package包/类
public Map<String, HotSwapFile> scanForModifiedClasses( DebuggerSession session, HotSwapProgress progress )
{
  DebuggerManagerThreadImpl.assertIsManagerThread();

  Map<String, HotSwapFile> modifiedClasses = new HashMap<>();

  List<File> outputRoots = new ArrayList<>();
  ApplicationManager.getApplication().runReadAction(
    () -> {
       VirtualFile[] allDirs = OrderEnumerator.orderEntries( getIjProject() ).getAllSourceRoots();
       for( VirtualFile dir : allDirs )
       {
         outputRoots.add( new File( dir.getPath() ) );
       }
     } );
  long timeStamp = getTimeStamp( session );
  for( File root : outputRoots )
  {
    String rootPath = FileUtil.toCanonicalPath( root.getPath() );
    collectModifiedClasses( root, rootPath, modifiedClasses, progress, timeStamp );
  }
  setTimeStamp( session, System.currentTimeMillis() );
  return modifiedClasses;
}
 
开发者ID:manifold-systems,项目名称:manifold-ij,代码行数:25,代码来源:HotSwapComponent.java


示例3: compilationFinished

import com.intellij.debugger.impl.DebuggerSession; //导入依赖的package包/类
public void compilationFinished( boolean aborted, int errors, int warnings, CompileContext compileContext )
{
  if( getIjProject().isDisposed() )
  {
    return;
  }

  if( errors > 0 || aborted )
  {
    return;
  }

  List<DebuggerSession> sessions = getHotSwappableDebugSessions();
  if( !sessions.isEmpty() )
  {
    hotSwapSessions( sessions );
  }
}
 
开发者ID:manifold-systems,项目名称:manifold-ij,代码行数:19,代码来源:HotSwapComponent.java


示例4: 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


示例5: canInspect

import com.intellij.debugger.impl.DebuggerSession; //导入依赖的package包/类
private boolean canInspect(ValueDescriptorImpl descriptor, DebuggerContextImpl context) {
  DebuggerSession session = context.getDebuggerSession();
  if (session == null || !session.isPaused()) return false;

  boolean isField = descriptor instanceof FieldDescriptorImpl;

  if(descriptor instanceof WatchItemDescriptor) {
    Modifier modifier = ((WatchItemDescriptor)descriptor).getModifier();
    if(modifier == null || !modifier.canInspect()) return false;
    isField = modifier instanceof Field;
  }

  if (isField) { // check if possible
    if (!context.getDebugProcess().canWatchFieldModification()) {
      Messages.showMessageDialog(
        context.getProject(),
        DebuggerBundle.message("error.modification.watchpoints.not.supported"),
        ActionsBundle.actionText(DebuggerActions.INSPECT),
        Messages.getInformationIcon()
      );
      return false;
    }
  }
  return true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:InspectAction.java


示例6: scanForModifiedClassesWithProgress

import com.intellij.debugger.impl.DebuggerSession; //导入依赖的package包/类
private static Map<DebuggerSession, Map<String, HotSwapFile>> scanForModifiedClassesWithProgress(final List<DebuggerSession> sessions,
                                                                                                 final HotSwapProgressImpl progress,
                                                                                                 final boolean scanWithVFS) {
  final Ref<Map<DebuggerSession, Map<String, HotSwapFile>>> result = Ref.create(null);
  ProgressManager.getInstance().runProcess(new Runnable() {
    public void run() {
      try {
        result.set(HotSwapManager.scanForModifiedClasses(sessions, progress, scanWithVFS));
      }
      finally {
        progress.finished();
      }
    }
  }, progress.getProgressIndicator());
  return result.get();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:HotSwapUIImpl.java


示例7: 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;
      }
    }

    List<DebuggerSession> sessions = getHotSwappableDebugSessions();
    if (!sessions.isEmpty()) {
      hotSwapSessions(sessions, generated);
    }
  }
  myPerformHotswapAfterThisCompilation = true;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:HotSwapUIImpl.java


示例8: UpdatableDebuggerView

import com.intellij.debugger.impl.DebuggerSession; //导入依赖的package包/类
protected UpdatableDebuggerView(final Project project, final DebuggerStateManager stateManager) {
  setLayout(new BorderLayout());
  myProject = project;
  myStateManager = stateManager;

  final DebuggerContextListener contextListener = new DebuggerContextListener() {
    public void changeEvent(@NotNull DebuggerContextImpl newContext, DebuggerSession.Event event) {
      UpdatableDebuggerView.this.changeEvent(newContext, event);
    }
  };
  myStateManager.addListener(contextListener);

  registerDisposable(new Disposable() {
    public void dispose() {
      myStateManager.removeListener(contextListener);
    }
  });

}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:UpdatableDebuggerView.java


示例9: 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


示例10: changeEvent

import com.intellij.debugger.impl.DebuggerSession; //导入依赖的package包/类
@Override
public void changeEvent(@NotNull DebuggerContextImpl debuggerContext, DebuggerSession.Event event) {
    switch (event) {
        case ATTACHED:
            firstPauseAfterStartOrResume = true;
            break;
        case PAUSE:
            if (firstPauseAfterStartOrResume) {
                trackingEventManager.addEvent(new DebugEventBase(TrackingEventType.SUSPEND_BREAKPOINT, new Date()));
                firstPauseAfterStartOrResume = false;
            }
            break;
        case RESUME:
            trackingEventManager.addEvent(new DebugEventBase(TrackingEventType.RESUME_CLIENT, new Date()));
            firstPauseAfterStartOrResume = true;
            break;
    }
}
 
开发者ID:TestRoots,项目名称:watchdog,代码行数:19,代码来源:DebugEventListener.java


示例11: loadRenderers

import com.intellij.debugger.impl.DebuggerSession; //导入依赖的package包/类
private void loadRenderers() {
  getManagerThread().invoke(new DebuggerCommandImpl() {
    protected void action() throws Exception {
      try {
        final NodeRendererSettings rendererSettings = NodeRendererSettings.getInstance();
        for (final NodeRenderer renderer : rendererSettings.getAllRenderers()) {
          if (renderer.isEnabled()) {
            myRenderers.add(renderer);
          }
        }
      }
      finally {
        DebuggerInvocationUtil.swingInvokeLater(myProject, new Runnable() {
          public void run() {
            final DebuggerSession session = mySession;
            if (session != null && session.isAttached()) {
              session.refresh(true);
            }
          }
        });
      }
    }
  });
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:25,代码来源:DebugProcessImpl.java


示例12: isEnabled

import com.intellij.debugger.impl.DebuggerSession; //导入依赖的package包/类
public boolean isEnabled(final @NotNull Project project, final AnActionEvent event) {

    Editor editor = event.getData(PlatformDataKeys.EDITOR);

    if (editor == null) {
      return false;
    }

    PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument());
    FileTypeManager fileTypeManager = FileTypeManager.getInstance();
    if (file == null) {
      return false;
    }

    final VirtualFile virtualFile = file.getVirtualFile();
    FileType fileType = virtualFile != null ? virtualFile.getFileType() : null;
    if (DebuggerUtils.supportsJVMDebugging(fileType) || DebuggerUtils.supportsJVMDebugging(file)) {
      DebuggerSession debuggerSession = DebuggerManagerEx.getInstanceEx(project).getContext().getDebuggerSession();
      return debuggerSession != null && debuggerSession.isPaused();
    }

    return false;
  }
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:24,代码来源:RunToCursorActionHandler.java


示例13: doSmartStep

import com.intellij.debugger.impl.DebuggerSession; //导入依赖的package包/类
/**
 * Override this if you haven't PsiMethod, like in Kotlin.
 * @param position
 * @param session
 * @param fileEditor
 * @return false to continue for another handler or for default action (step into)
 */
public boolean doSmartStep(SourcePosition position, final DebuggerSession session, TextEditor fileEditor) {
  final List<PsiMethod> methods = findReferencedMethods(position);
  if (methods.size() > 0) {
    if (methods.size() == 1) {
      session.stepInto(true, getSmartStepFilter(methods.get(0)));
    }
    else {
      final PsiMethodListPopupStep popupStep = new PsiMethodListPopupStep(methods, new PsiMethodListPopupStep.OnChooseRunnable() {
        public void execute(PsiMethod chosenMethod) {
          session.stepInto(true, getSmartStepFilter(chosenMethod));
        }
      });
      final ListPopup popup = JBPopupFactory.getInstance().createListPopup(popupStep);
      final RelativePoint point = DebuggerUIUtil.calcPopupLocation(((TextEditor)fileEditor).getEditor(), position.getLine());
      popup.show(point);
    }
    return true;
  }
  return false;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:28,代码来源:JvmSmartStepIntoHandler.java


示例14: 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


示例15: rebuild

import com.intellij.debugger.impl.DebuggerSession; //导入依赖的package包/类
protected void rebuild(int event) {
  myRebuildAlarm.cancelAllRequests();
  final boolean isRefresh = event == DebuggerSession.EVENT_REFRESH ||
                            event == DebuggerSession.EVENT_REFRESH_VIEWS_ONLY ||
                            event == DebuggerSession.EVENT_THREADS_REFRESH;
  if (!isRefresh) {
    myPerformFullRebuild.set(true);
  }
  myRebuildAlarm.addRequest(new Runnable() {
    public void run() {
      try {
        doRebuild(!myPerformFullRebuild.getAndSet(false));
      }
      catch (VMDisconnectedException e) {
        // ignored
      }
    }
  }, 100, ModalityState.NON_MODAL);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:20,代码来源:FramesPanel.java


示例16: doRebuild

import com.intellij.debugger.impl.DebuggerSession; //导入依赖的package包/类
private void doRebuild(boolean refreshOnly) {
  final DebuggerContextImpl context = getContext();
  final DebuggerSession session = context.getDebuggerSession();
  final boolean paused = session != null && session.isPaused();
  if (!paused || !refreshOnly) {
    myThreadsCombo.removeAllItems();
    synchronized (myFramesList) {
      myFramesLastUpdateTime = getNextStamp();
      myFramesList.getModel().clear();
    }
  }

  if (paused) {
    final DebugProcessImpl process = context.getDebugProcess();
    if (process != null) {
      process.getManagerThread().schedule(new RefreshFramePanelCommand(refreshOnly && myThreadsCombo.getItemCount() != 0));
    }
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:20,代码来源:FramesPanel.java


示例17: changeEvent

import com.intellij.debugger.impl.DebuggerSession; //导入依赖的package包/类
protected void changeEvent(DebuggerContextImpl newContext, int event) {
  if (event == DebuggerSession.EVENT_THREADS_REFRESH) {
    return;
  }
  if(event == DebuggerSession.EVENT_ATTACHED) {
    DebuggerTreeNodeImpl root = (DebuggerTreeNodeImpl) getWatchTree().getModel().getRoot();
    if(root != null) {
      for(Enumeration e = root.rawChildren(); e.hasMoreElements();) {
        DebuggerTreeNodeImpl child = (DebuggerTreeNodeImpl) e.nextElement();
        ((WatchItemDescriptor) child.getDescriptor()).setNew();
      }
    }
  }

  rebuildIfVisible(event);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:WatchPanel.java


示例18: getDebugSession

import com.intellij.debugger.impl.DebuggerSession; //导入依赖的package包/类
@Nullable
public DebuggerSession getDebugSession()
{
	final DebuggerManagerEx debuggerManager = DebuggerManagerEx.getInstanceEx(getProject());
	if(debuggerManager == null)
	{
		return null;
	}
	final Collection<DebuggerSession> sessions = debuggerManager.getSessions();
	for(final DebuggerSession debuggerSession : sessions)
	{
		if(getConsole() == debuggerSession.getProcess().getExecutionResult().getExecutionConsole())
		{
			return debuggerSession;
		}
	}
	return null;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:19,代码来源:JavaAwareTestConsoleProperties.java


示例19: customizePresentation

import com.intellij.debugger.impl.DebuggerSession; //导入依赖的package包/类
@Override
public void customizePresentation(@NotNull ColoredTextContainer component)
{
	StackFrameDescriptorImpl selectedDescriptor = null;
	DebuggerSession session = myDebugProcess.getSession();
	if(session != null)
	{
		XDebugSession xSession = session.getXDebugSession();
		if(xSession != null)
		{
			XStackFrame frame = xSession.getCurrentStackFrame();
			if(frame instanceof JavaStackFrame)
			{
				selectedDescriptor = ((JavaStackFrame) frame).getDescriptor();
			}
		}
	}
	FRAME_RENDERER.customizePresentation(myDescriptor, component, selectedDescriptor);
	if(myInsertCapturePoint != null)
	{
		component.setIcon(XDebuggerUIConstants.INFORMATION_MESSAGE_ICON);
	}
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:24,代码来源:JavaStackFrame.java


示例20: 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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java AlipayTradeAppPayRequest类代码示例发布时间:2022-05-22
下一篇:
Java PopulatorTree类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap