IDEA-140152 In the debug window gear menu, the current state of the watching method...
authorEgor.Ushakov <egor.ushakov@jetbrains.com>
Thu, 14 May 2015 14:56:09 +0000 (17:56 +0300)
committerEgor.Ushakov <egor.ushakov@jetbrains.com>
Thu, 14 May 2015 14:56:09 +0000 (17:56 +0300)
java/debugger/impl/src/com/intellij/debugger/engine/JavaDebugProcess.java
resources-en/src/messages/DebuggerBundle.properties

index 5dd4279b3cd1139585ecd89fe6c3b679b7267e66..36aff625f28034c66827d5d1d0de440ba3c6ca3a 100644 (file)
@@ -329,18 +329,10 @@ public class JavaDebugProcess extends XDebugProcess {
     private volatile boolean myAutoModeEnabled;
 
     public AutoVarsSwitchAction() {
-      super("", "", AllIcons.Debugger.AutoVariablesMode);
+      super(DebuggerBundle.message("action.auto.variables.mode"), DebuggerBundle.message("action.auto.variables.mode.description"), null);
       myAutoModeEnabled = DebuggerSettings.getInstance().AUTO_VARIABLES_MODE;
     }
 
-    @Override
-    public void update(@NotNull final AnActionEvent e) {
-      super.update(e);
-      final Presentation presentation = e.getPresentation();
-      final boolean autoModeEnabled = Boolean.TRUE.equals(presentation.getClientProperty(SELECTED_PROPERTY));
-      presentation.setText(autoModeEnabled ? "All-Variables Mode" : "Auto-Variables Mode");
-    }
-
     @Override
     public boolean isSelected(AnActionEvent e) {
       return myAutoModeEnabled;
@@ -356,15 +348,13 @@ public class JavaDebugProcess extends XDebugProcess {
 
   private static class WatchLastMethodReturnValueAction extends ToggleAction {
     private volatile boolean myWatchesReturnValues;
-    private final String myTextEnable;
+    private final String myText;
     private final String myTextUnavailable;
-    private final String myMyTextDisable;
 
     public WatchLastMethodReturnValueAction() {
       super("", DebuggerBundle.message("action.watch.method.return.value.description"), null);
       myWatchesReturnValues = DebuggerSettings.getInstance().WATCH_RETURN_VALUES;
-      myTextEnable = DebuggerBundle.message("action.watches.method.return.value.enable");
-      myMyTextDisable = DebuggerBundle.message("action.watches.method.return.value.disable");
+      myText = DebuggerBundle.message("action.watches.method.return.value.enable");
       myTextUnavailable = DebuggerBundle.message("action.watches.method.return.value.unavailable.reason");
     }
 
@@ -372,12 +362,10 @@ public class JavaDebugProcess extends XDebugProcess {
     public void update(@NotNull final AnActionEvent e) {
       super.update(e);
       final Presentation presentation = e.getPresentation();
-      final boolean watchValues = Boolean.TRUE.equals(presentation.getClientProperty(SELECTED_PROPERTY));
       DebugProcessImpl process = getCurrentDebugProcess(e.getProject());
-      final String actionText = watchValues ? myMyTextDisable : myTextEnable;
       if (process == null || process.canGetMethodReturnValue()) {
         presentation.setEnabled(true);
-        presentation.setText(actionText);
+        presentation.setText(myText);
       }
       else {
         presentation.setEnabled(false);
index 55687bf4d04d1acd0e448a12ee0782c42e38420f..929447158cd452a84a017b5fd36cf72e77efa67b 100644 (file)
@@ -444,6 +444,8 @@ action.watch.method.return.value.description=Enables watching last executed meth
 action.watches.method.return.value.enable=Watch method return values
 action.watches.method.return.value.disable=Stop watching method return values
 action.watches.method.return.value.unavailable.reason=Feature is not supported by the target VM
+action.auto.variables.mode=Auto-Variables Mode
+action.auto.variables.mode.description=Show only variables used near the execution point
 action.maximizeContent.text
 breakpoint.properties.panel.option.depends.disable.again=Disable again
 breakpoint.properties.panel.option.depends.leave.enabled=Leave enabled