Mercurial > projects > dwt-addons
annotate dwtx/jface/viewers/AbstractListViewer.d @ 70:46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Thu, 22 May 2008 01:36:46 +0200 |
parents | ea8ff534f622 |
children | 04b47443bb01 |
rev | line source |
---|---|
10 | 1 /******************************************************************************* |
2 * Copyright (c) 2004, 2007 IBM Corporation and others. | |
3 * All rights reserved. This program and the accompanying materials | |
4 * are made available under the terms of the Eclipse Public License v1.0 | |
5 * which accompanies this distribution, and is available at | |
6 * http://www.eclipse.org/legal/epl-v10.html | |
7 * | |
8 * Contributors: | |
9 * IBM Corporation - initial API and implementation | |
10 * Chris Longfield <clongfield@internap.com> - Fix for Bug 70856 | |
11 * Tom Schindl - fix for bug 157309 | |
12 * Brad Reynolds - bug 141435 | |
13 * Port to the D programming language: | |
14 * Frank Benoit <benoit@tionex.de> | |
15 *******************************************************************************/ | |
16 | |
17 module dwtx.jface.viewers.AbstractListViewer; | |
18 | |
19 import dwtx.jface.viewers.StructuredViewer; | |
20 import dwtx.jface.viewers.ILabelProvider; | |
21 import dwtx.jface.viewers.IBaseLabelProvider; | |
22 import dwtx.jface.viewers.ViewerComparator; | |
23 import dwtx.jface.viewers.IElementComparer; | |
24 | |
25 import tango.util.collection.ArraySeq; | |
26 import tango.util.collection.model.Seq; | |
27 import tango.util.collection.model.SeqView; | |
28 | |
29 import dwt.widgets.Control; | |
30 import dwt.widgets.Widget; | |
31 import dwtx.core.runtime.Assert; | |
32 | |
33 import dwt.dwthelper.utils; | |
34 import dwt.dwthelper.Runnable; | |
35 | |
36 /** | |
37 * Abstract base class for viewers that contain lists of items (such as a combo or list). | |
38 * Most of the viewer implementation is in this base class, except for the minimal code that | |
39 * actually communicates with the underlying widget. | |
40 * | |
41 * @see dwtx.jface.viewers.ListViewer | |
42 * @see dwtx.jface.viewers.ComboViewer | |
43 * | |
44 * @since 3.0 | |
45 */ | |
46 public abstract class AbstractListViewer : StructuredViewer { | |
43
ea8ff534f622
Fix override and super aliases
Frank Benoit <benoit@tionex.de>
parents:
42
diff
changeset
|
47 alias StructuredViewer.internalRefresh internalRefresh; |
ea8ff534f622
Fix override and super aliases
Frank Benoit <benoit@tionex.de>
parents:
42
diff
changeset
|
48 alias StructuredViewer.setSelectionToWidget setSelectionToWidget; |
10 | 49 |
50 /** | |
51 * A list of viewer elements (element type: <code>Object</code>). | |
52 */ | |
53 private Seq!(Object) listMap; | |
54 | |
55 /** | |
56 * Adds the given string to the underlying widget at the given index | |
57 * | |
58 * @param string the string to add | |
59 * @param index position to insert the string into | |
60 */ | |
61 protected abstract void listAdd(String string, int index); | |
62 | |
63 /** | |
64 * Sets the text of the item at the given index in the underlying widget. | |
65 * | |
66 * @param index index to modify | |
67 * @param string new text | |
68 */ | |
69 protected abstract void listSetItem(int index, String string); | |
70 | |
71 /** | |
72 * Returns the zero-relative indices of the items which are currently | |
73 * selected in the underlying widget. The array is empty if no items are selected. | |
74 * <p> | |
75 * Note: This is not the actual structure used by the receiver | |
76 * to maintain its selection, so modifying the array will | |
77 * not affect the receiver. | |
78 * </p> | |
79 * @return the array of indices of the selected items | |
80 */ | |
81 protected abstract int[] listGetSelectionIndices(); | |
82 | |
83 /** | |
84 * Returns the number of items contained in the underlying widget. | |
85 * | |
86 * @return the number of items | |
87 */ | |
88 protected abstract int listGetItemCount(); | |
89 | |
90 /** | |
91 * Sets the underlying widget's items to be the given array of items. | |
92 * | |
93 * @param labels the array of label text | |
94 */ | |
95 protected abstract void listSetItems(String[] labels); | |
96 | |
97 /** | |
98 * Removes all of the items from the underlying widget. | |
99 */ | |
100 protected abstract void listRemoveAll(); | |
101 | |
102 /** | |
103 * Removes the item from the underlying widget at the given | |
104 * zero-relative index. | |
105 * | |
106 * @param index the index for the item | |
107 */ | |
108 protected abstract void listRemove(int index); | |
109 | |
110 /** | |
111 * Selects the items at the given zero-relative indices in the underlying widget. | |
112 * The current selection is cleared before the new items are selected. | |
113 * <p> | |
114 * Indices that are out of range and duplicate indices are ignored. | |
115 * If the receiver is single-select and multiple indices are specified, | |
116 * then all indices are ignored. | |
117 * | |
118 * @param ixs the indices of the items to select | |
119 */ | |
120 protected abstract void listSetSelection(int[] ixs); | |
121 | |
122 /** | |
123 * Shows the selection. If the selection is already showing in the receiver, | |
124 * this method simply returns. Otherwise, the items are scrolled until | |
125 * the selection is visible. | |
126 */ | |
127 protected abstract void listShowSelection(); | |
128 | |
129 /** | |
130 * Deselects all selected items in the underlying widget. | |
131 */ | |
132 protected abstract void listDeselectAll(); | |
133 | |
134 public this(){ | |
135 listMap = new ArraySeq!(Object); | |
136 } | |
137 | |
138 /** | |
139 * Adds the given elements to this list viewer. | |
140 * If this viewer does not have a sorter, the elements are added at the end | |
141 * in the order given; otherwise the elements are inserted at appropriate positions. | |
142 * <p> | |
143 * This method should be called (by the content provider) when elements | |
144 * have been added to the model, in order to cause the viewer to accurately | |
145 * reflect the model. This method only affects the viewer, not the model. | |
146 * </p> | |
147 * | |
148 * @param elements the elements to add | |
149 */ | |
150 public void add(Object[] elements) { | |
151 assertElementsNotNull(elements); | |
152 Object[] filtered = filter(elements); | |
153 ILabelProvider labelProvider = cast(ILabelProvider) getLabelProvider(); | |
154 for (int i = 0; i < filtered.length; i++) { | |
155 Object element = filtered[i]; | |
156 int ix = indexForElement(element); | |
157 insertItem(labelProvider, element, ix); | |
158 } | |
159 } | |
160 | |
161 private void insertItem(ILabelProvider labelProvider, Object element, int index) { | |
162 listAdd(getLabelProviderText(labelProvider, element), index); | |
163 listMap.addAt(index, element); | |
164 mapElement(element, getControl()); // must map it, since findItem only looks in map, if enabled | |
165 } | |
166 | |
167 /** | |
168 * Inserts the given element into this list viewer at the given position. | |
169 * If this viewer has a sorter, the position is ignored and the element is | |
170 * inserted at the correct position in the sort order. | |
171 * <p> | |
172 * This method should be called (by the content provider) when elements have | |
173 * been added to the model, in order to cause the viewer to accurately | |
174 * reflect the model. This method only affects the viewer, not the model. | |
175 * </p> | |
176 * | |
177 * @param element | |
178 * the element | |
179 * @param position | |
180 * a 0-based position relative to the model, or -1 to indicate | |
181 * the last position | |
182 * @since 3.3 | |
183 */ | |
184 public void insert(Object element, int position) { | |
185 if (getComparator() !is null || hasFilters()) { | |
186 add(element); | |
187 return; | |
188 } | |
189 | |
190 insertItem(cast(ILabelProvider) getLabelProvider(), element, position); | |
191 } | |
192 | |
193 | |
194 /** | |
195 * Return the text for the element from the labelProvider. | |
196 * If it is null then return the empty String. | |
197 * @param labelProvider ILabelProvider | |
198 * @param element | |
199 * @return String. Return the emptyString if the labelProvider | |
200 * returns null for the text. | |
201 * | |
202 * @since 3.1 | |
203 */ | |
204 private String getLabelProviderText(ILabelProvider labelProvider, Object element){ | |
205 String text = labelProvider.getText(element); | |
206 if(text is null) { | |
207 return "";//$NON-NLS-1$ | |
208 } | |
209 return text; | |
210 } | |
211 | |
212 /** | |
213 * Adds the given element to this list viewer. | |
214 * If this viewer does not have a sorter, the element is added at the end; | |
215 * otherwise the element is inserted at the appropriate position. | |
216 * <p> | |
217 * This method should be called (by the content provider) when a single element | |
218 * has been added to the model, in order to cause the viewer to accurately | |
219 * reflect the model. This method only affects the viewer, not the model. | |
220 * Note that there is another method for efficiently processing the simultaneous | |
221 * addition of multiple elements. | |
222 * </p> | |
223 * | |
224 * @param element the element | |
225 */ | |
226 public void add(Object element) { | |
227 add([ element ]); | |
228 } | |
229 | |
230 /* (non-Javadoc) | |
231 * Method declared on StructuredViewer. | |
232 * Since DWT.List doesn't use items we always return the List itself. | |
233 */ | |
43
ea8ff534f622
Fix override and super aliases
Frank Benoit <benoit@tionex.de>
parents:
42
diff
changeset
|
234 protected override Widget doFindInputItem(Object element) { |
10 | 235 if (element !is null && opEquals(element, getRoot())) { |
236 return getControl(); | |
237 } | |
238 return null; | |
239 } | |
240 | |
241 /* (non-Javadoc) | |
242 * Method declared on StructuredViewer. | |
243 * Since DWT.List doesn't use items we always return the List itself. | |
244 */ | |
43
ea8ff534f622
Fix override and super aliases
Frank Benoit <benoit@tionex.de>
parents:
42
diff
changeset
|
245 protected override Widget doFindItem(Object element) { |
10 | 246 if (element !is null) { |
247 if (listMapContains(element)) { | |
248 return getControl(); | |
249 } | |
250 } | |
251 return null; | |
252 } | |
253 | |
254 /* (non-Javadoc) | |
255 * Method declared on StructuredViewer. | |
256 */ | |
43
ea8ff534f622
Fix override and super aliases
Frank Benoit <benoit@tionex.de>
parents:
42
diff
changeset
|
257 protected override void doUpdateItem(Widget data, Object element, bool fullMap) { |
10 | 258 if (element !is null) { |
259 int ix = getElementIndex(element); | |
260 if (ix >= 0) { | |
261 ILabelProvider labelProvider = cast(ILabelProvider) getLabelProvider(); | |
262 listSetItem(ix, getLabelProviderText(labelProvider,element)); | |
263 } | |
264 } | |
265 } | |
266 | |
267 /** | |
268 * Returns the element with the given index from this list viewer. | |
269 * Returns <code>null</code> if the index is out of range. | |
270 * | |
271 * @param index the zero-based index | |
272 * @return the element at the given index, or <code>null</code> if the | |
273 * index is out of range | |
274 */ | |
275 public Object getElementAt(int index) { | |
276 if (index >= 0 && index < listMap.size()) { | |
277 return listMap.get(index); | |
278 } | |
279 return null; | |
280 } | |
281 | |
282 /** | |
283 * The list viewer implementation of this <code>Viewer</code> framework | |
284 * method returns the label provider, which in the case of list | |
285 * viewers will be an instance of <code>ILabelProvider</code>. | |
286 */ | |
43
ea8ff534f622
Fix override and super aliases
Frank Benoit <benoit@tionex.de>
parents:
42
diff
changeset
|
287 public override IBaseLabelProvider getLabelProvider() { |
10 | 288 return super.getLabelProvider(); |
289 } | |
290 | |
291 /* (non-Javadoc) | |
292 * Method declared on Viewer. | |
293 */ | |
294 /* (non-Javadoc) | |
295 * Method declared on StructuredViewer. | |
296 */ | |
43
ea8ff534f622
Fix override and super aliases
Frank Benoit <benoit@tionex.de>
parents:
42
diff
changeset
|
297 protected override SeqView!(Object) getSelectionFromWidget() { |
10 | 298 int[] ixs = listGetSelectionIndices(); |
299 ArraySeq!(Object) list = new ArraySeq!(Object); | |
300 list.capacity(ixs.length); | |
301 for (int i = 0; i < ixs.length; i++) { | |
302 Object e = getElementAt(ixs[i]); | |
303 if (e !is null) { | |
304 list.append(e); | |
305 } | |
306 } | |
307 return list; | |
308 } | |
309 | |
310 /** | |
311 * @param element the element to insert | |
312 * @return the index where the item should be inserted. | |
313 */ | |
314 protected int indexForElement(Object element) { | |
315 ViewerComparator comparator = getComparator(); | |
316 if (comparator is null) { | |
317 return listGetItemCount(); | |
318 } | |
319 int count = listGetItemCount(); | |
320 int min = 0, max = count - 1; | |
321 while (min <= max) { | |
322 int mid = (min + max) / 2; | |
323 Object data = listMap.get(mid); | |
324 int compare = comparator.compare(this, data, element); | |
325 if (compare is 0) { | |
326 // find first item > element | |
327 while (compare is 0) { | |
328 ++mid; | |
329 if (mid >= count) { | |
330 break; | |
331 } | |
332 data = listMap.get(mid); | |
333 compare = comparator.compare(this, data, element); | |
334 } | |
335 return mid; | |
336 } | |
337 if (compare < 0) { | |
338 min = mid + 1; | |
339 } else { | |
340 max = mid - 1; | |
341 } | |
342 } | |
343 return min; | |
344 } | |
345 | |
346 /* (non-Javadoc) | |
347 * Method declared on Viewer. | |
348 */ | |
43
ea8ff534f622
Fix override and super aliases
Frank Benoit <benoit@tionex.de>
parents:
42
diff
changeset
|
349 protected override void inputChanged(Object input, Object oldInput) { |
10 | 350 listMap.clear(); |
351 Object[] children = getSortedChildren(getRoot()); | |
352 int size = children.length; | |
353 | |
354 listRemoveAll(); | |
355 String[] labels = new String[size]; | |
356 for (int i = 0; i < size; i++) { | |
357 Object el = children[i]; | |
358 labels[i] = getLabelProviderText(cast(ILabelProvider) getLabelProvider(),el); | |
359 listMap.append(el); | |
360 mapElement(el, getControl()); // must map it, since findItem only looks in map, if enabled | |
361 } | |
362 listSetItems(labels); | |
363 } | |
364 | |
365 /* (non-Javadoc) | |
366 * Method declared on StructuredViewer. | |
367 */ | |
43
ea8ff534f622
Fix override and super aliases
Frank Benoit <benoit@tionex.de>
parents:
42
diff
changeset
|
368 protected override void internalRefresh(Object element) { |
10 | 369 Control list = getControl(); |
370 if (element is null || opEquals(element, getRoot())) { | |
371 // the parent | |
372 if (listMap !is null) { | |
373 listMap.clear(); | |
374 } | |
375 unmapAllElements(); | |
376 auto selection = getSelectionFromWidget(); | |
377 | |
378 int topIndex = -1; | |
379 if (selection is null || selection.drained()) { | |
380 topIndex = listGetTopIndex(); | |
381 } | |
382 | |
70
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
43
diff
changeset
|
383 Object[] children = null; |
10 | 384 list.setRedraw(false); |
70
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
43
diff
changeset
|
385 try { |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
43
diff
changeset
|
386 listRemoveAll(); |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
43
diff
changeset
|
387 |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
43
diff
changeset
|
388 children = getSortedChildren(getRoot()); |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
43
diff
changeset
|
389 String[] items = new String[children.length]; |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
43
diff
changeset
|
390 |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
43
diff
changeset
|
391 ILabelProvider labelProvider = cast(ILabelProvider) getLabelProvider(); |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
43
diff
changeset
|
392 |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
43
diff
changeset
|
393 for (int i = 0; i < items.length; i++) { |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
43
diff
changeset
|
394 Object el = children[i]; |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
43
diff
changeset
|
395 items[i] = getLabelProviderText(labelProvider, el); |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
43
diff
changeset
|
396 listMap.append(el); |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
43
diff
changeset
|
397 mapElement(el, list); // must map it, since findItem only looks in map, if enabled |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
43
diff
changeset
|
398 } |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
43
diff
changeset
|
399 |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
43
diff
changeset
|
400 listSetItems(items); |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
43
diff
changeset
|
401 } finally { |
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
43
diff
changeset
|
402 list.setRedraw(true); |
10 | 403 } |
404 | |
405 if (topIndex is -1) { | |
406 setSelectionToWidget(selection, false); | |
407 } else { | |
408 listSetTopIndex(Math.min(topIndex, children.length)); | |
409 } | |
410 } else { | |
411 doUpdateItem(list, element, true); | |
412 } | |
413 } | |
414 | |
415 /** | |
416 * Returns the index of the item currently at the top of the viewable area. | |
417 * <p> | |
418 * Default implementation returns -1. | |
419 * </p> | |
420 * @return index, -1 for none | |
421 * @since 3.3 | |
422 */ | |
423 protected int listGetTopIndex(){ | |
424 return -1; | |
425 } | |
426 | |
427 /** | |
428 * Sets the index of the item to be at the top of the viewable area. | |
429 * <p> | |
430 * Default implementation does nothing. | |
431 * </p> | |
432 * @param index the given index. -1 for none. index will always refer to a valid index. | |
433 * @since 3.3 | |
434 */ | |
435 protected void listSetTopIndex(int index) { | |
436 } | |
437 | |
438 /** | |
439 * Removes the given elements from this list viewer. | |
440 * | |
441 * @param elements the elements to remove | |
442 */ | |
443 private void internalRemove(Object[] elements) { | |
444 Object input = getInput(); | |
445 for (int i = 0; i < elements.length; ++i) { | |
446 if ( opEquals(elements[i], input)) { | |
447 setInput(null); | |
448 return; | |
449 } | |
450 int ix = getElementIndex(elements[i]); | |
451 if (ix >= 0) { | |
452 listRemove(ix); | |
453 listMap.removeAt(ix); | |
454 unmapElement(elements[i], getControl()); | |
455 } | |
456 } | |
457 } | |
458 | |
459 /** | |
460 * Removes the given elements from this list viewer. | |
461 * The selection is updated if required. | |
462 * <p> | |
463 * This method should be called (by the content provider) when elements | |
464 * have been removed from the model, in order to cause the viewer to accurately | |
465 * reflect the model. This method only affects the viewer, not the model. | |
466 * </p> | |
467 * | |
468 * @param elements the elements to remove | |
469 */ | |
470 public void remove(Object[] elements) { | |
471 assertElementsNotNull(elements); | |
472 if (elements.length is 0) { | |
473 return; | |
474 } | |
42 | 475 preservingSelection(new class(elements) Runnable { |
10 | 476 Object[] elements_; |
39 | 477 this(Object[] a){ |
478 elements_= a; | |
10 | 479 } |
480 public void run() { | |
481 internalRemove(elements_); | |
482 } | |
483 }); | |
484 } | |
485 | |
486 /** | |
487 * Removes the given element from this list viewer. | |
488 * The selection is updated if necessary. | |
489 * <p> | |
490 * This method should be called (by the content provider) when a single element | |
491 * has been removed from the model, in order to cause the viewer to accurately | |
492 * reflect the model. This method only affects the viewer, not the model. | |
493 * Note that there is another method for efficiently processing the simultaneous | |
494 * removal of multiple elements. | |
495 * </p> | |
496 * | |
497 * @param element the element | |
498 */ | |
499 public void remove(Object element) { | |
500 remove([ element ]); | |
501 } | |
502 | |
503 /** | |
504 * The list viewer implementation of this <code>Viewer</code> framework | |
505 * method ensures that the given label provider is an instance of | |
506 * <code>ILabelProvider</code>. | |
507 * | |
508 * <b>The optional interfaces {@link IColorProvider} and | |
509 * {@link IFontProvider} have no effect for this type of viewer</b> | |
510 */ | |
43
ea8ff534f622
Fix override and super aliases
Frank Benoit <benoit@tionex.de>
parents:
42
diff
changeset
|
511 public override void setLabelProvider(IBaseLabelProvider labelProvider) { |
10 | 512 Assert.isTrue( null !is cast(ILabelProvider)labelProvider ); |
513 super.setLabelProvider(labelProvider); | |
514 } | |
515 | |
516 /* (non-Javadoc) | |
517 * Method declared on StructuredViewer. | |
518 */ | |
43
ea8ff534f622
Fix override and super aliases
Frank Benoit <benoit@tionex.de>
parents:
42
diff
changeset
|
519 protected override void setSelectionToWidget(SeqView!(Object) in_, bool reveal) { |
10 | 520 if (in_ is null || in_.size() is 0) { // clear selection |
521 listDeselectAll(); | |
522 } else { | |
523 int n = in_.size(); | |
524 int[] ixs = new int[n]; | |
525 int count = 0; | |
526 for (int i = 0; i < n; ++i) { | |
527 Object el = in_.get(i); | |
528 int ix = getElementIndex(el); | |
529 if (ix >= 0) { | |
530 ixs[count++] = ix; | |
531 } | |
532 } | |
533 if (count < n) { | |
534 System.arraycopy(ixs, 0, ixs = new int[count], 0, count); | |
535 } | |
536 listSetSelection(ixs); | |
537 if (reveal) { | |
538 listShowSelection(); | |
539 } | |
540 } | |
541 } | |
542 | |
543 /** | |
544 * Returns the index of the given element in listMap, or -1 if the element cannot be found. | |
545 * As of 3.3, uses the element comparer if available. | |
546 * | |
547 * @param element | |
548 * @return the index | |
549 */ | |
550 int getElementIndex(Object element) { | |
551 IElementComparer comparer = getComparer(); | |
552 if (comparer is null) { | |
553 int idx = 0; | |
554 foreach( e; listMap ){ | |
555 if( e == element ){ | |
556 return idx; | |
557 } | |
558 idx++; | |
559 } | |
560 return -1; | |
561 } | |
562 int size = listMap.size(); | |
563 for (int i = 0; i < size; i++) { | |
564 if (comparer.opEquals(element, listMap.get(i))) | |
565 return i; | |
566 } | |
567 return -1; | |
568 } | |
569 | |
570 /** | |
571 * @param element | |
572 * @return true if listMap contains the given element | |
573 * | |
574 * @since 3.3 | |
575 */ | |
576 private bool listMapContains(Object element) { | |
577 return getElementIndex(element) !is -1; | |
578 } | |
579 | |
580 } |