changeset 94:1d37a7813832

First Databinding Snippet (004) builds
author Frank Benoit <benoit@tionex.de>
date Sun, 19 Apr 2009 17:37:36 +0200
parents 18a80add24ac
children 6208d4f6a277
files base/src/java/io/PrintStream.d base/src/java/io/PrintWriter.d base/src/java/util/AbstractSet.d org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/list/AbstractObservableList.d org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/map/AbstractObservableMap.d org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/map/ComputedObservableMap.d rakefile
diffstat 7 files changed, 59 insertions(+), 31 deletions(-) [+]
line wrap: on
line diff
--- a/base/src/java/io/PrintStream.d	Sun Apr 19 13:49:53 2009 +0200
+++ b/base/src/java/io/PrintStream.d	Sun Apr 19 17:37:36 2009 +0200
@@ -29,9 +29,9 @@
     void print(char c){
         implMissing(__FILE__, __LINE__);
     }
-    void print(char[] s){
-        implMissing(__FILE__, __LINE__);
-    }
+    //void print(char[] s){
+    //    implMissing(__FILE__, __LINE__);
+    //}
     void print(double d){
         implMissing(__FILE__, __LINE__);
     }
@@ -59,9 +59,9 @@
     void println(char x){
         implMissing(__FILE__, __LINE__);
     }
-    void println(char[] x){
-        implMissing(__FILE__, __LINE__);
-    }
+    //void println(char[] x){
+    //    implMissing(__FILE__, __LINE__);
+    //}
     void println(double x){
         implMissing(__FILE__, __LINE__);
     }
--- a/base/src/java/io/PrintWriter.d	Sun Apr 19 13:49:53 2009 +0200
+++ b/base/src/java/io/PrintWriter.d	Sun Apr 19 17:37:36 2009 +0200
@@ -33,9 +33,9 @@
     void print(char c){
         implMissing(__FILE__, __LINE__);
     }
-    void print(char[] s){
-        implMissing(__FILE__, __LINE__);
-    }
+    //void print(char[] s){
+    //    implMissing(__FILE__, __LINE__);
+    //}
     void print(double d){
         implMissing(__FILE__, __LINE__);
     }
@@ -63,9 +63,9 @@
     void println(char x){
         implMissing(__FILE__, __LINE__);
     }
-    void println(char[] x){
-        implMissing(__FILE__, __LINE__);
-    }
+    //void println(char[] x){
+    //    implMissing(__FILE__, __LINE__);
+    //}
     void println(double x){
         implMissing(__FILE__, __LINE__);
     }
@@ -87,12 +87,12 @@
     protected void setError(){
         implMissing(__FILE__, __LINE__);
     }
-    void write(char[] buf){
-        implMissing(__FILE__, __LINE__);
-    }
-    void write(char[] buf, int off, int len){
-        implMissing(__FILE__, __LINE__);
-    }
+    //void write(char[] buf){
+    //    implMissing(__FILE__, __LINE__);
+    //}
+    //void write(char[] buf, int off, int len){
+    //    implMissing(__FILE__, __LINE__);
+    //}
     void write(int c){
         implMissing(__FILE__, __LINE__);
     }
--- a/base/src/java/util/AbstractSet.d	Sun Apr 19 13:49:53 2009 +0200
+++ b/base/src/java/util/AbstractSet.d	Sun Apr 19 17:37:36 2009 +0200
@@ -27,17 +27,17 @@
 
 
     public bool     isEmpty(){ return super.isEmpty(); }
-    public Iterator iterator(){ return super.iterator(); }
+    //public Iterator iterator(){ return super.iterator(); }
     public bool     remove(Object o){ return super.remove(o); }
     public bool     remove(String o){ return super.remove(o); }
     public bool     removeAll(Collection c){ return super.removeAll(c); }
     public bool     retainAll(Collection c){ return super.retainAll(c); }
-    public int      size(){ return super.size(); }
+    //public int      size(){ return super.size(); }
     public Object[] toArray(){ return super.toArray(); }
     public Object[] toArray(Object[] a){ return super.toArray(a); }
     public String   toString(){ return super.toString(); }
 
     // only for D
-    public int opApply (int delegate(ref Object value) dg){ return super.opApply(dg); }
+    //public int opApply (int delegate(ref Object value) dg){ return super.opApply(dg); }
 }
 
--- a/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/list/AbstractObservableList.d	Sun Apr 19 13:49:53 2009 +0200
+++ b/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/list/AbstractObservableList.d	Sun Apr 19 17:37:36 2009 +0200
@@ -58,18 +58,18 @@
     public Object   remove(int index){
         return super.remove(index);
     }
-    public bool     remove(Object o){
-        return super.remove(o);
-    }
+    //public bool     remove(Object o){
+    //    return super.remove(o);
+    //}
     public bool     remove(String o){
         return super.remove(o);
     }
     public void     add(int index, Object element){
         return super.add(index, element);
     }
