[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[imp-commit] r22799 - trunk/org.eclipse.imp.runtime/src/org/eclipse/imp/preferences/fields

Author: rfuhrer
Date: 2010-11-18 17:43:01 -0500 (Thu, 18 Nov 2010)
New Revision: 22799

Modified:
   trunk/org.eclipse.imp.runtime/src/org/eclipse/imp/preferences/fields/StringFieldEditor.java
Log:
The on-key-stroke listener no longer marks the field dirty when arrow keys are pressed.

Modified: trunk/org.eclipse.imp.runtime/src/org/eclipse/imp/preferences/fields/StringFieldEditor.java
===================================================================
--- trunk/org.eclipse.imp.runtime/src/org/eclipse/imp/preferences/fields/StringFieldEditor.java	2010-11-18 17:10:57 UTC (rev 22798)
+++ trunk/org.eclipse.imp.runtime/src/org/eclipse/imp/preferences/fields/StringFieldEditor.java	2010-11-18 22:43:01 UTC (rev 22799)
@@ -744,14 +744,17 @@
                      * @see org.eclipse.swt.events.KeyAdapter#keyReleased(org.eclipse.swt.events.KeyEvent)
                      */
                     public void keyReleased(KeyEvent e) {
-	                	// Should call setInherited(..) before calling valueChanged() because
-	                	// valueChanged() will mark the field as modified, but only if isInherited
-	                	// is false, which it now should be
+                        // Should call setInherited(..) before calling valueChanged() because
+                        // valueChanged() will mark the field as modified, but only if isInherited
+                        // is false, which it now should be
+                        if (e.keyCode == SWT.ARROW_DOWN || e.keyCode == SWT.ARROW_UP || e.keyCode == SWT.ARROW_LEFT || e.keyCode == SWT.ARROW_RIGHT) {
+                            // Don't treat navigating through the value as a value change
+                            return;
+                        }
                         refreshValidState();
-    					setInherited(false);
+                        setInherited(false);
                         boolean changed = valueChanged(true);
-    					fieldModified = changed;
-
+                        fieldModified = changed;
                     }
                 });