IDEA-140152 In the debug window gear menu, the current state of the watching method return values and auto variables mode selections is unclear

This commit is contained in:
Egor.Ushakov
2015-05-14 17:56:09 +03:00
parent d9be1f18f9
commit d8b18795a8
2 changed files with 6 additions and 16 deletions
@@ -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);
@@ -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