-    public bool     add(Object o){
-        return super.add(o);
-    }
+    //public bool     add(Object o){
+    //    return super.add(o);
+    //}
     public bool     add(String o){
         return super.add(o);
     }
--- a/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/map/AbstractObservableMap.d	Sun Apr 19 13:49:53 2009 +0200
+++ b/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/map/AbstractObservableMap.d	Sun Apr 19 17:37:36 2009 +0200
@@ -21,6 +21,7 @@
 
 import java.util.AbstractMap;
 import java.util.Set;
+import java.util.Map;
 
 import org.eclipse.core.databinding.observable.ChangeEvent;
 import org.eclipse.core.databinding.observable.ChangeSupport;
@@ -77,6 +78,25 @@
     public override Set values(){
         return super.values();
     }
+    public int opApply (int delegate(ref Object value) dg){
+        foreach( entry; entrySet() ){
+            auto me = cast(Map.Entry)entry;
+            auto v = me.getValue();
+            int res = dg( v );
+            if( res ) return res;
+        }
+        return 0;
+    }
+    public int opApply (int delegate(ref Object key, ref Object value) dg){
+        foreach( entry; entrySet() ){
+            auto me = cast(Map.Entry)entry;
+            auto k = me.getKey();
+            auto v = me.getValue();
+            int res = dg( k, v );
+            if( res ) return res;
+        }
+        return 0;
+    } 
     // DWT end reimplement
     private ChangeSupport changeSupport;
 
--- a/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/map/ComputedObservableMap.d	Sun Apr 19 13:49:53 2009 +0200
+++ b/org.eclipse.core.databinding/src/org/eclipse/core/databinding/observable/map/ComputedObservableMap.d	Sun Apr 19 17:37:36 2009 +0200
@@ -64,6 +64,9 @@
     private Set fentrySet;
 
     private class EntrySet : AbstractSet {
+        public int opApply (int delegate(ref Object value) dg){
+            return super.opApply(dg);
+        }
 
         public Iterator iterator() {
             return new class() Iterator {
--- a/rakefile	Sun Apr 19 13:49:53 2009 +0200
+++ b/rakefile	Sun Apr 19 17:37:36 2009 +0200
@@ -70,6 +70,7 @@
 
 end
 LIBNAMES_SWT        = [ BASEDIR_SWT ]
+LIBNAMES_ICU        = [ "com.ibm.icu" ]
 LIBNAMES_EQUINOX    = [ "org.eclipse.osgi.osgi",
                         "org.eclipse.osgi.supplement",
                         "org.eclipse.equinox.common" ]
@@ -187,17 +188,19 @@
 
 def createLib( libobjs, name )
     FileUtils.mkdir_p DIR_LIB.to_path
+    file_lib = File.join(DIR_LIB, name + LIBEXT)
+    FileUtils.rm_f file_lib
     rsp = File.new( FILE_RSP, "w+" )
     if isWindows
         rsp.puts "-p512"
         rsp.puts "-n"
-        rsp.puts "-c #{DIR_LIB}\\#{name}#{LIBEXT}"
+        rsp.puts "-c #{file_lib.to_path}"
         libobjs.each do |obj|
             rsp.puts obj.to_path
         end
     else
         rsp.puts "-r"
-        rsp.puts "-c #{DIR_LIB}/#{name}#{LIBEXT}"
+        rsp.puts "-c #{file_lib.to_path}"
         libobjs.each do |obj|
             rsp.puts obj.to_path
         end
@@ -400,7 +403,8 @@
     PREFIX = "JFace"
     SRCPATH = "EclipseJfaceSnippets"
     BASEPATH = "org.eclipse.jface.snippets"
-    libnames = LIBNAMES_BASIC + LIBNAMES_SWT + LIBNAMES_EQUINOX + LIBNAMES_CORE + LIBNAMES_JFACE
+    libnames = LIBNAMES_BASIC + LIBNAMES_SWT + LIBNAMES_EQUINOX +
+               LIBNAMES_CORE + LIBNAMES_JFACE + LIBNAMES_ICU
     snps_exclude = []
     allsnippets = FileList[ File.join(BASEPATH, SRCPATH, "**/*.d" )]
     if args.explicit_snp != nil
@@ -431,7 +435,8 @@
     SRCPATH = "src"
     BASEPATH = "org.eclipse.jface.examples.databinding"
     libnames = LIBNAMES_BASIC + LIBNAMES_SWT + LIBNAMES_EQUINOX +
-               LIBNAMES_CORE + LIBNAMES_JFACE + LIBNAMES_JFACEBIND
+               LIBNAMES_CORE + LIBNAMES_JFACE + LIBNAMES_JFACEBIND +
+               LIBNAMES_ICU
     snps_exclude = []
     allsnippets = FileList[ File.join(BASEPATH, SRCPATH, "**/*.d" )]
     if args.explicit_snp != nil