Mercurial > projects > dwt-addons
comparison dwtx/jface/viewers/ArrayContentProvider.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 |
comparison
equal
deleted
inserted
replaced
103:2d6540440fe6 | 104:04b47443bb01 |
---|---|
14 module dwtx.jface.viewers.ArrayContentProvider; | 14 module dwtx.jface.viewers.ArrayContentProvider; |
15 | 15 |
16 import dwtx.jface.viewers.IStructuredContentProvider; | 16 import dwtx.jface.viewers.IStructuredContentProvider; |
17 import dwtx.jface.viewers.Viewer; | 17 import dwtx.jface.viewers.Viewer; |
18 | 18 |
19 import tango.util.collection.model.View; | |
20 | 19 |
21 import dwt.dwthelper.utils; | 20 import dwt.dwthelper.utils; |
21 import dwtx.dwtxhelper.Collection; | |
22 | 22 |
23 /** | 23 /** |
24 * This implementation of <code>IStructuredContentProvider</code> handles | 24 * This implementation of <code>IStructuredContentProvider</code> handles |
25 * the case where the viewer input is an unchanging array or collection of elements. | 25 * the case where the viewer input is an unchanging array or collection of elements. |
26 * <p> | 26 * <p> |
38 */ | 38 */ |
39 public Object[] getElements(Object inputElement) { | 39 public Object[] getElements(Object inputElement) { |
40 if ( auto aw = cast(ArrayWrapperT!(T)) inputElement ) { | 40 if ( auto aw = cast(ArrayWrapperT!(T)) inputElement ) { |
41 return aw.array; | 41 return aw.array; |
42 } | 42 } |
43 if ( auto col = cast(View!(T)) inputElement ) { | 43 if ( auto col = cast(Collection) inputElement ) { |
44 return col.toArray(); | 44 return col.toArray(); |
45 } | 45 } |
46 return null; | 46 return null; |
47 } | 47 } |
48 | 48 |