Mercurial > projects > dwt-addons
comparison dwtx/jface/window/ToolTip.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 | 7ffeace6c47f |
children | 3b2353d77f37 |
comparison
equal
deleted
inserted
replaced
103:2d6540440fe6 | 104:04b47443bb01 |
---|---|
12 * Frank Benoit <benoit@tionex.de> | 12 * Frank Benoit <benoit@tionex.de> |
13 *******************************************************************************/ | 13 *******************************************************************************/ |
14 | 14 |
15 module dwtx.jface.window.ToolTip; | 15 module dwtx.jface.window.ToolTip; |
16 | 16 |
17 import tango.util.collection.HashMap; | |
18 | 17 |
19 import dwt.DWT; | 18 import dwt.DWT; |
20 import dwt.events.DisposeEvent; | 19 import dwt.events.DisposeEvent; |
21 import dwt.events.DisposeListener; | 20 import dwt.events.DisposeListener; |
22 import dwt.graphics.Point; | 21 import dwt.graphics.Point; |
31 import dwt.widgets.Shell; | 30 import dwt.widgets.Shell; |
32 // import dwtx.jface.viewers.ColumnViewer; | 31 // import dwtx.jface.viewers.ColumnViewer; |
33 // import dwtx.jface.viewers.ViewerCell; | 32 // import dwtx.jface.viewers.ViewerCell; |
34 | 33 |
35 import dwt.dwthelper.utils; | 34 import dwt.dwthelper.utils; |
35 import dwtx.dwtxhelper.Collection; | |
36 import dwt.dwthelper.Runnable; | 36 import dwt.dwthelper.Runnable; |
37 import tango.core.Thread; | 37 import tango.core.Thread; |
38 /** | 38 /** |
39 * This class gives implementors to provide customized tooltips for any control. | 39 * This class gives implementors to provide customized tooltips for any control. |
40 * | 40 * |
51 | 51 |
52 private int hideDelay = 0; | 52 private int hideDelay = 0; |
53 | 53 |
54 private ToolTipOwnerControlListener listener; | 54 private ToolTipOwnerControlListener listener; |
55 | 55 |
56 private HashMap!(String,Object) data; | 56 private HashMap data; |
57 | 57 |
58 // Ensure that only one tooltip is active in time | 58 // Ensure that only one tooltip is active in time |
59 private static Shell CURRENT_TOOLTIP; | 59 private static Shell CURRENT_TOOLTIP; |
60 | 60 |
61 /** | 61 /** |
150 * @param value | 150 * @param value |
151 * the value | 151 * the value |
152 */ | 152 */ |
153 public void setData(String key, Object value) { | 153 public void setData(String key, Object value) { |
154 if (data is null) { | 154 if (data is null) { |
155 data = new HashMap!(String,Object); | 155 data = new HashMap(); |
156 } | 156 } |
157 data.add(key, value); | 157 data.put(stringcast(key), value); |
158 } | 158 } |
159 | 159 |
160 /** | 160 /** |
161 * Get the data restored under the key | 161 * Get the data restored under the key |
162 * | 162 * |
164 * the key | 164 * the key |
165 * @return data or <code>null</code> if no entry is restored under the key | 165 * @return data or <code>null</code> if no entry is restored under the key |
166 */ | 166 */ |
167 public Object getData(String key) { | 167 public Object getData(String key) { |
168 if (data !is null) { | 168 if (data !is null) { |
169 return data.get(key); | 169 return data.get(stringcast(key)); |
170 } | 170 } |
171 return null; | 171 return null; |
172 } | 172 } |
173 | 173 |
174 /** | 174 /** |