diff dwtx/jface/viewers/DecorationContext.d @ 104:04b47443bb01

Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections. These new wrappers now use the tango.util.containers instead of the tango.util.collections.
author Frank Benoit <benoit@tionex.de>
date Thu, 07 Aug 2008 15:01:33 +0200
parents 46a6e0e6ccd4
children
line wrap: on
line diff
--- a/dwtx/jface/viewers/DecorationContext.d	Sun Aug 03 17:01:51 2008 +0200
+++ b/dwtx/jface/viewers/DecorationContext.d	Thu Aug 07 15:01:33 2008 +0200
@@ -14,10 +14,9 @@
 
 import dwtx.jface.viewers.IDecorationContext;
 
-import tango.util.collection.HashMap;
-import tango.util.collection.model.Map;
 
 import dwt.dwthelper.utils;
+import dwtx.dwtxhelper.Collection;
 
 /**
  * A concrete implementation of the {@link IDecorationContext} interface,
@@ -38,13 +37,13 @@
         DEFAULT_CONTEXT = new DecorationContext();
     }
 
-    private Map!(String,Object) properties;
+    private Map properties;
 
     /**
      * Create a decoration context.
      */
     public this() {
-        properties = new HashMap!(String,Object);
+        properties = new HashMap();
     }
 
 
@@ -52,18 +51,14 @@
      * @see dwtx.jface.viewers.IDecorationContext#getProperty(java.lang.String)
      */
     public Object getProperty(String property) {
-        return properties.get(property);
+        return properties.get(stringcast(property));
     }
 
     /* (non-Javadoc)
      * @see dwtx.jface.viewers.IDecorationContext#getProperties()
      */
     public String[] getProperties() {
-        String[] res;
-        foreach( k,v; properties ){
-            res ~= k;
-        }
-        return res;
+        return stringcast( properties.keySet().toArray() );
     }
 
     /**
@@ -76,9 +71,9 @@
      */
     public void putProperty(String property, Object value) {
         if (value is null) {
-            properties.removeKey(property);
+            properties.remove(stringcast(property));
         } else {
-            properties.add(property, value);
+            properties.put(stringcast(property), value);
         }
     }
 }