changeset 46:9d7d88f13040

Fix anon classes
author Frank Benoit <benoit@tionex.de>
date Fri, 11 Apr 2008 16:19:01 +0200
parents 076d0807c32a
children be19b235c6c4
files dwtx/jface/preference/PreferenceDialog.d
diffstat 1 files changed, 29 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/dwtx/jface/preference/PreferenceDialog.d	Fri Apr 11 16:18:16 2008 +0200
+++ b/dwtx/jface/preference/PreferenceDialog.d	Fri Apr 11 16:19:01 2008 +0200
@@ -382,13 +382,15 @@
      */
     protected override Control createContents(Composite parent) {
         Control[1] control;
-        BusyIndicator.showWhile(getShell().getDisplay(), new class(parent) Runnable {
+        BusyIndicator.showWhile(getShell().getDisplay(), new class(parent,control) Runnable {
             Composite parent_;
-            this(Composite a){
+            Control[] control_;
+            this(Composite a,Control[] b){
                 parent_=a;
+                control_=b;
             }
             public void run() {
-                control[0] = callSuperCreateContents(parent);
+                control_[0] = callSuperCreateContents(parent_);
                 // Add the first page
                 selectSavedItem();
             }
@@ -629,7 +631,7 @@
             }
         });
 
-        final IPropertyChangeListener fontListener = new class IPropertyChangeListener {
+        IPropertyChangeListener fontListener = new class IPropertyChangeListener {
             public void propertyChange(PropertyChangeEvent event) {
                 if (JFaceResources.BANNER_FONT.equals(event.getProperty())) {
                     updateMessage();
@@ -646,9 +648,13 @@
             }
         };
 
-        titleArea.addDisposeListener(new class DisposeListener {
+        titleArea.addDisposeListener(new class(fontListener) DisposeListener {
+            IPropertyChangeListener fontListener_;
+            this(IPropertyChangeListener a){
+                fontListener_=a;
+            }
             public void widgetDisposed(DisposeEvent event) {
-                JFaceResources.getFontRegistry().removeListener(fontListener);
+                JFaceResources.getFontRegistry().removeListener(fontListener_);
             }
         });
         JFaceResources.getFontRegistry().addListener(fontListener);
@@ -1244,9 +1250,13 @@
         // (this allows lazy page control creation)
         if (currentPage.getControl() is null) {
             bool[1] failed; failed[0] = false;
-            SafeRunnable.run(new class ISafeRunnable {
+            SafeRunnable.run(new class(failed) ISafeRunnable {
+                bool[] failed_;
+                this(bool[] a){
+                    this.failed_=a;
+                }
                 public void handleException(Exception e) {
-                    failed[0] = true;
+                    this.failed_[0] = true;
                 }
 
                 public void run() {
@@ -1263,15 +1273,21 @@
         }
         // Force calculation of the page's description label because
         // label can be wrapped.
-        final Point[] size = new Point[1];
-        final Point failed = new Point(-1, -1);
-        SafeRunnable.run(new class ISafeRunnable {
+        Point[1] size;
+        Point failed = new Point(-1, -1);
+        SafeRunnable.run(new class(size,failed) ISafeRunnable {
+            Point[] size_;
+            Point failed_;
+            this(Point[] a,Point b){
+                size_=a;
+                failed_=b;
+            }
             public void handleException(Exception e) {
-                size[0] = failed;
+                size_[0] = failed_;
             }
 
             public void run() {
-                size[0] = currentPage.computeSize();
+                size_[0] = currentPage.computeSize();
             }
         });
         if (size[0].opEquals(failed)) {