Mercurial > projects > dwt-addons
diff dwtx/jface/viewers/IStructuredSelection.d @ 10:b6c35faf97c8
Viewers
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Mon, 31 Mar 2008 00:47:19 +0200 |
parents | |
children | 46a6e0e6ccd4 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/dwtx/jface/viewers/IStructuredSelection.d Mon Mar 31 00:47:19 2008 +0200 @@ -0,0 +1,59 @@ +/******************************************************************************* + * Copyright (c) 2000, 2006 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + * Port to the D programming language: + * Frank Benoit <benoit@tionex.de> + *******************************************************************************/ +module dwtx.jface.viewers.IStructuredSelection; + +import dwtx.jface.viewers.ISelection; + +import tango.util.collection.model.SeqView; +import tango.util.collection.model.Iterator; + +/** + * A selection containing elements. + */ +public interface IStructuredSelection : ISelection { + /** + * Returns the first element in this selection, or <code>null</code> + * if the selection is empty. + * + * @return an element, or <code>null</code> if none + */ + public Object getFirstElement(); + + /** + * Returns an iterator over the elements of this selection. + * + * @return an iterator over the selected elements + */ + public Iterator!(Object) iterator(); + + /** + * Returns the number of elements selected in this selection. + * + * @return the number of elements selected + */ + public int size(); + + /** + * Returns the elements in this selection as an array. + * + * @return the selected elements as an array + */ + public Object[] toArray(); + + /** + * Returns the elements in this selection as a <code>List</code>. + * + * @return the selected elements as a list + */ + public SeqView!(Object) toList(); +}