AddToWatches action should be available in the Inspect pop-up too

This commit is contained in:
Vladimir Krivosheev
2013-08-30 15:55:37 +02:00
parent a8fdca890b
commit 97c8241d97
4 changed files with 6 additions and 6 deletions
@@ -124,6 +124,7 @@ public class AddToWatchActionHandler extends DebuggerActionHandler {
myWatchPanel = watchPanel;
}
@Override
public void threadAction() {
final DebuggerSession session = myDebuggerContext.getDebuggerSession();
if (session == null) {
@@ -136,6 +137,7 @@ public class AddToWatchActionHandler extends DebuggerActionHandler {
final TextWithImports expression = DebuggerTreeNodeExpression.createEvaluationText(node, myDebuggerContext);
if (expression != null) {
DebuggerInvocationUtil.swingInvokeLater(project, new Runnable() {
@Override
public void run() {
doAddWatch(myWatchPanel, expression, descriptor);
}
@@ -144,6 +146,7 @@ public class AddToWatchActionHandler extends DebuggerActionHandler {
}
catch (final EvaluateException e) {
DebuggerInvocationUtil.swingInvokeLater(project, new Runnable() {
@Override
public void run() {
Messages.showErrorDialog(project, e.getMessage(), ActionsBundle.actionText(XDebuggerActions.ADD_TO_WATCH));
}
@@ -152,8 +155,10 @@ public class AddToWatchActionHandler extends DebuggerActionHandler {
}
}
@Override
protected void commandCancelled() {
DebuggerInvocationUtil.swingInvokeLater(myDebuggerContext.getProject(), new Runnable() {
@Override
public void run() {
for (DebuggerTreeNodeImpl node : mySelectedNodes) {
final NodeDescriptorImpl descriptor = node.getDescriptor();
@@ -722,10 +722,6 @@
<group id="XDebugger.Inspect.Tree.Popup">
<reference ref="XDebugger.ValueGroup"/>
</group>
<group id="XDebugger.Value.Hint.Tree.Popup">
<reference ref="XDebugger.ValueGroup"/>
<reference ref="XDebugger.AddToWatches"/>
</group>
@@ -47,7 +47,6 @@ public interface XDebuggerActions {
@NonNls String VARIABLES_TREE_POPUP_GROUP = "XDebugger.Variables.Tree.Popup";
@NonNls String WATCHES_TREE_POPUP_GROUP = "XDebugger.Watches.Tree.Popup";
@NonNls String WATCHES_TREE_TOOLBAR_GROUP = "XDebugger.Watches.Tree.Toolbar";
@NonNls String VALUE_HINT_TREE_POPUP_GROUP = "XDebugger.Value.Hint.Tree.Popup";
@NonNls String ADD_TO_WATCH = "Debugger.AddToWatch";
@@ -132,7 +132,7 @@ public class XValueHint extends AbstractValueHint {
private void showTree(final XValue value, final String name) {
XDebuggerTree tree = new XDebuggerTree(myDebugSession, myDebugSession.getDebugProcess().getEditorsProvider(),
myDebugSession.getCurrentPosition(), XDebuggerActions.VALUE_HINT_TREE_POPUP_GROUP);
myDebugSession.getCurrentPosition(), XDebuggerActions.INSPECT_TREE_POPUP_GROUP);
tree.getModel().addTreeModelListener(createTreeListener(tree));
XValueHintTreeComponent component = new XValueHintTreeComponent(this, tree, Pair.create(value, name));
showTreePopup(component, tree, name);