Mercurial > projects > dwt-addons
comparison dwtx/jface/bindings/BindingManagerEvent.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 | e0f0aaf75edd |
children |
comparison
equal
deleted
inserted
replaced
103:2d6540440fe6 | 104:04b47443bb01 |
---|---|
15 | 15 |
16 import dwtx.jface.bindings.BindingManager; | 16 import dwtx.jface.bindings.BindingManager; |
17 import dwtx.jface.bindings.Scheme; | 17 import dwtx.jface.bindings.Scheme; |
18 import dwtx.jface.bindings.TriggerSequence; | 18 import dwtx.jface.bindings.TriggerSequence; |
19 | 19 |
20 // import tango.util.collection.Seq!(Object); | |
21 import tango.util.collection.model.Map; | |
22 import tango.util.collection.model.Seq; | |
23 | 20 |
24 import dwtx.core.commands.ParameterizedCommand; | 21 import dwtx.core.commands.ParameterizedCommand; |
25 import dwtx.core.commands.common.AbstractBitSetEvent; | 22 import dwtx.core.commands.common.AbstractBitSetEvent; |
26 import dwtx.jface.util.Util; | 23 import dwtx.jface.util.Util; |
27 | 24 |
28 import dwt.dwthelper.utils; | 25 import dwt.dwthelper.utils; |
26 import dwtx.dwtxhelper.Collection; | |
29 | 27 |
30 /** | 28 /** |
31 * An instance of this class describes changes to an instance of | 29 * An instance of this class describes changes to an instance of |
32 * <code>BindingManager</code>. | 30 * <code>BindingManager</code>. |
33 * <p> | 31 * <p> |
69 * <code>null</code>. | 67 * <code>null</code>. |
70 */ | 68 */ |
71 private const BindingManager manager; | 69 private const BindingManager manager; |
72 | 70 |
73 /** | 71 /** |
74 * The map of triggers (<code>Seq!(Object)</code> of | 72 * The map of triggers (<code>Collection</code> of |
75 * <code>TriggerSequence</code>) by parameterized command (<code>ParameterizedCommand</code>) | 73 * <code>TriggerSequence</code>) by parameterized command (<code>ParameterizedCommand</code>) |
76 * before the change occurred. This map may be empty and it may be | 74 * before the change occurred. This map may be empty and it may be |
77 * <code>null</code>. | 75 * <code>null</code>. |
78 */ | 76 */ |
79 private const Map!(Object,Object) previousTriggersByParameterizedCommand; | 77 private const Map previousTriggersByParameterizedCommand; |
80 | 78 |
81 /** | 79 /** |
82 * The scheme that became defined or undefined. This value may be | 80 * The scheme that became defined or undefined. This value may be |
83 * <code>null</code> if no scheme changed its defined state. | 81 * <code>null</code> if no scheme changed its defined state. |
84 */ | 82 */ |
110 * @param platformChanged | 108 * @param platformChanged |
111 * <code>true</code> iff the active platform changed | 109 * <code>true</code> iff the active platform changed |
112 */ | 110 */ |
113 public this(BindingManager manager, | 111 public this(BindingManager manager, |
114 bool activeBindingsChanged, | 112 bool activeBindingsChanged, |
115 Map!(Object,Object) previousTriggersByParameterizedCommand, | 113 Map previousTriggersByParameterizedCommand, |
116 bool activeSchemeChanged, Scheme scheme, | 114 bool activeSchemeChanged, Scheme scheme, |
117 bool schemeDefined, bool localeChanged, | 115 bool schemeDefined, bool localeChanged, |
118 bool platformChanged) { | 116 bool platformChanged) { |
119 if (manager is null) { | 117 if (manager is null) { |
120 throw new NullPointerException( | 118 throw new NullPointerException( |
190 ParameterizedCommand parameterizedCommand) { | 188 ParameterizedCommand parameterizedCommand) { |
191 TriggerSequence[] currentBindings = manager | 189 TriggerSequence[] currentBindings = manager |
192 .getActiveBindingsFor(parameterizedCommand); | 190 .getActiveBindingsFor(parameterizedCommand); |
193 TriggerSequence[] previousBindings; | 191 TriggerSequence[] previousBindings; |
194 if (previousTriggersByParameterizedCommand !is null) { | 192 if (previousTriggersByParameterizedCommand !is null) { |
195 Seq!(Object) previousBindingCollection = cast(Seq!(Object)) previousTriggersByParameterizedCommand | 193 Collection previousBindingCollection = cast(Collection) previousTriggersByParameterizedCommand |
196 .get(parameterizedCommand); | 194 .get(parameterizedCommand); |
197 if (previousBindingCollection is null) { | 195 if (previousBindingCollection is null) { |
198 previousBindings = null; | 196 previousBindings = null; |
199 } else { | 197 } else { |
200 previousBindings = cast(TriggerSequence[])previousBindingCollection.toArray(); | 198 previousBindings = cast(TriggerSequence[])previousBindingCollection.toArray(); |