Mercurial > projects > dwt-addons
comparison dwtx/core/commands/Parameterization.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 |
comparison
equal
deleted
inserted
replaced
103:2d6540440fe6 | 104:04b47443bb01 |
---|---|
11 * Frank Benoit <benoit@tionex.de> | 11 * Frank Benoit <benoit@tionex.de> |
12 ******************************************************************************/ | 12 ******************************************************************************/ |
13 | 13 |
14 module dwtx.core.commands.Parameterization; | 14 module dwtx.core.commands.Parameterization; |
15 | 15 |
16 import tango.util.collection.model.Map; | |
17 | |
18 import dwtx.core.commands.IParameter; | 16 import dwtx.core.commands.IParameter; |
19 import dwtx.core.internal.commands.util.Util; | 17 import dwtx.core.internal.commands.util.Util; |
20 | 18 |
21 import dwt.dwthelper.utils; | 19 import dwt.dwthelper.utils; |
20 import dwtx.dwtxhelper.Collection; | |
22 | 21 |
23 /** | 22 /** |
24 * <p> | 23 * <p> |
25 * A parameter with a specific value. This is usually a part of a | 24 * A parameter with a specific value. This is usually a part of a |
26 * <code>ParameterizedCommand</code>, which is used to refer to a command | 25 * <code>ParameterizedCommand</code>, which is used to refer to a command |
134 * @return The human-readable name of the value; never <code>null</code>. | 133 * @return The human-readable name of the value; never <code>null</code>. |
135 * @throws ParameterValuesException | 134 * @throws ParameterValuesException |
136 * If the parameter needed to be initialized, but couldn't be. | 135 * If the parameter needed to be initialized, but couldn't be. |
137 */ | 136 */ |
138 public final String getValueName() { | 137 public final String getValueName() { |
139 auto parameterValues = parameter.getValues().getParameterValues(); | 138 Map parameterValues = parameter.getValues().getParameterValues(); |
139 Iterator parameterValueItr = parameterValues.entrySet() | |
140 .iterator(); | |
140 String returnValue = null; | 141 String returnValue = null; |
141 foreach( k, v; parameterValues ){ | 142 while (parameterValueItr.hasNext()) { |
142 if (Util.equals(value, v)) { | 143 Map.Entry entry = cast(Map.Entry) parameterValueItr.next(); |
143 returnValue = k; | 144 String currentValue = stringcast( entry.getValue()); |
145 if (Util.equals(value, currentValue)) { | |
146 returnValue = stringcast( entry.getKey()); | |
144 break; | 147 break; |
145 } | 148 } |
146 } | 149 } |
150 | |
147 if (returnValue is null) { | 151 if (returnValue is null) { |
148 return Util.ZERO_LENGTH_STRING; | 152 return Util.ZERO_LENGTH_STRING; |
149 } | 153 } |
150 | 154 |
151 return returnValue; | 155 return returnValue; |