IDEA-140303 Improve debugger settings popup wording
authorEgor.Ushakov <egor.ushakov@jetbrains.com>
Mon, 18 May 2015 10:59:28 +0000 (13:59 +0300)
committerEgor.Ushakov <egor.ushakov@jetbrains.com>
Mon, 18 May 2015 11:04:27 +0000 (14:04 +0300)
java/debugger/impl/src/com/intellij/debugger/engine/JavaDebugProcess.java
platform/platform-resources-en/src/messages/ActionsBundle.properties
platform/platform-resources-en/src/messages/XDebuggerBundle.properties
platform/platform-resources/src/idea/LangActions.xml
platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/DataViewsConfigurableUi.form
platform/xdebugger-impl/src/com/intellij/xdebugger/impl/settings/DataViewsConfigurableUi.java
platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/XDebugSessionTab.java
platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/tree/actions/SortValuesToggleAction.java
resources-en/src/messages/DebuggerBundle.properties

index 36aff625f28034c66827d5d1d0de440ba3c6ca3a..b65f977ede756946703d27b0f1c41857b7e4177e 100644 (file)
@@ -321,8 +321,9 @@ public class JavaDebugProcess extends XDebugProcess {
     leftToolbar.add(ActionManager.getInstance().getAction(DebuggerActions.DUMP_THREADS), beforeRunner);
     leftToolbar.add(Separator.getInstance(), beforeRunner);
 
-    settings.addAction(new AutoVarsSwitchAction(), Constraints.FIRST);
-    settings.addAction(new WatchLastMethodReturnValueAction(), Constraints.FIRST);
+    Constraints beforeSort = new Constraints(Anchor.BEFORE, "XDebugger.ToggleSortValues");
+    settings.addAction(new WatchLastMethodReturnValueAction(), beforeSort);
+    settings.addAction(new AutoVarsSwitchAction(), beforeSort);
   }
 
   private static class AutoVarsSwitchAction extends ToggleAction {
index 8afc312c83034c4027207726c4d61ac26d012227..f453a681c7d1db5494ef964c339deeef8e33fd4e 100644 (file)
@@ -982,11 +982,11 @@ action.XDebugger.NewWatch.text=New Watch...
 action.XDebugger.EditWatch.text=Edit...
 action.XDebugger.AutoTooltip.text=Value auto tooltip
 action.XDebugger.AutoTooltip.description=Toggles if value tooltip is shown automatically on mouse over
-action.XDebugger.Inline.text=Show values in editor
+action.XDebugger.Inline.text=Show Values Inline
 action.XDebugger.Inline.description=Show available debugger session values inside editor
 action.XDebugger.AutoTooltipOnSelection.text=Show value on selection change
 action.XDebugger.AutoTooltipOnSelection.description=Toggles if value tooltip is shown automatically on selection change in editor
-action.XDebugger.ToggleSortValues.text=Sort values alphabetically
+action.XDebugger.ToggleSortValues.text=Sort Values Alphabetically
 action.XDebugger.ToggleSortValues.description=Sort values alphabetically in debugger views
 group.XDebugger.settings.text=Settings
 
@@ -1020,7 +1020,7 @@ action.Debugger.MarkObject.unmark.text=Unmark Object
 action.Debugger.MarkObject.description=Mark/unmark the object so that it can be visually distinguished in in debugger views
 action.Debugger.AddToWatch.text=Add to Watches
 action.Debugger.EvaluateInConsole.text=Evaluate in Console
-action.Debugger.UnmuteOnStop.text=Unmute breakpoints on session finish
+action.XDebugger.UnmuteOnStop.text=Unmute Breakpoints on Session Finish
 action.Debugger.AutoRenderer.text=Auto
 group.EditorPopupMenu.text=Editor Popup Menu
 group.EditorPopupMenu.description=Editor Popup Menu
index 7a7d8c67f0d5a2e079934185a268bc880d7fa086..cfeb8209caa789040eab1b2a1c355f3409cc78cb 100644 (file)
@@ -128,3 +128,6 @@ setting.focus.app.on.breakpoint.label=Focus application on breakpoint
 settings.show.window.label=Show &debug window on breakpoint
 
 showReferring.dialog.title=Referring Objects For {0}
+settings.show.values.inline=Show values inline
+settings.show.value.tooltip=Show value tooltip.
+settings.show.tooltip.on.selection=Show value tooltip on code selection
index 3f8edd619620e6d621884a70ff712b58babd9e05..36671e305f56bc35dbdfb96ac9c0e0657e4006de 100644 (file)
     </group>
 
     <group id="XDebugger.Settings" icon="AllIcons.General.SecondaryGroup" popup="true">
-      <action id="Debugger.UnmuteOnStop" class="com.intellij.xdebugger.impl.actions.UnmuteOnStopAction"/>
       <action id="XDebugger.Inline" class="com.intellij.xdebugger.impl.actions.UseInlineDebuggerAction"/>
-      <action id="XDebugger.AutoTooltip" class="com.intellij.xdebugger.impl.actions.ValueTooltipAutoShowAction"/>
-      <action id="XDebugger.AutoTooltipOnSelection" class="com.intellij.xdebugger.impl.actions.ValueTooltipAutoShowOnSelectionAction"/>
+      <separator/>
+      <reference ref="XDebugger.ToggleSortValues"/>
+      <!--<action id="XDebugger.AutoTooltip" class="com.intellij.xdebugger.impl.actions.ValueTooltipAutoShowAction"/>-->
+      <!--<action id="XDebugger.AutoTooltipOnSelection" class="com.intellij.xdebugger.impl.actions.ValueTooltipAutoShowOnSelectionAction"/>-->
+      <separator/>
+      <action id="XDebugger.UnmuteOnStop" class="com.intellij.xdebugger.impl.actions.UnmuteOnStopAction" />
     </group>
 
     <group id="RunnerLayoutActions">
index a6e3f94f3bec8da664840b1024e2688251c7d393..005e5aed54e3fea0861091d1d0d5f12bb4caeb2f 100644 (file)
           <grid row="3" column="0" row-span="1" col-span="2" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
         </constraints>
       </vspacer>
-      <component id="9a000" class="javax.swing.JLabel">
-        <constraints>
-          <grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
-        </constraints>
-        <properties>
-          <text resource-bundle="messages/XDebuggerBundle" key="setting.value.tooltip.delay.label"/>
-        </properties>
-      </component>
-      <component id="fdcd5" class="javax.swing.JFormattedTextField" binding="valueTooltipDelayTextField">
-        <constraints>
-          <grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
-        </constraints>
-        <properties>
-          <columns value="4"/>
-        </properties>
-      </component>
       <component id="98130" class="javax.swing.JCheckBox" binding="enableAutoExpressionsCheckBox">
         <constraints>
-          <grid row="2" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+          <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
         </constraints>
         <properties>
           <text resource-bundle="messages/XDebuggerBundle" key="setting.enable.auto.expressions.label"/>
       </component>
       <component id="a57b4" class="javax.swing.JCheckBox" binding="sortAlphabeticallyCheckBox" default-binding="true">
         <constraints>
-          <grid row="1" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+          <grid row="0" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
         </constraints>
         <properties>
           <text resource-bundle="messages/XDebuggerBundle" key="setting.sort.alphabetically.label"/>
         </properties>
       </component>
+      <grid id="a4cab" binding="myEditorSettingsPanel" custom-create="true" layout-manager="GridLayoutManager" row-count="3" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
+        <margin top="0" left="0" bottom="0" right="0"/>
+        <constraints>
+          <grid row="2" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
+        </constraints>
+        <properties/>
+        <border type="none"/>
+        <children>
+          <component id="4aad4" class="javax.swing.JCheckBox" binding="myShowValuesInlineCheckBox" default-binding="true">
+            <constraints>
+              <grid row="0" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+            </constraints>
+            <properties>
+              <text resource-bundle="messages/XDebuggerBundle" key="settings.show.values.inline"/>
+            </properties>
+          </component>
+          <component id="83498" class="javax.swing.JCheckBox" binding="myShowValueTooltipCheckBox" default-binding="true">
+            <constraints>
+              <grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+            </constraints>
+            <properties>
+              <text resource-bundle="messages/XDebuggerBundle" key="settings.show.value.tooltip"/>
+            </properties>
+          </component>
+          <component id="be332" class="javax.swing.JCheckBox" binding="myShowValueTooltipOnCheckBox" default-binding="true">
+            <constraints>
+              <grid row="2" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+            </constraints>
+            <properties>
+              <text resource-bundle="messages/XDebuggerBundle" key="settings.show.tooltip.on.selection"/>
+            </properties>
+          </component>
+          <component id="e6be7" class="javax.swing.JFormattedTextField" binding="valueTooltipDelayTextField">
+            <constraints>
+              <grid row="1" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+            </constraints>
+            <properties>
+              <columns value="4"/>
+            </properties>
+          </component>
+          <component id="b0718" class="javax.swing.JLabel">
+            <constraints>
+              <grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
+            </constraints>
+            <properties>
+              <text resource-bundle="messages/XDebuggerBundle" key="setting.value.tooltip.delay.label"/>
+            </properties>
+          </component>
+        </children>
+      </grid>
     </children>
   </grid>
 </form>
index 76645db3a3d3274349cd659456d55a8f8e727f21..1b220e800a0037c7fcd2232bfdfdf40db65b586d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2014 JetBrains s.r.o.
+ * Copyright 2000-2015 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.
  */
 package com.intellij.xdebugger.impl.settings;
 
+import com.intellij.openapi.util.registry.Registry;
 import com.intellij.openapi.util.text.StringUtilRt;
+import com.intellij.ui.IdeBorderFactory;
+import com.intellij.ui.border.IdeaTitledBorder;
 import com.intellij.util.ui.UIUtil;
 import org.jetbrains.annotations.NotNull;
 
 import javax.swing.*;
 
 public class DataViewsConfigurableUi {
+  public static final String IDE_DEBUGGER_INLINE_KEY = "ide.debugger.inline";
+  public static final String DEBUGGER_VALUE_TOOLTIP_AUTO_SHOW_KEY = "debugger.valueTooltipAutoShow";
+  public static final String DEBUGGER_VALUE_TOOLTIP_AUTO_SHOW_ON_SELECTION_KEY = "debugger.valueTooltipAutoShowOnSelection";
+
   private JCheckBox enableAutoExpressionsCheckBox;
   private JFormattedTextField valueTooltipDelayTextField;
   private JPanel panel;
   private JCheckBox sortAlphabeticallyCheckBox;
+  private JPanel myEditorSettingsPanel;
+  private JCheckBox myShowValuesInlineCheckBox;
+  private JCheckBox myShowValueTooltipCheckBox;
+  private JCheckBox myShowValueTooltipOnCheckBox;
 
   public DataViewsConfigurableUi() {
     UIUtil.configureNumericFormattedTextField(valueTooltipDelayTextField);
@@ -33,7 +44,8 @@ public class DataViewsConfigurableUi {
 
   private int getValueTooltipDelay() {
     Object value = valueTooltipDelayTextField.getValue();
-    return value instanceof Number ? ((Number)value).intValue() : StringUtilRt.parseInt((String)value, XDebuggerDataViewSettings.DEFAULT_VALUE_TOOLTIP_DELAY);
+    return value instanceof Number ? ((Number)value).intValue() :
+           StringUtilRt.parseInt((String)value, XDebuggerDataViewSettings.DEFAULT_VALUE_TOOLTIP_DELAY);
   }
 
   @NotNull
@@ -44,18 +56,34 @@ public class DataViewsConfigurableUi {
   public boolean isModified(@NotNull XDebuggerDataViewSettings settings) {
     return getValueTooltipDelay() != settings.getValueLookupDelay() ||
            sortAlphabeticallyCheckBox.isSelected() != settings.isSortValues() ||
-           enableAutoExpressionsCheckBox.isSelected() != settings.isAutoExpressions();
+           enableAutoExpressionsCheckBox.isSelected() != settings.isAutoExpressions() ||
+           myShowValuesInlineCheckBox.isSelected() != Registry.is(IDE_DEBUGGER_INLINE_KEY) ||
+           myShowValuesInlineCheckBox.isSelected() != Registry.is(DEBUGGER_VALUE_TOOLTIP_AUTO_SHOW_KEY) ||
+           myShowValueTooltipOnCheckBox.isSelected() != Registry.is(DEBUGGER_VALUE_TOOLTIP_AUTO_SHOW_ON_SELECTION_KEY);
   }
 
   public void reset(@NotNull XDebuggerDataViewSettings settings) {
     valueTooltipDelayTextField.setValue(settings.getValueLookupDelay());
     sortAlphabeticallyCheckBox.setSelected(settings.isSortValues());
     enableAutoExpressionsCheckBox.setSelected(settings.isAutoExpressions());
+    myShowValuesInlineCheckBox.setSelected(Registry.is(IDE_DEBUGGER_INLINE_KEY));
+    myShowValueTooltipCheckBox.setSelected(Registry.is(DEBUGGER_VALUE_TOOLTIP_AUTO_SHOW_KEY));
+    myShowValueTooltipOnCheckBox.setSelected(Registry.is(DEBUGGER_VALUE_TOOLTIP_AUTO_SHOW_ON_SELECTION_KEY));
   }
 
   public void apply(@NotNull XDebuggerDataViewSettings settings) {
     settings.setValueLookupDelay(getValueTooltipDelay());
     settings.setSortValues(sortAlphabeticallyCheckBox.isSelected());
     settings.setAutoExpressions(enableAutoExpressionsCheckBox.isSelected());
+    Registry.get(IDE_DEBUGGER_INLINE_KEY).setValue(myShowValuesInlineCheckBox.isSelected());
+    Registry.get(DEBUGGER_VALUE_TOOLTIP_AUTO_SHOW_KEY).setValue(myShowValueTooltipCheckBox.isSelected());
+    Registry.get(DEBUGGER_VALUE_TOOLTIP_AUTO_SHOW_ON_SELECTION_KEY).setValue(myShowValueTooltipOnCheckBox.isSelected());
+  }
+
+  private void createUIComponents() {
+    myEditorSettingsPanel = new JPanel();
+    IdeaTitledBorder titledBorder = IdeBorderFactory.createTitledBorder("Editor", false);
+    myEditorSettingsPanel.setBorder(titledBorder);
+    titledBorder.acceptMinimumSize(myEditorSettingsPanel);
   }
 }
\ No newline at end of file
index 349b64742446ee5b4b3e191ec6653ac255e96d4a..b35b150c82f3e11e30ba9811b518ace96fbdf672 100644 (file)
@@ -267,16 +267,7 @@ public class XDebugSessionTab extends DebuggerSessionTabBase {
     final AnAction[] commonSettings = myUi.getOptions().getSettingsActionsList();
     DefaultActionGroup settings = new DefaultActionGroup(ActionsBundle.message("group.XDebugger.settings.text"), true);
     settings.getTemplatePresentation().setIcon(myUi.getOptions().getSettingsActions().getTemplatePresentation().getIcon());
-    if (commonSettings.length > 0) {
-      for (AnAction each : commonSettings) {
-        settings.add(each);
-      }
-      settings.addSeparator();
-    }
-    if (!session.getDebugProcess().isValuesCustomSorted()) {
-      settings.add(new ToggleSortValuesAction(commonSettings.length == 0));
-    }
-
+    settings.addAll(commonSettings);
     leftToolbar.add(settings);
 
     leftToolbar.addSeparator();
@@ -316,7 +307,7 @@ public class XDebugSessionTab extends DebuggerSessionTabBase {
     }
 
     @Override
-    public void update(AnActionEvent e) {
+    public void update(@NotNull AnActionEvent e) {
       super.update(e);
       if (!myShowIcon) {
         e.getPresentation().setIcon(null);
index e399dbd96ebaeb0e65c168fd227d114032b63097..3adade0fedb2577d703957100f52cc34d9047dfa 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2000-2011 JetBrains s.r.o.
+ * Copyright 2000-2015 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.
@@ -18,13 +18,23 @@ package com.intellij.xdebugger.impl.ui.tree.actions;
 import com.intellij.openapi.actionSystem.AnActionEvent;
 import com.intellij.openapi.actionSystem.ToggleAction;
 import com.intellij.openapi.project.DumbAware;
+import com.intellij.xdebugger.XDebugSession;
 import com.intellij.xdebugger.impl.XDebuggerUtilImpl;
 import com.intellij.xdebugger.impl.settings.XDebuggerSettingsManager;
+import org.jetbrains.annotations.NotNull;
 
 /**
  * @author nik
  */
 public class SortValuesToggleAction extends ToggleAction implements DumbAware {
+
+  @Override
+  public void update(@NotNull AnActionEvent e) {
+    super.update(e);
+    XDebugSession session = XDebugSession.DATA_KEY.getData(e.getDataContext());
+    e.getPresentation().setEnabledAndVisible(session != null && !session.getDebugProcess().isValuesCustomSorted());
+  }
+
   @Override
   public boolean isSelected(AnActionEvent e) {
     return XDebuggerSettingsManager.getInstanceImpl().getDataViewSettings().isSortValues();
index 929447158cd452a84a017b5fd36cf72e77efa67b..dfc2a108eaeaaae89015791838e27af831f7cf95 100644 (file)
@@ -441,7 +441,7 @@ action.show.watches.description=Shows or hides 'watches' pane
 action.show.watches.text.hide=Hide Watches
 action.show.watches.text.show=Show Watches
 action.watch.method.return.value.description=Enables watching last executed method return value
-action.watches.method.return.value.enable=Watch method return values
+action.watches.method.return.value.enable=Show 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