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


Java DebuggerTreeNodeImpl类代码示例

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


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

示例1: actionPerformed

import com.intellij.debugger.ui.impl.watch.DebuggerTreeNodeImpl; //导入依赖的package包/类
public void actionPerformed(final AnActionEvent e) {
  DebuggerTreeNodeImpl[] selectedNode = getSelectedNodes(e.getDataContext());
  final DebuggerContextImpl debuggerContext = getDebuggerContext(e.getDataContext());
  final DebugProcessImpl debugProcess = debuggerContext.getDebugProcess();

  if (debugProcess == null) return;

  //noinspection ConstantConditions
  for (final DebuggerTreeNodeImpl debuggerTreeNode : selectedNode) {
    final ThreadDescriptorImpl threadDescriptor = ((ThreadDescriptorImpl)debuggerTreeNode.getDescriptor());

    if (threadDescriptor.isSuspended()) {
      final ThreadReferenceProxyImpl thread = threadDescriptor.getThreadReference();
      debugProcess.getManagerThread().schedule(new DebuggerCommandImpl() {
        @Override
        protected void action() throws Exception {
          SuspendContextImpl suspendingContext = SuspendManagerUtil.getSuspendingContext(debugProcess.getSuspendManager(), thread);
          if (suspendingContext != null) {
            debugProcess.createResumeThreadCommand(suspendingContext, thread).run();
          }
          debuggerTreeNode.calcValue();
        }
      });
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:ResumeThreadAction.java

示例2: update

import com.intellij.debugger.ui.impl.watch.DebuggerTreeNodeImpl; //导入依赖的package包/类
public void update(AnActionEvent e) {
  DebuggerTreeNodeImpl[] selectedNodes = getSelectedNodes(e.getDataContext());

  boolean visible = false;
  boolean enabled = false;
  String text = DebuggerBundle.message("action.resume.thread.text.resume");

  if(selectedNodes != null && selectedNodes.length > 0){
    visible = true;
    enabled = true;
    for (DebuggerTreeNodeImpl selectedNode : selectedNodes) {
      final NodeDescriptorImpl threadDescriptor = selectedNode.getDescriptor();
      if (!(threadDescriptor instanceof ThreadDescriptorImpl) || !((ThreadDescriptorImpl)threadDescriptor).isSuspended()) {
        visible = false;
        break;
      }
    }
  }
  final Presentation presentation = e.getPresentation();
  presentation.setText(text);
  presentation.setVisible(visible);
  presentation.setEnabled(enabled);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:ResumeThreadAction.java

示例3: actionPerformed

import com.intellij.debugger.ui.impl.watch.DebuggerTreeNodeImpl; //导入依赖的package包/类
public void actionPerformed(final AnActionEvent e) {
  DebuggerTreeNodeImpl[] selectedNode = getSelectedNodes(e.getDataContext());
  if (selectedNode == null) {
    return;
  }
  final DebuggerContextImpl debuggerContext = getDebuggerContext(e.getDataContext());
  final DebugProcessImpl debugProcess = debuggerContext.getDebugProcess();

  for (final DebuggerTreeNodeImpl debuggerTreeNode : selectedNode) {
    ThreadDescriptorImpl threadDescriptor = ((ThreadDescriptorImpl)debuggerTreeNode.getDescriptor());
    final ThreadReferenceProxyImpl thread = threadDescriptor.getThreadReference();

    if (!threadDescriptor.isFrozen()) {
      debugProcess.getManagerThread().schedule(new DebuggerCommandImpl(){
        @Override
        protected void action() throws Exception {
          debugProcess.createFreezeThreadCommand(thread).run();
          debuggerTreeNode.calcValue();
        }
      });
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:FreezeThreadAction.java

示例4: update

import com.intellij.debugger.ui.impl.watch.DebuggerTreeNodeImpl; //导入依赖的package包/类
public void update(AnActionEvent e) {
  DebuggerTreeNodeImpl[] selectedNode = getSelectedNodes(e.getDataContext());
  if (selectedNode == null) {
    return;
  }
  DebugProcessImpl debugProcess = getDebuggerContext(e.getDataContext()).getDebugProcess();

  boolean visible = false;
  if (debugProcess != null) {
    visible = true;
    for (DebuggerTreeNodeImpl aSelectedNode : selectedNode) {
      NodeDescriptorImpl threadDescriptor = aSelectedNode.getDescriptor();
      if (!(threadDescriptor instanceof ThreadDescriptorImpl) || ((ThreadDescriptorImpl)threadDescriptor).isSuspended()) {
        visible = false;
        break;
      }
    }

  }

  e.getPresentation().setVisible(visible);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:23,代码来源:FreezeThreadAction.java

示例5: actionPerformed

import com.intellij.debugger.ui.impl.watch.DebuggerTreeNodeImpl; //导入依赖的package包/类
@Override
public void actionPerformed(AnActionEvent e) {
  DebuggerTreeNodeImpl selectedNode = getSelectedNode(e.getDataContext());
  if(selectedNode == null) {
    return;
  }

  final NodeDescriptorImpl descriptor = selectedNode.getDescriptor();
  if(!(descriptor instanceof ValueDescriptor)) {
    return;
  }

  DebuggerContextImpl debuggerContext = getDebuggerContext(e.getDataContext());
  final DebugProcessImpl debugProcess = debuggerContext.getDebugProcess();
  if(debugProcess == null) {
    return;
  }

  debugProcess.getManagerThread().schedule(new NavigateCommand(debuggerContext, (ValueDescriptor)descriptor, debugProcess, e));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:JumpToObjectAction.java

示例6: getStackFrameProxy

import com.intellij.debugger.ui.impl.watch.DebuggerTreeNodeImpl; //导入依赖的package包/类
static StackFrameProxyImpl getStackFrameProxy(AnActionEvent e) {
  DebuggerTreeNodeImpl node = getSelectedNode(e.getDataContext());
  if (node != null) {
    NodeDescriptorImpl descriptor = node.getDescriptor();
    if (descriptor instanceof StackFrameDescriptorImpl) {
      return ((StackFrameDescriptorImpl)descriptor).getFrameProxy();
    }
  }
  else {
    JavaStackFrame stackFrame = getSelectedStackFrame(e);
    if (stackFrame != null) {
      return stackFrame.getStackFrameProxy();
    }
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:PopFrameAction.java

示例7: getSelectedNode

import com.intellij.debugger.ui.impl.watch.DebuggerTreeNodeImpl; //导入依赖的package包/类
@Nullable
public static DebuggerTreeNodeImpl getSelectedNode(DataContext dataContext) {
  DebuggerTree tree = getTree(dataContext);
  if(tree == null) return null;

  if (tree.getSelectionCount() != 1) {
    return null;
  }
  TreePath path = tree.getSelectionPath();
  if (path == null) {
    return null;
  }
  Object component = path.getLastPathComponent();
  if (!(component instanceof DebuggerTreeNodeImpl)) {
    return null;
  }
  return (DebuggerTreeNodeImpl)component;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:DebuggerAction.java

示例8: getSelectedNodes

import com.intellij.debugger.ui.impl.watch.DebuggerTreeNodeImpl; //导入依赖的package包/类
@Nullable
public static DebuggerTreeNodeImpl[] getSelectedNodes(DataContext dataContext) {
  DebuggerTree tree = getTree(dataContext);
  if(tree == null) return null;
  TreePath[] paths = tree.getSelectionPaths();
  if (paths == null || paths.length == 0) {
    return EMPTY_TREE_NODE_ARRAY;
  }
  List<DebuggerTreeNodeImpl> nodes = new ArrayList<DebuggerTreeNodeImpl>(paths.length);
  for (TreePath path : paths) {
    Object component = path.getLastPathComponent();
    if (component instanceof DebuggerTreeNodeImpl) {
      nodes.add((DebuggerTreeNodeImpl) component);
    }
  }
  return nodes.toArray(new DebuggerTreeNodeImpl[nodes.size()]);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:DebuggerAction.java

示例9: createDescriptorByNode

import com.intellij.debugger.ui.impl.watch.DebuggerTreeNodeImpl; //导入依赖的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

示例10: updateNode

import com.intellij.debugger.ui.impl.watch.DebuggerTreeNodeImpl; //导入依赖的package包/类
private void updateNode(final DebuggerContextImpl context) {
  context.getDebugProcess().getManagerThread().schedule(new DebuggerContextCommandImpl(context) {
    public void threadAction() {
      final DebuggerTreeNodeImpl node = getNodeFactory().createNode(myInspectDescriptor, context.createEvaluationContext());

      DebuggerInvocationUtil.swingInvokeLater(getProject(), new Runnable() {
        public void run() {
          DebuggerTreeNodeImpl root = (DebuggerTreeNodeImpl) getModel().getRoot();
          root.removeAllChildren();

          root.add(node);
          treeChanged();
          root.getTree().expandRow(0);
        }
      });
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:InspectDebuggerTree.java

示例11: addContainerChildren

import com.intellij.debugger.ui.impl.watch.DebuggerTreeNodeImpl; //导入依赖的package包/类
private void addContainerChildren(@NotNull DebuggerTreeNodeImpl node, int startIndex) {
  ContainerDescriptorImpl containerDescriptor = (ContainerDescriptorImpl)node.getDescriptor();
  List<Instance> instances = containerDescriptor.getInstances();
  List<HprofFieldDescriptorImpl> descriptors = new ArrayList<HprofFieldDescriptorImpl>(NODES_PER_EXPANSION);
  int currentIndex = startIndex;
  int limit = currentIndex + NODES_PER_EXPANSION;
  for (int loopCounter = currentIndex; loopCounter < instances.size() && currentIndex < limit; ++loopCounter) {
    Instance instance = instances.get(loopCounter);
    if (myHeap.getInstance(instance.getId()) != null) {
      descriptors.add(new InstanceFieldDescriptorImpl(
        myDebuggerTree.getProject(),
        new Field(Type.OBJECT, Integer.toString(currentIndex)),
        instance,
        currentIndex));
      ++currentIndex;
    }
  }
  HprofFieldDescriptorImpl.batchUpdateRepresentation(descriptors, myDebugProcess.getManagerThread(), myDummySuspendContext);
  for (HprofFieldDescriptorImpl descriptor : descriptors) {
    node.add(DebuggerTreeNodeImpl.createNodeNoUpdate(myDebuggerTree, descriptor));
  }
  if (currentIndex == limit) {
    node.add(DebuggerTreeNodeImpl.createNodeNoUpdate(myDebuggerTree, new ExpansionDescriptorImpl("instances", limit, instances.size())));
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:InstancesTree.java

示例12: actionPerformed

import com.intellij.debugger.ui.impl.watch.DebuggerTreeNodeImpl; //导入依赖的package包/类
public void actionPerformed(final AnActionEvent e) {
  DebuggerTreeNodeImpl[] selectedNode = getSelectedNodes(e.getDataContext());
  final DebuggerContextImpl debuggerContext = getDebuggerContext(e.getDataContext());
  final DebugProcessImpl debugProcess = debuggerContext.getDebugProcess();

  //noinspection ConstantConditions
  for (final DebuggerTreeNodeImpl debuggerTreeNode : selectedNode) {
    final ThreadDescriptorImpl threadDescriptor = ((ThreadDescriptorImpl)debuggerTreeNode.getDescriptor());

    if (threadDescriptor.isSuspended()) {
      final ThreadReferenceProxyImpl thread = threadDescriptor.getThreadReference();
      debugProcess.getManagerThread().schedule(new SuspendContextCommandImpl(debuggerContext.getSuspendContext()) {
        public void contextAction() throws Exception {
          debugProcess.createResumeThreadCommand(getSuspendContext(), thread).run();
          debuggerTreeNode.calcValue();
        }
      });
    }
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:21,代码来源:ResumeThreadAction.java

示例13: actionPerformed

import com.intellij.debugger.ui.impl.watch.DebuggerTreeNodeImpl; //导入依赖的package包/类
public void actionPerformed(final AnActionEvent e) {
  DebuggerTreeNodeImpl[] selectedNode = getSelectedNodes(e.getDataContext());
  if (selectedNode == null) {
    return;
  }
  final DebuggerContextImpl debuggerContext = getDebuggerContext(e.getDataContext());
  final DebugProcessImpl debugProcess = debuggerContext.getDebugProcess();

  for (final DebuggerTreeNodeImpl debuggerTreeNode : selectedNode) {
    ThreadDescriptorImpl threadDescriptor = ((ThreadDescriptorImpl)debuggerTreeNode.getDescriptor());
    final ThreadReferenceProxyImpl thread = threadDescriptor.getThreadReference();

    if (!threadDescriptor.isFrozen()) {
      debugProcess.getManagerThread().schedule(new SuspendContextCommandImpl(debuggerContext.getSuspendContext()) {
        public void contextAction() throws Exception {
          debugProcess.createFreezeThreadCommand(thread).run();
          debuggerTreeNode.calcValue();
        }
      });
    }
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:23,代码来源:FreezeThreadAction.java

示例14: update

import com.intellij.debugger.ui.impl.watch.DebuggerTreeNodeImpl; //导入依赖的package包/类
public void update(AnActionEvent e) {
  DebuggerTreeNodeImpl[] selectedNode = getSelectedNodes(e.getDataContext());
  if (selectedNode == null) {
    return;
  }
  DebugProcessImpl debugProcess = getDebuggerContext(e.getDataContext()).getDebugProcess();

  boolean visible = false;
  if (debugProcess != null) {
    visible = true;
    for (DebuggerTreeNodeImpl aSelectedNode : selectedNode) {
      NodeDescriptorImpl threadDescriptor = aSelectedNode.getDescriptor();
      if (!(threadDescriptor instanceof ThreadDescriptorImpl) || ((ThreadDescriptorImpl)threadDescriptor).isFrozen()) {
        visible = false;
        break;
      }
    }

  }

  e.getPresentation().setVisible(visible);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:23,代码来源:FreezeThreadAction.java

示例15: actionPerformed

import com.intellij.debugger.ui.impl.watch.DebuggerTreeNodeImpl; //导入依赖的package包/类
public void actionPerformed(AnActionEvent e) {
  DebuggerTreeNodeImpl selectedNode = getSelectedNode(e.getDataContext());
  if(selectedNode == null) {
    return;
  }

  final NodeDescriptorImpl descriptor = selectedNode.getDescriptor();
  if(!(descriptor instanceof ValueDescriptor)) {
    return;
  }

  DebuggerContextImpl debuggerContext = getDebuggerContext(e.getDataContext());
  final DebugProcessImpl debugProcess = debuggerContext.getDebugProcess();
  if(debugProcess == null) {
    return;
  }

  debugProcess.getManagerThread().schedule(new NavigateCommand(debuggerContext, (ValueDescriptor)descriptor, debugProcess, e));
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:20,代码来源:JumpToObjectAction.java


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