diff dwtx/jface/action/Action.d @ 70:46a6e0e6ccd4

Merge with d-fied sources of 3.4M7
author Frank Benoit <benoit@tionex.de>
date Thu, 22 May 2008 01:36:46 +0200
parents e0f0aaf75edd
children c3583c6ec027
line wrap: on
line diff
--- a/dwtx/jface/action/Action.d	Mon May 19 13:41:06 2008 +0200
+++ b/dwtx/jface/action/Action.d	Thu May 22 01:36:46 2008 +0200
@@ -272,7 +272,7 @@
 
     /**
      * Holds the action's menu creator (an IMenuCreator) or checked state (a
-     * bool for toggle button, or an Integer for radio button), or
+     * Boolean for toggle button, or an Integer for radio button), or
      * <code>null</code> if neither have been set.
      * <p>
      * The value of this field affects the value of <code>getStyle()</code>.
@@ -495,9 +495,9 @@
      * @since 3.0
      */
     public final void notifyResult(bool success) {
-        // avoid bool.valueOf(bool) to allow compilation against JCL
+        // avoid Boolean.valueOf(bool) to allow compilation against JCL
         // Foundation (bug 80059)
-        firePropertyChange(RESULT, null, new ValueWrapperBool(success));
+        firePropertyChange(RESULT, null, success ? Boolean.TRUE : Boolean.FALSE);
     }
 
     /**
@@ -559,9 +559,9 @@
         if (newValue !is value) {
             value = newValue;
             if (checked) {
-                firePropertyChange(CHECKED, new ValueWrapperBool(false), new ValueWrapperBool(true));
+                firePropertyChange(CHECKED, Boolean.FALSE, Boolean.TRUE);
             } else {
-                firePropertyChange(CHECKED, new ValueWrapperBool(true), new ValueWrapperBool(false));
+                firePropertyChange(CHECKED, Boolean.TRUE, Boolean.FALSE);
             }
         }
     }
@@ -597,8 +597,10 @@
      */
     public void setEnabled(bool enabled) {
         if (enabled !is this.enabled) {
+            Boolean oldVal = this.enabled ? Boolean.TRUE : Boolean.FALSE;
+            Boolean newVal = enabled ? Boolean.TRUE : Boolean.FALSE;
             this.enabled = enabled;
-            firePropertyChange(ENABLED, new ValueWrapperBool(this.enabled), new ValueWrapperBool(enabled));
+            firePropertyChange(ENABLED, oldVal, newVal);
         }
     }