diff dwtx/core/commands/ExecutionEvent.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 ea8ff534f622
children
line wrap: on
line diff
--- a/dwtx/core/commands/ExecutionEvent.d	Sun Aug 03 17:01:51 2008 +0200
+++ b/dwtx/core/commands/ExecutionEvent.d	Thu Aug 07 15:01:33 2008 +0200
@@ -13,8 +13,6 @@
 module dwtx.core.commands.ExecutionEvent;
 
 // import java.util.Collections;
-import tango.util.collection.model.Map;
-import tango.util.collection.HashMap;
 
 import dwtx.core.commands.common.NotDefinedException;
 import dwtx.core.commands.ExecutionException;
@@ -24,6 +22,7 @@
 import dwtx.core.commands.ParameterValueConversionException;
 
 import dwt.dwthelper.utils;
+import dwtx.dwtxhelper.Collection;
 
 import tango.text.convert.Format;
 
@@ -43,10 +42,6 @@
  * @since 3.1
  */
 public final class ExecutionEvent {
-    private static const Map!(String,String) EMPTY_MAP;
-    static this(){
-        EMPTY_MAP = new HashMap!(String,String);
-    }
     /**
      * The state of the application at the time the execution was triggered. In
      * the Eclipse workbench, this might contain information about the active
@@ -65,7 +60,7 @@
      * prompt for additional information, these can be used to avoid prompting.
      * This value may be empty, but it is never <code>null</code>.
      */
-    private const Map!(String,String) parameters;
+    private const Map parameters;
 
     /**
      * The object that triggered the execution. In an event-driven architecture,
@@ -82,7 +77,7 @@
      * @since 3.2
      */
     public this() {
-        this(null, EMPTY_MAP, null, null);
+        this(null, Collections.EMPTY_MAP, null, null);
     }
 
     /**
@@ -101,7 +96,7 @@
      * @deprecated use
      *             {@link ExecutionEvent#ExecutionEvent(Command, Map, Object, Object)}
      */
-    public this(Map!(String,String) parameters, Object trigger,
+    public this(Map parameters, Object trigger,
             Object applicationContext) {
         this(null, parameters, trigger, applicationContext);
     }
@@ -123,7 +118,7 @@
      *            triggered; may be <code>null</code>.
      * @since 3.2
      */
-    public this(Command command, Map!(String,String) parameters,
+    public this(Command command, Map parameters,
             Object trigger, Object applicationContext) {
         if (parameters is null) {
             throw new NullPointerException(
@@ -213,7 +208,7 @@
      *         be found.
      */
     public final String getParameter(String parameterId) {
-        return parameters.get(parameterId);
+        return stringcast(parameters.get(parameterId));
     }
 
     /**
@@ -221,7 +216,7 @@
      *
      * @return The parameters; never <code>null</code>, but may be empty.
      */
-    public final Map!(String,String) getParameters() {
+    public final Map getParameters() {
         return parameters;
     }
 
@@ -243,7 +238,7 @@
     public override final String toString() {
         String parm;
         foreach( k, v; parameters ){
-            parm ~= "{"~k~","~v~"}";
+            parm ~= "{"~stringcast(k)~","~stringcast(v)~"}";
         }
         return Format( "ExecutionEvent({},{},{})", command, parm, trigger, applicationContext );
     }