本文整理汇总了Java中com.intellij.debugger.DebuggerManagerEx类的典型用法代码示例。如果您正苦于以下问题:Java DebuggerManagerEx类的具体用法?Java DebuggerManagerEx怎么用?Java DebuggerManagerEx使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DebuggerManagerEx类属于com.intellij.debugger包,在下文中一共展示了DebuggerManagerEx类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onReached
import com.intellij.debugger.DebuggerManagerEx; //导入依赖的package包/类
@Override
public int onReached(SuspendContextImpl context) {
StackFrameProxyImpl proxy = context.getFrameProxy();
if (proxy != null) {
try {
ObjectReference reference = proxy.thisObject();
if (reference != null) {
DebugProcessImpl debugProcess = context.getDebugProcessNoAssert();
BreakpointManager breakpointManager = DebuggerManagerEx.getInstanceEx(debugProcess.getProject()).getBreakpointManager();
StepIntoBreakpoint breakpoint = breakpointManager.addStepIntoBreakpoint(myMethodFilter);
if (breakpoint != null) {
breakpointManager.applyThreadFilter(debugProcess, null); // clear the filter on resume
breakpoint.addInstanceFilter(reference.uniqueID());
breakpoint.setInstanceFiltersEnabled(true);
breakpoint.setSuspendPolicy(context.getSuspendPolicy() == EventRequest.SUSPEND_EVENT_THREAD ? DebuggerSettings.SUSPEND_THREAD : DebuggerSettings.SUSPEND_ALL);
breakpoint.createRequest(debugProcess);
debugProcess.setRunToCursorBreakpoint(breakpoint);
return RequestHint.RESUME;
}
}
}
catch (EvaluateException ignored) {
}
}
return RequestHint.STOP;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:ClassInstanceMethodFilter.java
示例2: actionPerformed
import com.intellij.debugger.DebuggerManagerEx; //导入依赖的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
示例3: actionPerformed
import com.intellij.debugger.DebuggerManagerEx; //导入依赖的package包/类
public void actionPerformed(AnActionEvent e) {
Project project = e.getData(CommonDataKeys.PROJECT);
if (project == null) {
return;
}
DebuggerManagerEx debugManager = DebuggerManagerEx.getInstanceEx(project);
if (debugManager == null) {
return;
}
final BreakpointManager manager = debugManager.getBreakpointManager();
final PlaceInDocument place = getPlace(e);
if(place != null && DocumentUtil.isValidOffset(place.getOffset(), place.getDocument())) {
Breakpoint breakpoint = manager.findBreakpoint(place.getDocument(), place.getOffset(), MethodBreakpoint.CATEGORY);
if(breakpoint == null) {
manager.addMethodBreakpoint(place.getDocument(), place.getDocument().getLineNumber(place.getOffset()));
}
else {
manager.removeBreakpoint(breakpoint);
}
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:ToggleMethodBreakpointAction.java
示例4: createDescriptorByNode
import com.intellij.debugger.DebuggerManagerEx; //导入依赖的package包/类
@Override
public void createDescriptorByNode(Object node, final ResultConsumer<Pair<NodeDescriptorImpl, String>> resultConsumer) {
if (node instanceof DebuggerTreeNodeImpl) {
final DebuggerTreeNodeImpl debuggerTreeNode = (DebuggerTreeNodeImpl)node;
final DebuggerContextImpl context = DebuggerManagerEx.getInstanceEx(myProject).getContext();
context.getDebugProcess().getManagerThread().schedule(new DebuggerContextCommandImpl(context) {
@Override
public void threadAction() {
try {
final TextWithImports evaluationText = DebuggerTreeNodeExpression.createEvaluationText(debuggerTreeNode, context);
resultConsumer.onSuccess(Pair.create(debuggerTreeNode.getDescriptor(), evaluationText.getText()));
}
catch (EvaluateException e) {
resultConsumer.onFailure(e);
}
}
});
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:DebuggerTreeCreatorImpl.java
示例5: findHotSwappableBlazeDebuggerSession
import com.intellij.debugger.DebuggerManagerEx; //导入依赖的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
示例6: wrapContext
import com.intellij.debugger.DebuggerManagerEx; //导入依赖的package包/类
private PsiElement wrapContext(Project project, final PsiElement originalContext) {
if (project.isDefault()) return originalContext;
PsiElement context = originalContext;
final DebugProcessImpl process = DebuggerManagerEx.getInstanceEx(project).getContext().getDebugProcess();
if (process != null) {
final Map<ObjectReference, ValueMarkup> markupMap = ValueDescriptorImpl.getMarkupMap(process);
if (markupMap != null && markupMap.size() > 0) {
final Pair<String, Map<String, ObjectReference>> markupVariables = createMarkupVariablesText(markupMap);
int offset = markupVariables.getFirst().length() - 1;
final TextWithImportsImpl textWithImports = new TextWithImportsImpl(CodeFragmentKind.CODE_BLOCK, markupVariables.getFirst(), "", myDelegate.getFileType());
final JavaCodeFragment codeFragment = myDelegate.createCodeFragment(textWithImports, context, project);
codeFragment.accept(new JavaRecursiveElementVisitor() {
public void visitLocalVariable(PsiLocalVariable variable) {
final String name = variable.getName();
variable.putUserData(LABEL_VARIABLE_VALUE_KEY, markupVariables.getSecond().get(name));
}
});
final PsiElement newContext = codeFragment.findElementAt(offset);
if (newContext != null) {
context = newContext;
}
}
}
return context;
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:26,代码来源:CodeFragmentFactoryContextWrapper.java
示例7: isEnabled
import com.intellij.debugger.DebuggerManagerEx; //导入依赖的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
示例8: actionPerformed
import com.intellij.debugger.DebuggerManagerEx; //导入依赖的package包/类
public void actionPerformed(AnActionEvent e) {
Project project = e.getData(PlatformDataKeys.PROJECT);
if (project == null) {
return;
}
DebuggerManagerEx debugManager = DebuggerManagerEx.getInstanceEx(project);
if (debugManager == null) {
return;
}
final BreakpointManager manager = debugManager.getBreakpointManager();
final PlaceInDocument place = getPlace(e);
if(place != null) {
Breakpoint breakpoint = manager.findBreakpoint(place.getDocument(), place.getOffset(), MethodBreakpoint.CATEGORY);
if(breakpoint == null) {
final int methodLine = place.getDocument().getLineNumber(place.getOffset());
MethodBreakpoint methodBreakpoint = manager.addMethodBreakpoint(place.getDocument(), methodLine);
if(methodBreakpoint != null) {
RequestManagerImpl.createRequests(methodBreakpoint);
}
}
else {
manager.removeBreakpoint(breakpoint);
}
}
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:26,代码来源:ToggleMethodBreakpointAction.java
示例9: isEnabled
import com.intellij.debugger.DebuggerManagerEx; //导入依赖的package包/类
public boolean isEnabled(@NotNull final Project project, final AnActionEvent event) {
PlaceInDocument place = getPlace(project, event);
if (place != null) {
final Document document = place.getDocument();
final int offset = place.getOffset();
int line = document.getLineNumber(offset);
VirtualFile file = FileDocumentManager.getInstance().getFile(document);
PsiFile psiFile = PsiManager.getInstance(project).findFile(file);
if (DebuggerUtils.supportsJVMDebugging(file.getFileType()) || DebuggerUtils.supportsJVMDebugging(psiFile)) {
final BreakpointManager breakpointManager = DebuggerManagerEx.getInstanceEx(project).getBreakpointManager();
return breakpointManager.findBreakpoint(document, offset, LineBreakpoint.CATEGORY) != null ||
LineBreakpoint.canAddLineBreakpoint(project, document, line);
}
}
return false;
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:19,代码来源:ToggleLineBreakpointActionHandler.java
示例10: compilationFinished
import com.intellij.debugger.DebuggerManagerEx; //导入依赖的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
示例11: setNodeAsRoot
import com.intellij.debugger.DebuggerManagerEx; //导入依赖的package包/类
protected void setNodeAsRoot(final Object node) {
if (node instanceof DebuggerTreeNodeImpl) {
myValueHint.shiftLocation();
final DebuggerTreeNodeImpl debuggerTreeNode = (DebuggerTreeNodeImpl)node;
final DebuggerContextImpl context = (DebuggerManagerEx.getInstanceEx(myValueHint.getProject())).getContext();
context.getDebugProcess().getManagerThread().schedule(new DebuggerContextCommandImpl(context) {
public void threadAction() {
try {
final NodeDescriptorImpl descriptor = debuggerTreeNode.getDescriptor();
final TextWithImports evaluationText = DebuggerTreeNodeExpression.createEvaluationText(debuggerTreeNode, context);
final String title = evaluationText.getText();
addToHistory(Pair.create(descriptor, title));
myTree.setInspectDescriptor(descriptor);
myValueHint.showTreePopup(myTree, context, title, ValueHintTreeComponent.this);
}
catch (final EvaluateException e1) {
LOG.debug(e1);
}
}
});
}
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:23,代码来源:ValueHintTreeComponent.java
示例12: createBreakpointPanel
import com.intellij.debugger.DebuggerManagerEx; //导入依赖的package包/类
public BreakpointPanel createBreakpointPanel(final Project project, final DialogWrapper parentDialog) {
BreakpointPanel panel =
new BreakpointPanel(project, createBreakpointPropertiesPanel(project, false), createBreakpointPanelActions(project, parentDialog),
getBreakpointCategory(), getDisplayName(), getHelpID()) {
public void resetBreakpoints() {
super.resetBreakpoints();
Breakpoint[] breakpoints = getBreakpointManager().getBreakpoints(getBreakpointCategory());
final AnyExceptionBreakpoint anyExceptionBreakpoint =
DebuggerManagerEx.getInstanceEx(project).getBreakpointManager().getAnyExceptionBreakpoint();
boolean found = false;
for (Breakpoint breakpoint : breakpoints) {
if (breakpoint.equals(anyExceptionBreakpoint)) {
found = true;
break;
}
}
if (!found) {
insertBreakpointAt(anyExceptionBreakpoint, 0);
}
}
};
configureBreakpointPanel(panel);
return panel;
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:25,代码来源:ExceptionBreakpointFactory.java
示例13: addBreakpoint
import com.intellij.debugger.DebuggerManagerEx; //导入依赖的package包/类
@Override
public Breakpoint addBreakpoint(Project project) {
ExceptionBreakpoint breakpoint = null;
final PsiClass throwableClass =
JavaPsiFacade.getInstance(project).findClass("java.lang.Throwable", GlobalSearchScope.allScope(project));
TreeClassChooser chooser = TreeClassChooserFactory.getInstance(project)
.createInheritanceClassChooser(DebuggerBundle.message("add.exception.breakpoint.classchooser.title"),
GlobalSearchScope.allScope(project), throwableClass, true, true, null);
chooser.showDialog();
PsiClass selectedClass = chooser.getSelected();
String qName = selectedClass == null ? null : JVMNameUtil.getNonAnonymousClassName(selectedClass);
if (qName != null && qName.length() > 0) {
breakpoint = DebuggerManagerEx.getInstanceEx(project).getBreakpointManager()
.addExceptionBreakpoint(qName, ((PsiClassOwner)selectedClass.getContainingFile()).getPackageName());
}
return breakpoint;
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:19,代码来源:ExceptionBreakpointFactory.java
示例14: actionPerformed
import com.intellij.debugger.DebuggerManagerEx; //导入依赖的package包/类
public void actionPerformed(ActionEvent e) {
Breakpoint[] breakpoints = getPanel().getSelectedBreakpoints();
if (breakpoints != null) {
for (Breakpoint breakpoint1 : breakpoints) {
if (breakpoint1 instanceof AnyExceptionBreakpoint) {
return;
}
}
getPanel().removeSelectedBreakpoints();
BreakpointManager manager = DebuggerManagerEx.getInstanceEx(myProject).getBreakpointManager();
for (final Breakpoint breakpoint : breakpoints) {
getPanel().getTree().removeBreakpoint(breakpoint);
manager.removeBreakpoint(breakpoint);
}
}
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:17,代码来源:RemoveAction.java
示例15: getDebugSession
import com.intellij.debugger.DebuggerManagerEx; //导入依赖的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
示例16: getAutoRenderer
import com.intellij.debugger.DebuggerManagerEx; //导入依赖的package包/类
public NodeRenderer getAutoRenderer(ValueDescriptor descriptor)
{
DebuggerManagerThreadImpl.assertIsManagerThread();
Type type = descriptor.getType();
// in case evaluation is not possible, force default renderer
if(!DebuggerManagerEx.getInstanceEx(getProject()).getContext().isEvaluationPossible())
{
return getDefaultRenderer(type);
}
try
{
return myNodeRenderersMap.computeIfAbsent(type, t -> myRenderers.stream().
filter(r -> DebuggerUtilsImpl.suppressExceptions(() -> r.isApplicable(type), false, true, ClassNotPreparedException.class)).
findFirst().orElseGet(() -> getDefaultRenderer(type)));
}
catch(ClassNotPreparedException e)
{
LOG.info(e);
// use default, but do not cache
return getDefaultRenderer(type);
}
}
开发者ID:consulo,项目名称:consulo-java,代码行数:25,代码来源:DebugProcessImpl.java
示例17: contextAction
import com.intellij.debugger.DebuggerManagerEx; //导入依赖的package包/类
@Override
public void contextAction()
{
showStatusText(getStatusText());
SuspendContextImpl suspendContext = getSuspendContext();
ThreadReferenceProxyImpl stepThread = getContextThread();
RequestHint hint = getHint(suspendContext, stepThread);
applyThreadFilter(stepThread);
final MethodReturnValueWatcher rvWatcher = myReturnValueWatcher;
if(rvWatcher != null)
{
rvWatcher.enable(stepThread.getThreadReference());
}
doStep(suspendContext, stepThread, myStepSize, getStepSize(), hint);
if(myIsIgnoreBreakpoints)
{
DebuggerManagerEx.getInstanceEx(myProject).getBreakpointManager().disableBreakpoints(DebugProcessImpl.this);
}
super.contextAction();
}
开发者ID:consulo,项目名称:consulo-java,代码行数:27,代码来源:DebugProcessImpl.java
示例18: createResumeCommand
import com.intellij.debugger.DebuggerManagerEx; //导入依赖的package包/类
@NotNull
public ResumeCommand createResumeCommand(SuspendContextImpl suspendContext, final PrioritizedTask.Priority priority)
{
final BreakpointManager breakpointManager = DebuggerManagerEx.getInstanceEx(getProject()).getBreakpointManager();
return new ResumeCommand(suspendContext)
{
@Override
public void contextAction()
{
breakpointManager.applyThreadFilter(DebugProcessImpl.this, null); // clear the filter on resume
if(myReturnValueWatcher != null)
{
myReturnValueWatcher.clear();
}
super.contextAction();
}
@Override
public Priority getPriority()
{
return priority;
}
};
}
开发者ID:consulo,项目名称:consulo-java,代码行数:25,代码来源:DebugProcessImpl.java
示例19: actionPerformed
import com.intellij.debugger.DebuggerManagerEx; //导入依赖的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
示例20: onClick
import com.intellij.debugger.DebuggerManagerEx; //导入依赖的package包/类
@Override
public void onClick(MouseEvent e)
{
XDebuggerTree tree = (XDebuggerTree) e.getSource();
TreePath path = tree.getPathForLocation(e.getX(), e.getY());
if(path != null)
{
TreeNode parent = ((TreeNode) path.getLastPathComponent()).getParent();
if(parent instanceof XValueNodeImpl)
{
XValueNodeImpl valueNode = (XValueNodeImpl) parent;
ArrayAction.setArrayRenderer(NodeRendererSettings.getInstance().getArrayRenderer(), valueNode, DebuggerManagerEx.getInstanceEx(tree.getProject()).getContext());
}
}
e.consume();
}
开发者ID:consulo,项目名称:consulo-java,代码行数:17,代码来源:ArrayRenderer.java
注:本文中的com.intellij.debugger.DebuggerManagerEx类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论