Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Swanson2002-04-05 02:52:28 +0000
committerDarin Swanson2002-04-05 02:52:28 +0000
commitbc0466a376915c067abbedd60efd00318aab54c5 (patch)
tree290d91a2e6ec2f32dd022b5114dd8d8a2248d41e /org.eclipse.debug.ui/ui/org
parent2055b52c020641fdc8e38e76f79bd124b9860a80 (diff)
downloadeclipse.platform.debug-bc0466a376915c067abbedd60efd00318aab54c5.tar.gz
eclipse.platform.debug-bc0466a376915c067abbedd60efd00318aab54c5.tar.xz
eclipse.platform.debug-bc0466a376915c067abbedd60efd00318aab54c5.zip
Bug 10282 - Rendering of changed variables
Diffstat (limited to 'org.eclipse.debug.ui/ui/org')
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ColorManager.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ConsolePreferencePage.java15
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPreferencePage.java11
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.properties21
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java18
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IDebugPreferenceConstants.java5
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ConsoleDocument.java10
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/VariablesView.java3
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/VariablesViewer.java126
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java15
10 files changed, 71 insertions, 154 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ColorManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ColorManager.java
index 8ef47a7d9..d99f24965 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ColorManager.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ColorManager.java
@@ -8,6 +8,7 @@ package org.eclipse.debug.internal.ui;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
+
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.widgets.Display;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ConsolePreferencePage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ConsolePreferencePage.java
index bf29748be..1a35d2a60 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ConsolePreferencePage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/ConsolePreferencePage.java
@@ -11,7 +11,6 @@ import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.preference.PreferenceConverter;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.widgets.Composite;
@@ -73,20 +72,6 @@ public class ConsolePreferencePage extends FieldEditorPreferencePage implements
}
/**
- * Returns the a color based on the type of output.
- * Valid types:
- * <li>CONSOLE_SYS_OUT_RGB</li>
- * <li>CONSOLE_SYS_ERR_RGB</li>
- * <li>CONSOLE_SYS_IN_RGB</li>
- */
- public static Color getPreferenceColor(String type) {
- IPreferenceStore pstore= DebugUIPlugin.getDefault().getPreferenceStore();
- RGB outRGB= PreferenceConverter.getColor(pstore, type);
- ColorManager colorManager= DebugUIPlugin.getDefault().getColorManager();
- return colorManager.getColor(outRGB);
- }
-
- /**
* Returns the font data that describes the font to use for the console
*/
public static FontData getConsoleFontData() {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPreferencePage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPreferencePage.java
index 77cbc2d0c..1fbede7fa 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPreferencePage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugPreferencePage.java
@@ -7,10 +7,13 @@ package org.eclipse.debug.internal.ui;
import org.eclipse.debug.ui.IDebugUIConstants;
import org.eclipse.jface.preference.BooleanFieldEditor;
+import org.eclipse.jface.preference.ColorFieldEditor;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
import org.eclipse.jface.preference.RadioGroupFieldEditor;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
@@ -26,6 +29,7 @@ public class DebugPreferencePage extends FieldEditorPreferencePage implements IW
IPreferenceStore store= DebugUIPlugin.getDefault().getPreferenceStore();
setPreferenceStore(store);
+ setDescription("General Settings for Debugging");
}
/**
@@ -51,10 +55,9 @@ public class DebugPreferencePage extends FieldEditorPreferencePage implements IW
},
getFieldEditorParent()));
addField(new BooleanFieldEditor(IDebugUIConstants.PREF_AUTO_BUILD_BEFORE_LAUNCH, DebugUIMessages.getString("DebugPreferencePage.auto_build_before_launch"), SWT.NONE, getFieldEditorParent())); //$NON-NLS-1$
- addField(new BooleanFieldEditor(IDebugUIConstants.PREF_SINGLE_CLICK_LAUNCHING, DebugUIMessages.getString("Enable_&single-click_launching_1"), SWT.NONE, getFieldEditorParent())); //$NON-NLS-1$
+ addField(new BooleanFieldEditor(IDebugUIConstants.PREF_SINGLE_CLICK_LAUNCHING, DebugUIMessages.getString("DebugPreferencePage.Enable_&single-click_launching_1"), SWT.NONE, getFieldEditorParent())); //$NON-NLS-1$
addField(new BooleanFieldEditor(IDebugUIConstants.PREF_AUTO_SHOW_DEBUG_VIEW, DebugUIMessages.getString("DebugPreferencePage.Show_Debug_Perspective_when_a_program_is_launched_in_de&bug_mode_1"), SWT.NONE, getFieldEditorParent())); //$NON-NLS-1$
addField(new BooleanFieldEditor(IDebugUIConstants.PREF_AUTO_SHOW_PROCESS_VIEW, DebugUIMessages.getString("DebugPreferencePage.Show_Debug_Perspective_when_a_program_is_launched_in_&run_mode_2"), SWT.NONE, getFieldEditorParent())); //$NON-NLS-1$
- addField(new BooleanFieldEditor(IDebugUIConstants.PREF_SHOW_VARIABLE_VALUE_CHANGES, DebugUIMessages.getString("DebugPreferencePage.Sho&w_variable_value_changes_in_Variables_and_Expressions_Views_1"), SWT.NONE, getFieldEditorParent())); //$NON-NLS-1$
addField(new BooleanFieldEditor(IDebugUIConstants.PREF_AUTO_REMOVE_OLD_LAUNCHES, DebugUIMessages.getString("DebugPreferencePage.Remove_terminated_launches_when_a_new_launch_is_created_1"), SWT.NONE, getFieldEditorParent())); //$NON-NLS-1$
addField(new RadioGroupFieldEditor(IDebugPreferenceConstants.VARIABLES_DETAIL_PANE_ORIENTATION,
DebugUIMessages.getString("DebugPreferencePage.Orientation_of_detail_pane_in_variables_view_1"), //$NON-NLS-1$
@@ -64,6 +67,8 @@ public class DebugPreferencePage extends FieldEditorPreferencePage implements IW
{DebugUIMessages.getString("DebugPreferencePage.Underneath_the_variables_tree_pane_3"), IDebugPreferenceConstants.VARIABLES_DETAIL_PANE_UNDERNEATH} //$NON-NLS-1$
},
getFieldEditorParent()));
+
+ addField(new ColorFieldEditor(CHANGED_VARIABLE_RGB, "&Changed variable value color:", getFieldEditorParent()));
}
/**
@@ -79,8 +84,8 @@ public class DebugPreferencePage extends FieldEditorPreferencePage implements IW
store.setDefault(IDebugUIConstants.PREF_AUTO_SHOW_DEBUG_VIEW, true);
store.setDefault(IDebugUIConstants.PREF_AUTO_SHOW_PROCESS_VIEW, true);
store.setDefault(IDebugUIConstants.PREF_AUTO_REMOVE_OLD_LAUNCHES, false);
- store.setDefault(IDebugUIConstants.PREF_SHOW_VARIABLE_VALUE_CHANGES, true);
store.setDefault(IDebugPreferenceConstants.VARIABLES_DETAIL_PANE_ORIENTATION, IDebugPreferenceConstants.VARIABLES_DETAIL_PANE_UNDERNEATH);
+ PreferenceConverter.setDefault(store, CHANGED_VARIABLE_RGB, new RGB(255, 0, 0));
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.properties
index 65141932a..570a4d106 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.properties
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIMessages.properties
@@ -26,20 +26,19 @@ ConsoleView.Cut_5=Cut
ConsoleView.Paste_10=Paste
ConsoleView.Paste_Clipboard_Text_11=Paste Clipboard Text
ConsoleView.Select_&All@Ctrl+A_12=Select &All@Ctrl+A
-ConsoleView.Select_All_13=Select All
-ConsoleView.Select_All_14=Select All
+
DebugPreferencePage.auto_build_before_launch=Build (if required) before &launching
DebugPreferencePage.Show_Debug_Perspective_when_a_program_is_launched_in_&run_mode_2=Show Debug Perspective when a program is launched in &run mode
DebugPreferencePage.Show_Debug_Perspective_when_a_program_is_launched_in_de&bug_mode_1=Show Debug Perspective when a program is launched in de&bug mode
DebugPreferencePage.Orientation_of_detail_pane_in_variables_view_1=Orientation of detail pane in variables view
DebugPreferencePage.To_the_right_of_variables_tree_pane_2=&To the right of variables tree pane
-DebugPreferencePage.Underneath_the_variables_tree_pane_3=&Underneath the variables tree pane
-DebugUIPlugin.Exceptions_occurred_switching_to_the_specified_debug_layout._2=Exceptions occurred switching to the specified debug layout.
-DebugUIPlugin.Exceptions_occurred_switching_to_the_specified_debug_layout._4=Exceptions occurred switching to the specified debug layout.
-DebugUIPlugin.Problem_Switching_to_the_Debug_Perspective_1=Problem Switching to the Debug Perspective
-DebugUIPlugin.Problem_Switching_to_the_Debug_Perspective_3=Problem Switching to the Debug Perspective
+DebugPreferencePage.Underneath_the_variables_tree_pane_3=&Underneath the variables tree pane
+DebugPreferencePage.Remove_terminated_launches_when_a_new_launch_is_created_1=Remo&ve terminated launches when a new launch is created
+DebugPreferencePage.Enable_&single-click_launching_1=Enable &single-click launching (configurations only)
+
DebugUIPlugin.Build_error._Check_log_for_details._2=Build error. Check log for details.
-DebugUIPlugin.Run/Debug_1=Run/Debug
+DebugUIPlugin.Run/Debug_1=Run/Debug
+
DefaultLabelProvider.<terminated>_1=<terminated>
DefaultLabelProvider.<disconnected>_1=<disconnected>
DefaultLabelProvider.<unknown>_1=<unknown>
@@ -66,12 +65,8 @@ LaunchWizardSelectionPage.Select_Launcher_1=Select Launcher
LaunchWizardSelectionPage.Select_Launcher_2=Select Launcher
LaunchWizardSelectionPage.Select_a_launcher__3=Select a launcher:
LaunchWizardSelectionPage.Set_as_&default_launcher_for_project___{0}___7=Set as &default launcher for project \"{0}\"
-
-DebugPreferencePage.Remove_terminated_launches_when_a_new_launch_is_created_1=Remo&ve terminated launches when a new launch is created
-DebugPreferencePage.Sho&w_variable_value_changes_in_Variables_and_Expressions_Views_1=Sho&w variable value changes in Variables and Expressions Views
LaunchConfigurationTypesPreferencePage._(default)_1=\ (default)
LaunchConfigurationTypesPreferencePage.File_types_2=&File types:
LaunchConfigurationTypesPreferencePage.Configuration_types_3=&Configuration types:
-LaunchConfigurationTypesPreferencePage.Set_as_default_4=&Set as Default
-Enable_&single-click_launching_1=Enable &single-click launching (configurations only)
+LaunchConfigurationTypesPreferencePage.Set_as_default_4=&Set as Default \ No newline at end of file
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java
index f7ee1c5a0..9be0b0f20 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/DebugUIPlugin.java
@@ -65,6 +65,7 @@ import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
import org.eclipse.jface.resource.ImageRegistry;
import org.eclipse.jface.text.DocumentEvent;
import org.eclipse.jface.text.IDocument;
@@ -72,6 +73,8 @@ import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.swt.custom.BusyIndicator;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IViewPart;
@@ -1540,5 +1543,20 @@ public class DebugUIPlugin extends AbstractUIPlugin implements ILaunchListener,
setEmptyLaunchHistories();
}
}
+
+ /**
+ * Returns the a color based on the type of output.
+ * Valid types:
+ * <li>CONSOLE_SYS_OUT_RGB</li>
+ * <li>CONSOLE_SYS_ERR_RGB</li>
+ * <li>CONSOLE_SYS_IN_RGB</li>
+ * <li>CHANGED_VARIABLE_RGB</li>
+ */
+ public static Color getPreferenceColor(String type) {
+ IPreferenceStore pstore= DebugUIPlugin.getDefault().getPreferenceStore();
+ RGB rgb= PreferenceConverter.getColor(pstore, type);
+ ColorManager colorManager= DebugUIPlugin.getDefault().getColorManager();
+ return colorManager.getColor(rgb);
+ }
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IDebugPreferenceConstants.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IDebugPreferenceConstants.java
index acb3e1c0d..2f73554e7 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IDebugPreferenceConstants.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IDebugPreferenceConstants.java
@@ -49,6 +49,11 @@ public interface IDebugPreferenceConstants {
public static final String VARIABLES_DETAIL_PANE_ORIENTATION = "Variables.detail.orientation"; //$NON-NLS-1$
public static final String VARIABLES_DETAIL_PANE_RIGHT = "Variables.detail.orientation.right"; //$NON-NLS-1$
public static final String VARIABLES_DETAIL_PANE_UNDERNEATH = "Variables.detail.orientation.underneath"; //$NON-NLS-1$
+
+ /**
+ * The RGB for the color to be used to indicate changed variables
+ */
+ public static final String CHANGED_VARIABLE_RGB= "Changed.Variable.RGB";
/**
* The type of launching to perform
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ConsoleDocument.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ConsoleDocument.java
index 8cb681614..b0ee6bc62 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ConsoleDocument.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/ConsoleDocument.java
@@ -18,8 +18,8 @@ import org.eclipse.debug.core.model.IProcess;
import org.eclipse.debug.core.model.IStreamMonitor;
import org.eclipse.debug.core.model.IStreamsProxy;
import org.eclipse.debug.internal.ui.ConsoleOutputTextStore;
-import org.eclipse.debug.internal.ui.ConsolePreferencePage;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.debug.internal.ui.IDebugPreferenceConstants;
import org.eclipse.jface.text.AbstractDocument;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.DefaultLineTracker;
@@ -296,8 +296,8 @@ public class ConsoleDocument extends AbstractDocument implements IDebugEventSetL
if (docLength != fNewStreamWriteEnd) {
StyleRange input=
new StyleRange(fNewStreamWriteEnd, docLength - fNewStreamWriteEnd,
- ConsolePreferencePage.getPreferenceColor(ConsolePreferencePage.CONSOLE_SYS_IN_RGB),
- null);
+ DebugUIPlugin.getPreferenceColor(IDebugPreferenceConstants.CONSOLE_SYS_IN_RGB),
+ null);
if (!fStyleRanges.isEmpty()) {
if (((StyleRange)fStyleRanges.get(fStyleRanges.size() - 1)).similarTo(input)) {
//remove the top "input" range...continuing input
@@ -327,13 +327,13 @@ public class ConsoleDocument extends AbstractDocument implements IDebugEventSetL
}
Color newRangeColor=
- (sourceStream == ConsoleDocument.OUT) ? ConsolePreferencePage.getPreferenceColor(ConsolePreferencePage.CONSOLE_SYS_OUT_RGB) : ConsolePreferencePage.getPreferenceColor(ConsolePreferencePage.CONSOLE_SYS_ERR_RGB);
+ (sourceStream == ConsoleDocument.OUT) ? DebugUIPlugin.getPreferenceColor(IDebugPreferenceConstants.CONSOLE_SYS_OUT_RGB) : DebugUIPlugin.getPreferenceColor(IDebugPreferenceConstants.CONSOLE_SYS_ERR_RGB);
StyleRange newRange= new StyleRange(fLastStreamWriteEnd, fNewStreamWriteEnd - fLastStreamWriteEnd, newRangeColor, null);
if (!fStyleRanges.isEmpty()) {
if ((docLength != fNewStreamWriteEnd) &&
((StyleRange)fStyleRanges.get(fStyleRanges.size() - 1)).foreground ==
- ConsolePreferencePage.getPreferenceColor(ConsolePreferencePage.CONSOLE_SYS_IN_RGB)) {
+ DebugUIPlugin.getPreferenceColor(IDebugPreferenceConstants.CONSOLE_SYS_IN_RGB)) {
//remove the top "input" range..it will get recalculated in updateInputStyleRanges
fStyleRanges.remove(fStyleRanges.size() - 1);
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/VariablesView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/VariablesView.java
index 815a15a71..c6b0dfd02 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/VariablesView.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/VariablesView.java
@@ -203,7 +203,6 @@ public class VariablesView extends AbstractDebugEventHandlerView implements ISel
DebugUIPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(this);
Viewer viewer = getViewer();
if (viewer != null) {
- ((VariablesViewer)viewer).dispose();
getDetailDocument().removeDocumentListener(getDetailDocumentListener());
}
super.dispose();
@@ -266,7 +265,7 @@ public class VariablesView extends AbstractDebugEventHandlerView implements ISel
String propertyName= event.getProperty();
if (propertyName.equals(IDebugPreferenceConstants.VARIABLES_DETAIL_PANE_ORIENTATION)) {
setDetailPaneOrientation((String)event.getNewValue());
- } else if (propertyName.equals(IDebugUIConstants.PREF_SHOW_VARIABLE_VALUE_CHANGES)) {
+ } else if (propertyName.equals(IDebugPreferenceConstants.CHANGED_VARIABLE_RGB)) {
getEventHandler().refresh();
}
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/VariablesViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/VariablesViewer.java
index 58841da46..d2999ef18 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/VariablesViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/VariablesViewer.java
@@ -5,39 +5,26 @@ package org.eclipse.debug.internal.ui.views;
* All Rights Reserved.
*/
-import java.util.HashMap;
-import java.util.Iterator;
-
import org.eclipse.debug.core.DebugException;
import org.eclipse.debug.core.model.IVariable;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
-import org.eclipse.debug.ui.IDebugUIConstants;
+import org.eclipse.debug.internal.ui.IDebugPreferenceConstants;
import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Item;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.swt.widgets.Widget;
/**
- * Variables viewer. As the user steps through code, the
- * variables view renders variables that have not changed
- * in value with a disabled image, thus drawing attention
- * to the values that have changed (which will appear with
- * their appropriate color image).
+ * Variables viewer. As the user steps through code, this
+ * viewer renders variables that have changed with a
+ * different foreground color thereby drawing attention
+ * to the values that have changed.
*/
public class VariablesViewer extends TreeViewer {
/**
- * Map of disabled images corresponding to enabled
- * images. Keys are enabled images, and values are
- * corresponding disabled images.
- */
- private HashMap fDisabledImages = new HashMap(10);
-
- /**
* Constructor for VariablesViewer.
* @param parent
*/
@@ -63,38 +50,10 @@ public class VariablesViewer extends TreeViewer {
}
/**
- * Returns the disabled image the corresponds to the given
- * image, building one if required.
- *
- * @param image enabled image
- * @return disabled image
- */
- protected Image getDisabledImage(Image image) {
- Image disabled = (Image)fDisabledImages.get(image);
- if (disabled == null) {
- disabled = new Image(getTree().getDisplay(), image, SWT.IMAGE_DISABLE);
- fDisabledImages.put(image, disabled);
- }
- return disabled;
- }
-
- /**
- * Dispose disabled images
- */
- protected void dispose() {
- Iterator images = fDisabledImages.values().iterator();
- while (images.hasNext()) {
- Image image = (Image)images.next();
- image.dispose();
- }
- fDisabledImages.clear();
- }
-
- /**
* Refresh the view, and then do another pass to
- * update images for values that have not changed
+ * update the foreground color for values that have changed
* since the last refresh. Values that have not
- * changed are drawn with a disabled image.
+ * changed are drawn with the default system foreground color.
*
* @see Viewer#refresh()
*/
@@ -102,12 +61,10 @@ public class VariablesViewer extends TreeViewer {
getControl().setRedraw(false);
super.refresh();
- if (isShowingChanges()) {
- Item[] children = getChildren(getControl());
- if (children != null) {
- for (int i = 0; i < children.length; i++) {
- updateIcons((TreeItem)children[i]);
- }
+ Item[] children = getChildren(getControl());
+ if (children != null) {
+ for (int i = 0; i < children.length; i++) {
+ updateColor((TreeItem)children[i]);
}
}
@@ -115,65 +72,32 @@ public class VariablesViewer extends TreeViewer {
}
/**
- * Updates the icon of the given item as well
+ * Updates the color of the given item as well
* as all of its children. If the item corresponds
- * to a variable that has not changed in value,
- * it is rendered with a disabled image, otherwise
- * its default image is used.
+ * to a variable that has changed in value,
+ * it is rendered with the <code>CHANGED_VARIABLE_RGB</code>
+ * generated foreground color, otherwise the default system
+ * color is used.
*
* @param item tree item
*/
- protected void updateIcons(TreeItem item) {
+ protected void updateColor(TreeItem item) {
if (item.getData() instanceof IVariable) {
IVariable var = (IVariable)item.getData();
try {
- if (!var.hasValueChanged()) {
- Image disabled = getDisabledImage(item.getImage());
- item.setImage(disabled);
- }
+ if (var.hasValueChanged()) {
+ Color c= DebugUIPlugin.getPreferenceColor(IDebugPreferenceConstants.CHANGED_VARIABLE_RGB);
+ item.setForeground(c);
+ } else {
+ item.setForeground(null);
+ }
} catch (DebugException e) {
DebugUIPlugin.log(e);
}
}
TreeItem[] children = item.getItems();
for (int i = 0; i < children.length; i++) {
- updateIcons(children[i]);
- }
- }
-
- /**
- * When children are created, we cache their current
- * values in the previous value cache, such that the
- * fist time they are drawn with disabled (unchanged)
- * icons.
- *
- * @see AbstractTreeViewer#createChildren(Widget)
- */
- protected void createChildren(Widget widget) {
- super.createChildren(widget);
- if (isShowingChanges()) {
- Item[] children = getChildren(widget);
- for (int i = 0; i < children.length; i++) {
- TreeItem treeItem = (TreeItem)children[i];
- Object data = treeItem.getData();
- if (data != null && data instanceof IVariable) {
- Image image = treeItem.getImage();
- if (image != null) {
- treeItem.setImage(getDisabledImage(image));
- }
- }
- }
+ updateColor(children[i]);
}
}
-
- /**
- * Returns whether this viewer is displaying
- * variable changes.
- *
- * @return whether this viewer is displaying
- * variable changes
- */
- protected boolean isShowingChanges() {
- return DebugUIPlugin.getDefault().getPreferenceStore().getBoolean(IDebugUIConstants.PREF_SHOW_VARIABLE_VALUE_CHANGES);
- }
} \ No newline at end of file
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java
index a8d9f02c3..8e09d4194 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java
@@ -153,21 +153,6 @@ public interface IDebugUIConstants {
* @since 2.0
*/
public static final String PREF_AUTO_REMOVE_OLD_LAUNCHES= PLUGIN_ID + ".auto_remove_old_launches"; //$NON-NLS-1$
-
- /**
- * Boolean preference controlling the rendering of variable
- * in the variables and expression views. When <code>true</code>
- * the variables and expressions views display variables that
- * have changed value on the last operation (step, etc), with
- * their default images, and those that have not changed with
- * disabled images. When <code>false</code>, all variables
- * are rendered with their default images.
- *
- * @since 2.0
- * @deprecated to be removed - the variable view will show changes (i.e.
- * will not be configurable)
- */
- public static final String PREF_SHOW_VARIABLE_VALUE_CHANGES = PLUGIN_ID + ".show_variable_value_changes"; //$NON-NLS-1$
/**
* Boolean preference controlling the appearance of the launch configuration dialog

Back to the top