de.cau.cs.kieler.core.ui.commands
Class SelectObjectsFromListDialog<Type>

java.lang.Object
  extended by de.cau.cs.kieler.core.ui.commands.SelectObjectsFromListDialog<Type>
Type Parameters:
Type - The type of object
All Implemented Interfaces:
IBaseLabelProvider, IContentProvider, ILabelProvider, IStructuredContentProvider
Direct Known Subclasses:
AffectedFileSelectionDialog, AffectedFileSelectionDialog

public class SelectObjectsFromListDialog<Type>
extends Object
implements IStructuredContentProvider, ILabelProvider

Dialog for selecting object from a list of objects.

Rating proposed yellow
(2010-06-14) soh

Constructor Summary
SelectObjectsFromListDialog(Shell theShell, List<Type> allParam, String messageParam)
          Creates a new dialog.
SelectObjectsFromListDialog(Shell theShell, List<Type> allParam, String messageParam, FunctionReturningString<Type> toStringParam)
          Creates a new dialog.
 
Method Summary
 void addListener(ILabelProviderListener listener)
          
 void dispose()
          
 Object[] getElements(Object inputElement)
          
 Image getImage(Object element)
          
 String getText(Object element)
          
 void inputChanged(Viewer viewer, Object oldInput, Object newInput)
          
 boolean isLabelProperty(Object element, String property)
          
 List<Type> openDialog()
          Open the list selection dialog.
 void removeListener(ILabelProviderListener listener)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SelectObjectsFromListDialog

public SelectObjectsFromListDialog(Shell theShell,
                                   List<Type> allParam,
                                   String messageParam,
                                   FunctionReturningString<Type> toStringParam)
Creates a new dialog.

Parameters:
theShell - the shell
allParam - the initial objects.
messageParam - the message to display
toStringParam - a function for conversion to string

SelectObjectsFromListDialog

public SelectObjectsFromListDialog(Shell theShell,
                                   List<Type> allParam,
                                   String messageParam)
Creates a new dialog.

Parameters:
theShell - the shell
allParam - the initial objects.
messageParam - the message to display
Method Detail

openDialog

public List<Type> openDialog()
Open the list selection dialog.

Returns:
the list of object selected by the user

getElements

public Object[] getElements(Object inputElement)

Specified by:
getElements in interface IStructuredContentProvider

dispose

public void dispose()

Specified by:
dispose in interface IBaseLabelProvider
Specified by:
dispose in interface IContentProvider

inputChanged

public void inputChanged(Viewer viewer,
                         Object oldInput,
                         Object newInput)

Specified by:
inputChanged in interface IContentProvider

getImage

public Image getImage(Object element)

Specified by:
getImage in interface ILabelProvider

getText

public String getText(Object element)

Specified by:
getText in interface ILabelProvider

addListener

public void addListener(ILabelProviderListener listener)

Specified by:
addListener in interface IBaseLabelProvider

isLabelProperty

public boolean isLabelProperty(Object element,
                               String property)

Specified by:
isLabelProperty in interface IBaseLabelProvider

removeListener

public void removeListener(ILabelProviderListener listener)

Specified by:
removeListener in interface IBaseLabelProvider