diff dwtx/jface/viewers/TreeViewer.d @ 39:644f1334b451

fix anon classes
author Frank Benoit <benoit@tionex.de>
date Tue, 08 Apr 2008 22:05:42 +0200
parents b6c35faf97c8
children da5ad8eedf5d
line wrap: on
line diff
--- a/dwtx/jface/viewers/TreeViewer.d	Sun Apr 06 14:15:58 2008 +0200
+++ b/dwtx/jface/viewers/TreeViewer.d	Tue Apr 08 22:05:42 2008 +0200
@@ -431,12 +431,12 @@
     public void setChildCount(Object elementOrTreePath, int count) {
         if (isBusy())
             return;
-        preservingSelection(new class Runnable {
+        preservingSelection(new class(elementOrTreePath,count) Runnable {
             Object elementOrTreePath_;
             int count_;
-            this(){
-                elementOrTreePath_=elementOrTreePath;
-                count_=count;
+            this(Object a,int b){
+                elementOrTreePath_=a;
+                count_=b;
             }
             public void run() {
                 if (internalIsInputOrEmptyPath(elementOrTreePath_)) {
@@ -772,10 +772,10 @@
             // because it is reused
             if (item.getData(VIRTUAL_DISPOSE_KEY) is null) {
                 item.setData(VIRTUAL_DISPOSE_KEY, new ValueWrapperBool(true));
-                item.addDisposeListener(new class DisposeListener {
+                item.addDisposeListener(new class(item) DisposeListener {
                     Widget item_;
-                    this(){
-                        item_=item;
+                    this(Widget a){
+                        item_=a;
                     }
                     public void widgetDisposed(DisposeEvent e) {
                         if (!treeIsDisposed) {
@@ -875,15 +875,15 @@
     public void remove(Object parentOrTreePath_, int index_) {
         if (isBusy())
             return;
-        preservingSelection(new class Runnable {
+        preservingSelection(new class((cast(TreeSelection) getSelection()).getPaths(),parentOrTreePath_,index_) Runnable {
             Seq!(TreePath) oldSelection;
             Object parentOrTreePath;
             int index;
-            this(){
-                parentOrTreePath=parentOrTreePath_;
-                index=index_;
+            this(TreePath[] a,Object b,int c){
+                parentOrTreePath=b;
+                index=c;
                 oldSelection = new LinkSeq!(TreePath);
-                foreach( p; (cast(TreeSelection) getSelection()).getPaths()){
+                foreach( p; a){
                     oldSelection.append( p );
                 }
             }
@@ -978,12 +978,12 @@
     public void setHasChildren(Object elementOrTreePath_, bool hasChildren_) {
         if (isBusy())
             return;
-        preservingSelection(new class Runnable {
+        preservingSelection(new class(elementOrTreePath_,hasChildren_) Runnable {
             Object elementOrTreePath;
             bool hasChildren;
-            this(){
-                elementOrTreePath=elementOrTreePath_;
-                hasChildren=hasChildren_;
+            this(Object a,bool b){
+                elementOrTreePath=a;
+                hasChildren=b;
             }
             public void run() {
                 if (internalIsInputOrEmptyPath(elementOrTreePath)) {