IDEA-140303 Improve debugger settings popup wording

This commit is contained in:
Egor.Ushakov
2015-05-18 14:04:27 +03:00
parent fcdfc38e45
commit a7712a63c2
9 changed files with 112 additions and 42 deletions
@@ -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 {
@@ -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
@@ -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
@@ -794,10 +794,13 @@
</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">
@@ -13,25 +13,9 @@
<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"/>
@@ -39,12 +23,62 @@
</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>
@@ -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.
@@ -15,17 +15,28 @@
*/
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);
}
}
@@ -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);
@@ -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();
@@ -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