Mercurial > projects > dwt-addons
annotate dwtx/jface/viewers/IStructuredSelection.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 | 46a6e0e6ccd4 |
children |
rev | line source |
---|---|
10 | 1 /******************************************************************************* |
70
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
10
diff
changeset
|
2 * Copyright (c) 2000, 2007 IBM Corporation and others. |
10 | 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 * Port to the D programming language: | |
11 * Frank Benoit <benoit@tionex.de> | |
12 *******************************************************************************/ | |
13 module dwtx.jface.viewers.IStructuredSelection; | |
14 | |
15 import dwtx.jface.viewers.ISelection; | |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
70
diff
changeset
|
16 import dwtx.dwtxhelper.Collection; |
10 | 17 |
18 /** | |
19 * A selection containing elements. | |
20 */ | |
21 public interface IStructuredSelection : ISelection { | |
22 /** | |
23 * Returns the first element in this selection, or <code>null</code> | |
24 * if the selection is empty. | |
25 * | |
26 * @return an element, or <code>null</code> if none | |
27 */ | |
28 public Object getFirstElement(); | |
29 | |
30 /** | |
31 * Returns an iterator over the elements of this selection. | |
32 * | |
33 * @return an iterator over the selected elements | |
34 */ | |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
70
diff
changeset
|
35 public Iterator iterator(); |
10 | 36 |
37 /** | |
38 * Returns the number of elements selected in this selection. | |
39 * | |
40 * @return the number of elements selected | |
41 */ | |
42 public int size(); | |
43 | |
44 /** | |
45 * Returns the elements in this selection as an array. | |
46 * | |
47 * @return the selected elements as an array | |
48 */ | |
49 public Object[] toArray(); | |
50 | |
51 /** | |
52 * Returns the elements in this selection as a <code>List</code>. | |
70
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
10
diff
changeset
|
53 * <strong>Note</strong> In the default implementation of {@link #toList()} in |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
70
diff
changeset
|
54 * {@link StructuredSelection} the returned list is not a copy of the elements of the |
70
46a6e0e6ccd4
Merge with d-fied sources of 3.4M7
Frank Benoit <benoit@tionex.de>
parents:
10
diff
changeset
|
55 * receiver and modifying it will modify the contents of the selection. |
10 | 56 * |
57 * @return the selected elements as a list | |
58 */ | |
104
04b47443bb01
Reworked the collection uses to make use of a wrapper collection that is compatible to the Java Collections.
Frank Benoit <benoit@tionex.de>
parents:
70
diff
changeset
|
59 public List toList(); |
10 | 60 } |