changeset 56:ef6c06252a87

fix anon classes
author Frank Benoit <benoit@tionex.de>
date Sun, 13 Apr 2008 16:37:43 +0200
parents 6d1acb32839d
children 89776a9bb8b2
files dwtx/core/runtime/IProgressMonitor.d dwtx/jface/operation/AccumulatingProgressMonitor.d dwtx/jface/operation/ModalContext.d
diffstat 3 files changed, 27 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/dwtx/core/runtime/IProgressMonitor.d	Sun Apr 13 16:37:23 2008 +0200
+++ b/dwtx/core/runtime/IProgressMonitor.d	Sun Apr 13 16:37:43 2008 +0200
@@ -52,7 +52,7 @@
 
     /** Constant indicating an unknown amount of work.
      */
-    public final const int UNKNOWN = -1;
+    public static const int UNKNOWN = -1;
 
     /**
      * Notifies that the main task is beginning.  This must only be called once
--- a/dwtx/jface/operation/AccumulatingProgressMonitor.d	Sun Apr 13 16:37:23 2008 +0200
+++ b/dwtx/jface/operation/AccumulatingProgressMonitor.d	Sun Apr 13 16:37:43 2008 +0200
@@ -126,10 +126,16 @@
         synchronized (this) {
             collector = null;
         }
-        display.syncExec(new class Runnable {
+        display.syncExec(new class(name,totalWork) Runnable {
+            String name_;
+            int totalWork_;
+            this(String a, int b){
+                name_=a;
+                totalWork_=b;
+            }
             public void run() {
-                currentTask = name;
-                getWrappedProgressMonitor().beginTask(name, totalWork);
+                currentTask = name_;
+                getWrappedProgressMonitor().beginTask(name_, totalWork_);
             }
         });
     }
@@ -189,10 +195,14 @@
         synchronized (this) {
             collector = null;
         }
-        display.syncExec(new class Runnable {
+        display.syncExec(new class(name) Runnable {
+            String name_;
+            this(String a){
+                name_=a;
+            }
             public void run() {
-                currentTask = name;
-                getWrappedProgressMonitor().setTaskName(name);
+                currentTask = name_;
+                getWrappedProgressMonitor().setTaskName(name_);
             }
         });
     }
@@ -253,16 +263,20 @@
             return;
         }
 
-        display.asyncExec(new class(pm) Runnable {
+        display.asyncExec(new class(pm,reason) Runnable {
             IProgressMonitor pm_;
-            this(IProgressMonitor a){ pm_=a; }
+            IStatus reason_;
+            this(IProgressMonitor a,IStatus b){
+                pm_=a;
+                reason_=b;
+            }
             /* (non-Javadoc)
              * @see java.lang.Runnable#run()
              */
             public void run() {
-                (cast(IProgressMonitorWithBlocking) pm_).setBlocked(reason);
+                (cast(IProgressMonitorWithBlocking) pm_).setBlocked(reason_);
                 //Do not give a shell as we want it to block until it opens.
-                Dialog.getBlockedHandler().showBlocked(pm, reason, currentTask);
+                Dialog.getBlockedHandler().showBlocked(pm_, reason_, currentTask);
             }
         });
     }
--- a/dwtx/jface/operation/ModalContext.d	Sun Apr 13 16:37:23 2008 +0200
+++ b/dwtx/jface/operation/ModalContext.d	Sun Apr 13 16:37:43 2008 +0200
@@ -105,7 +105,7 @@
          */
         private this(IRunnableWithProgress operation,
                 IProgressMonitor monitor, Display display) {
-            super(/+"ModalContext"+/); //$NON-NLS-1$
+            super(&run2); //$NON-NLS-1$
             Assert.isTrue(monitor !is null && display !is null);
             runnable = operation;
             progressMonitor = new AccumulatingProgressMonitor(monitor, display);
@@ -116,7 +116,7 @@
         /* (non-Javadoc)
          * Method declared on Thread.
          */
-        public /+override+/ void run() {
+        public /+override+/ void run2() {
             try {
                 if (runnable !is null) {
                     runnable.run(progressMonitor);