xdebugger: implemented standalone variables view

This commit is contained in:
nik
2013-09-18 12:09:11 +04:00
parent 93a2c9ef22
commit 2ff3757c27
6 changed files with 74 additions and 64 deletions
@@ -24,6 +24,7 @@ import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.MessageType;
import com.intellij.xdebugger.breakpoints.XBreakpoint;
import com.intellij.xdebugger.breakpoints.XLineBreakpoint;
import com.intellij.xdebugger.frame.XExecutionStack;
import com.intellij.xdebugger.frame.XStackFrame;
import com.intellij.xdebugger.frame.XSuspendContext;
import com.intellij.xdebugger.stepping.XSmartStepIntoHandler;
@@ -42,7 +43,7 @@ import javax.swing.event.HyperlinkListener;
*
* @author nik
*/
public interface XDebugSession extends XStackFrameAwareSession {
public interface XDebugSession extends AbstractDebuggerSession {
@NotNull
Project getProject();
@@ -76,6 +77,8 @@ public interface XDebugSession extends XStackFrameAwareSession {
void showExecutionPoint();
void setCurrentStackFrame(@NotNull XExecutionStack executionStack, @NotNull XStackFrame frame);
/**
* @deprecated use {@link #setCurrentStackFrame(com.intellij.xdebugger.frame.XExecutionStack, com.intellij.xdebugger.frame.XStackFrame)} instead
*/
@@ -1,50 +0,0 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.xdebugger;
import com.intellij.openapi.project.Project;
import com.intellij.xdebugger.XDebugSessionListener;
import com.intellij.xdebugger.evaluation.XDebuggerEditorsProvider;
import com.intellij.xdebugger.frame.XExecutionStack;
import com.intellij.xdebugger.frame.XStackFrame;
import com.intellij.xdebugger.frame.XSuspendContext;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* Debugger session aware of stack frame
*
* @author traff
*/
public interface XStackFrameAwareSession extends AbstractDebuggerSession {
Project getProject();
void addSessionListener(XDebugSessionListener listener);
void removeSessionListener(XDebugSessionListener listener);
@NotNull
XDebuggerEditorsProvider getEditorsProvider();
@Nullable
XStackFrame getCurrentStackFrame();
void setCurrentStackFrame(@NotNull XExecutionStack executionStack, @NotNull XStackFrame frame);
void reportError(String message);
@Nullable
XSuspendContext getSuspendContext();
}
@@ -48,7 +48,6 @@ import com.intellij.util.SmartList;
import com.intellij.util.ui.UIUtil;
import com.intellij.xdebugger.*;
import com.intellij.xdebugger.breakpoints.*;
import com.intellij.xdebugger.evaluation.XDebuggerEditorsProvider;
import com.intellij.xdebugger.evaluation.XDebuggerEvaluator;
import com.intellij.xdebugger.frame.XExecutionStack;
import com.intellij.xdebugger.frame.XStackFrame;
@@ -397,12 +396,6 @@ public class XDebugSessionImpl implements XDebugSession {
myDispatcher.removeListener(listener);
}
@NotNull
@Override
public XDebuggerEditorsProvider getEditorsProvider() {
return myDebugProcess.getEditorsProvider();
}
@Override
public void setBreakpointMuted(boolean muted) {
if (myBreakpointsMuted == muted) return;
@@ -18,7 +18,7 @@ package com.intellij.xdebugger.impl.frame;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.util.Disposer;
import com.intellij.ui.AppUIUtil;
import com.intellij.xdebugger.XStackFrameAwareSession;
import com.intellij.xdebugger.XDebugSession;
import com.intellij.xdebugger.XDebugSessionAdapter;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -29,10 +29,10 @@ import org.jetbrains.annotations.Nullable;
public abstract class XDebugViewBase implements Disposable {
protected enum SessionEvent {PAUSED, BEFORE_RESUME, RESUMED, STOPPED, FRAME_CHANGED, SETTINGS_CHANGED}
protected final XStackFrameAwareSession mySession;
protected final XDebugSession mySession;
private final MyDebugSessionListener mySessionListener;
public XDebugViewBase(@NotNull final XStackFrameAwareSession session, @Nullable Disposable parentDisposable) {
public XDebugViewBase(@NotNull final XDebugSession session, @Nullable Disposable parentDisposable) {
mySession = session;
mySessionListener = new MyDebugSessionListener();
mySession.addSessionListener(mySessionListener);
@@ -0,0 +1,65 @@
/*
* Copyright 2000-2013 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.xdebugger.impl.frame;
import com.intellij.openapi.Disposable;
import com.intellij.openapi.project.Project;
import com.intellij.xdebugger.XDebuggerBundle;
import com.intellij.xdebugger.evaluation.XDebuggerEditorsProvider;
import com.intellij.xdebugger.frame.XStackFrame;
import com.intellij.xdebugger.impl.actions.XDebuggerActions;
import com.intellij.xdebugger.impl.ui.tree.XDebuggerTree;
import com.intellij.xdebugger.impl.ui.tree.XDebuggerTreePanel;
import com.intellij.xdebugger.impl.ui.tree.nodes.MessageTreeNode;
import com.intellij.xdebugger.impl.ui.tree.nodes.XStackFrameNode;
import org.jetbrains.annotations.NotNull;
import javax.swing.*;
/**
* @author nik
*/
public class XStandaloneVariablesView implements Disposable {
private final XDebuggerTreePanel myDebuggerTreePanel;
public XStandaloneVariablesView(@NotNull Project project, @NotNull XDebuggerEditorsProvider editorsProvider) {
myDebuggerTreePanel = new XDebuggerTreePanel(project, editorsProvider, this, null, XDebuggerActions.VARIABLES_TREE_POPUP_GROUP, null);
getTree().getEmptyText().setText(XDebuggerBundle.message("debugger.variables.not.available"));
}
public void showVariables(@NotNull XStackFrame stackFrame) {
getTree().setSourcePosition(stackFrame.getSourcePosition());
getTree().setRoot(new XStackFrameNode(getTree(), stackFrame), false);
}
public void showMessage(@NotNull String message) {
getTree().setSourcePosition(null);
getTree().setRoot(MessageTreeNode.createInfoMessage(getTree(), message), true);
}
private XDebuggerTree getTree() {
return myDebuggerTreePanel.getTree();
}
@Override
public void dispose() {
}
public JComponent getPanel() {
return myDebuggerTreePanel.getMainPanel();
}
}
@@ -20,7 +20,6 @@ import com.intellij.openapi.Disposable;
import com.intellij.xdebugger.XDebugProcess;
import com.intellij.xdebugger.XDebugSession;
import com.intellij.xdebugger.XDebuggerBundle;
import com.intellij.xdebugger.XStackFrameAwareSession;
import com.intellij.xdebugger.evaluation.XDebuggerEditorsProvider;
import com.intellij.xdebugger.frame.XStackFrame;
import com.intellij.xdebugger.impl.XDebugSessionImpl;
@@ -47,9 +46,9 @@ public class XVariablesView extends XDebugViewBase {
private Object myFrameEqualityObject;
private XDebuggerTreeRestorer myTreeRestorer;
public XVariablesView(@NotNull XStackFrameAwareSession session, @Nullable final Disposable parentDisposable) {
public XVariablesView(@NotNull XDebugSession session, @Nullable final Disposable parentDisposable) {
super(session, parentDisposable);
XDebuggerEditorsProvider editorsProvider = session.getEditorsProvider();
XDebuggerEditorsProvider editorsProvider = session.getDebugProcess().getEditorsProvider();
XValueMarkers<?,?> markers = session instanceof XDebugSessionImpl ? ((XDebugSessionImpl)session).getValueMarkers() : null;
myDebuggerTreePanel = new XDebuggerTreePanel(session.getProject(), editorsProvider, this, null, XDebuggerActions.VARIABLES_TREE_POPUP_GROUP, markers);
myDebuggerTreePanel.getTree().getEmptyText().setText(XDebuggerBundle.message("debugger.variables.not.available"));