本文整理汇总了Java中com.intellij.xdebugger.frame.XStackFrame类的典型用法代码示例。如果您正苦于以下问题:Java XStackFrame类的具体用法?Java XStackFrame怎么用?Java XStackFrame使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
XStackFrame类属于com.intellij.xdebugger.frame包,在下文中一共展示了XStackFrame类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createStackFrame
import com.intellij.xdebugger.frame.XStackFrame; //导入依赖的package包/类
@Nullable
@Override
public XStackFrame createStackFrame(@NotNull StackFrameProxyImpl frame, @NotNull DebugProcessImpl debugProcess, @NotNull Location location) {
for (PositionManager positionManager : myPositionManagers) {
if (positionManager instanceof PositionManagerEx) {
try {
XStackFrame xStackFrame = ((PositionManagerEx)positionManager).createStackFrame(frame, debugProcess, location);
if (xStackFrame != null) {
return xStackFrame;
}
}
catch (Throwable e) {
LOG.error(e);
}
}
}
return null;
}
示例2: getSelectedStackFrame
import com.intellij.xdebugger.frame.XStackFrame; //导入依赖的package包/类
@Nullable
private static JavaStackFrame getSelectedStackFrame(AnActionEvent e) {
Project project = e.getProject();
if (project != null) {
XDebugSession session = e.getData(XDebugSession.DATA_KEY);
if (session == null) {
session = XDebuggerManager.getInstance(project).getCurrentSession();
}
if (session != null) {
XStackFrame frame = session.getCurrentStackFrame();
if (frame instanceof JavaStackFrame) {
return ((JavaStackFrame)frame);
}
}
}
//DebuggerContextImpl debuggerContext = DebuggerAction.getDebuggerContext(e.getDataContext());
//StackFrameProxyImpl frameProxy = debuggerContext.getFrameProxy();
//
//if(frameProxy == null || frameProxy.isBottom()) {
// return null;
//}
//return frameProxy;
return null;
}
示例3: buildTreeAndRestoreState
import com.intellij.xdebugger.frame.XStackFrame; //导入依赖的package包/类
protected void buildTreeAndRestoreState(@NotNull final XStackFrame stackFrame) {
XDebuggerTree tree = myDebuggerTreePanel.getTree();
final XSourcePosition position = stackFrame.getSourcePosition();
tree.setSourcePosition(position);
tree.setRoot(new XStackFrameNode(tree, stackFrame), false);
final Project project = tree.getProject();
project.putUserData(XVariablesView.DEBUG_VARIABLES, new XVariablesView.InlineVariablesInfo());
project.putUserData(XVariablesView.DEBUG_VARIABLES_TIMESTAMPS, new ObjectLongHashMap<VirtualFile>());
Object newEqualityObject = stackFrame.getEqualityObject();
if (myFrameEqualityObject != null && newEqualityObject != null && myFrameEqualityObject.equals(newEqualityObject)
&& myTreeState != null) {
disposeTreeRestorer();
myTreeRestorer = myTreeState.restoreState(tree);
}
if (position != null && Registry.is("debugger.valueTooltipAutoShowOnSelection")) {
registerInlineEvaluator(stackFrame, position, project);
}
}
示例4: processSessionEvent
import com.intellij.xdebugger.frame.XStackFrame; //导入依赖的package包/类
@Override
public void processSessionEvent(@NotNull final SessionEvent event) {
XDebugSession session = getSession(getPanel());
XStackFrame stackFrame = session == null ? null : session.getCurrentStackFrame();
XDebuggerTree tree = getTree();
if (event == SessionEvent.BEFORE_RESUME || event == SessionEvent.SETTINGS_CHANGED) {
saveCurrentTreeState(stackFrame);
if (event == SessionEvent.BEFORE_RESUME) {
return;
}
}
tree.markNodesObsolete();
if (stackFrame != null) {
cancelClear();
buildTreeAndRestoreState(stackFrame);
}
else {
requestClear();
}
}
示例5: addStackFrames
import com.intellij.xdebugger.frame.XStackFrame; //导入依赖的package包/类
@Override
public void addStackFrames(@NotNull final List<? extends XStackFrame> stackFrames, final boolean last) {
if (isObsolete()) return;
myLaterInvocator.offer(new Runnable() {
@Override
public void run() {
if (isObsolete()) return;
myStackFrames.addAll(stackFrames);
addFrameListElements(stackFrames, last);
selectCurrentFrame();
myNextFrameIndex += stackFrames.size();
myAllFramesLoaded = last;
if (last) {
if (myVisibleRect != null) {
myFramesList.scrollRectToVisible(myVisibleRect);
}
myRunning = false;
myListenersEnabled = true;
}
}
});
}
示例6: computeStackFrames
import com.intellij.xdebugger.frame.XStackFrame; //导入依赖的package包/类
@Override
public void computeStackFrames(int firstFrameIndex, XStackFrameContainer container) {
if (myThreadInfo.getState() != PyThreadInfo.State.SUSPENDED) {
container.errorOccurred("Frames not available in non-suspended state");
return;
}
final List<PyStackFrameInfo> frames = myThreadInfo.getFrames();
if (frames != null && firstFrameIndex <= frames.size()) {
final List<PyStackFrame> xFrames = new LinkedList<PyStackFrame>();
for (int i = firstFrameIndex; i < frames.size(); i++) {
xFrames.add(convert(myDebugProcess, frames.get(i)));
}
container.addStackFrames(xFrames, true);
}
else {
container.addStackFrames(Collections.<XStackFrame>emptyList(), true);
}
}
示例7: computeStackFrames
import com.intellij.xdebugger.frame.XStackFrame; //导入依赖的package包/类
@Override
public void computeStackFrames(int firstFrameIndex, XStackFrameContainer container) {
try {
if (myDebuggerSession.getCurrentState() == Debugger.State.SUSPENDED) {
Debugger.Frame frame = myTopFrame.getFrame();
final List<XStackFrame> frames = new ArrayList<XStackFrame>();
frames.add(myTopFrame);
while (frame != null) {
frame = frame.getPrevious();
if (frame != null) {
frames.add(new XsltStackFrame(frame, myDebuggerSession));
}
}
if (firstFrameIndex <= frames.size()) {
container.addStackFrames(frames.subList(firstFrameIndex, frames.size()), true);
} else {
container.addStackFrames(Collections.<XStackFrame>emptyList(), true);
}
}
} catch (VMPausedException e) {
container.errorOccurred(VMPausedException.MESSAGE);
}
}
示例8: createValueHint
import com.intellij.xdebugger.frame.XStackFrame; //导入依赖的package包/类
public AbstractValueHint createValueHint(@NotNull final Project project, @NotNull final Editor editor, @NotNull final Point point, final ValueHintType type) {
final XDebugSession session = XDebuggerManager.getInstance(project).getCurrentSession();
if (session == null) return null;
XStackFrame stackFrame = session.getCurrentStackFrame();
if (stackFrame == null) return null;
final XDebuggerEvaluator evaluator = stackFrame.getEvaluator();
if (evaluator == null) return null;
return PsiDocumentManager.getInstance(project).commitAndRunReadAction(new Computable<XValueHint>() {
public XValueHint compute() {
int offset = AbstractValueHint.calculateOffset(editor, point);
TextRange range = getExpressionRange(evaluator, project, type, editor, offset);
if (range == null) return null;
int textLength = editor.getDocument().getTextLength();
if (range.getStartOffset() > range.getEndOffset() || range.getStartOffset() < 0 || range.getEndOffset() > textLength) {
LOG.error("invalid range: " + range + ", text length = " + textLength + ", evaluator: " + evaluator);
return null;
}
return new XValueHint(project, editor, point, type, range, evaluator, session);
}
});
}
示例9: getTextToEvaluate
import com.intellij.xdebugger.frame.XStackFrame; //导入依赖的package包/类
@Nullable
private static String getTextToEvaluate(DataContext dataContext, XDebugSession session) {
final Editor editor = PlatformDataKeys.EDITOR.getData(dataContext);
if (editor == null) {
return null;
}
String text = editor.getSelectionModel().getSelectedText();
if (text == null && session.isSuspended()) {
final XStackFrame stackFrame = session.getCurrentStackFrame();
if (stackFrame != null) {
final XDebuggerEvaluator evaluator = stackFrame.getEvaluator();
if (evaluator != null) {
final int offset = editor.getCaretModel().getOffset();
final Document document = editor.getDocument();
final TextRange textRange = evaluator.getExpressionRangeAtOffset(session.getProject(), document, offset, false);
if (textRange != null) {
text = document.getText(textRange);
}
}
}
}
return StringUtil.isEmptyOrSpaces(text) ? null : text;
}
示例10: rebuildView
import com.intellij.xdebugger.frame.XStackFrame; //导入依赖的package包/类
protected void rebuildView(final SessionEvent event) {
XStackFrame stackFrame = mySession.getCurrentStackFrame();
XDebuggerTree tree = myTreePanel.getTree();
if (event == SessionEvent.BEFORE_RESUME || event == SessionEvent.SETTINGS_CHANGED) {
if (myTreeRestorer != null) {
myTreeRestorer.dispose();
}
myTreeState = XDebuggerTreeState.saveState(tree);
if (event == SessionEvent.BEFORE_RESUME) {
return;
}
}
if (stackFrame != null) {
tree.setSourcePosition(stackFrame.getSourcePosition());
myRootNode.updateWatches(stackFrame.getEvaluator());
if (myTreeState != null) {
myTreeRestorer = myTreeState.restoreState(tree);
}
}
else {
tree.setSourcePosition(null);
myRootNode.updateWatches(null);
}
}
示例11: updateFrames
import com.intellij.xdebugger.frame.XStackFrame; //导入依赖的package包/类
private void updateFrames(final XExecutionStack executionStack) {
if (mySelectedStack == executionStack) {
return;
}
if (mySelectedStack != null) {
getOrCreateBuilder(mySelectedStack).stop();
}
mySelectedStack = executionStack;
if (executionStack != null) {
StackFramesListBuilder builder = getOrCreateBuilder(executionStack);
builder.initModel(myFramesList.getModel());
builder.start();
XStackFrame topFrame = executionStack.getTopFrame();
if (topFrame != null) {
myFramesList.setSelectedValue(topFrame, true);
onFrameSelected(executionStack, topFrame);
}
}
}
示例12: computeStackFrames
import com.intellij.xdebugger.frame.XStackFrame; //导入依赖的package包/类
@Override
public void computeStackFrames(int firstFrameIndex, XStackFrameContainer container) {
try {
if (myDebuggerSession.getCurrentState() == Debugger.State.SUSPENDED) {
Debugger.Frame frame = myTopFrame.getFrame();
final List<XStackFrame> frames = new ArrayList<XStackFrame>();
while (frame != null) {
frame = frame.getPrevious();
if (frame != null) {
frames.add(new XsltStackFrame(frame, myDebuggerSession));
}
}
if (firstFrameIndex <= frames.size()) {
container.addStackFrames(frames.subList(firstFrameIndex - 1, frames.size()), true);
} else {
container.addStackFrames(Collections.<XStackFrame>emptyList(), true);
}
}
} catch (VMPausedException e) {
container.errorOccurred(VMPausedException.MESSAGE);
}
}
示例13: calcTopFrame
import com.intellij.xdebugger.frame.XStackFrame; //导入依赖的package包/类
@Nullable
private XStackFrame calcTopFrame()
{
try
{
DotNetVirtualMachineUtil.checkCallForUIThread();
List<DotNetStackFrameProxy> frames = myThreadProxy.getFrames();
DotNetStackFrameProxy frame = ArrayUtil2.safeGet(frames, 0);
if(frame == null)
{
return null;
}
return myTopFrame = new DotNetStackFrame(myDebuggerContext, frame);
}
catch(DotNetNotSuspendedException ignored)
{
return null;
}
finally
{
myTopFrameCalculated = true;
}
}
示例14: WatchesRootNode
import com.intellij.xdebugger.frame.XStackFrame; //导入依赖的package包/类
public WatchesRootNode(@Nonnull XDebuggerTree tree,
@Nonnull XWatchesView watchesView,
@Nonnull XExpression[] expressions,
@Nullable XStackFrame stackFrame,
boolean watchesInVariables) {
super(tree, null, new XValueContainer() {
@Override
public void computeChildren(@Nonnull XCompositeNode node) {
if (stackFrame != null && watchesInVariables) {
stackFrame.computeChildren(node);
}
else {
node.addChildren(XValueChildrenList.EMPTY, true);
}
}
});
setLeaf(false);
myWatchesView = watchesView;
myChildren = ContainerUtil.newArrayList();
for (XExpression watchExpression : expressions) {
myChildren.add(new WatchNodeImpl(myTree, this, watchExpression, stackFrame));
}
}
示例15: addWatchExpression
import com.intellij.xdebugger.frame.XStackFrame; //导入依赖的package包/类
public void addWatchExpression(@Nullable XStackFrame stackFrame,
@Nonnull XExpression expression,
int index,
boolean navigateToWatchNode) {
WatchNodeImpl message = new WatchNodeImpl(myTree, this, expression, stackFrame);
if (index == -1) {
myChildren.add(message);
index = myChildren.size() - 1;
}
else {
myChildren.add(index, message);
}
fireNodeInserted(index);
TreeUtil.selectNode(myTree, message);
if (navigateToWatchNode) {
myTree.scrollPathToVisible(message.getPath());
}
}