Humboldt Alignment Editor 2.5.0

eu.esdihumboldt.hale.ui.util.selector
Class AbstractSelector<T>

java.lang.Object
  extended by eu.esdihumboldt.hale.ui.util.selector.AbstractSelector<T>
Type Parameters:
T - the type of the object to be selected
All Implemented Interfaces:
org.eclipse.jface.viewers.ISelectionProvider
Direct Known Subclasses:
EntitySelector, PropertyDefinitionSelector, SchemaPresetSelector, TypeDefinitionSelector

public abstract class AbstractSelector<T>
extends Object
implements org.eclipse.jface.viewers.ISelectionProvider

Abstract selector control based on a TableViewer.

Author:
Simon Templer

Constructor Summary
AbstractSelector(org.eclipse.swt.widgets.Composite parent, org.eclipse.jface.viewers.ILabelProvider labelProvider, org.eclipse.jface.viewers.ViewerFilter[] filters)
          Create a selector.
 
Method Summary
 boolean accepts(Object candidate)
          Determines if the given object matches the selector's filters.
 void addSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener)
           
protected abstract  AbstractViewerSelectionDialog<T,?> createSelectionDialog(org.eclipse.swt.widgets.Shell parentShell)
          Create the dialog for selecting an entity.
protected  void fireSelectionChange()
          Fires a selection change and sets the last selection to the given selection.
 org.eclipse.swt.widgets.Control getControl()
          Get the main selector control
 T getSelectedObject()
          Get the selected entity definition
 org.eclipse.jface.viewers.ISelection getSelection()
           
 void removeSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener)
           
 void setSelection(org.eclipse.jface.viewers.ISelection selection)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractSelector

public AbstractSelector(org.eclipse.swt.widgets.Composite parent,
                        org.eclipse.jface.viewers.ILabelProvider labelProvider,
                        org.eclipse.jface.viewers.ViewerFilter[] filters)
Create a selector.

Parameters:
parent - the parent composite
labelProvider - the label provider for the selector
filters - the filters for the selector, may be null
Method Detail

accepts

public boolean accepts(Object candidate)
Determines if the given object matches the selector's filters.

Parameters:
candidate - the object to test
Returns:
if the object is accepted by all filters

addSelectionChangedListener

public void addSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener)
Specified by:
addSelectionChangedListener in interface org.eclipse.jface.viewers.ISelectionProvider
See Also:
ISelectionProvider.addSelectionChangedListener(ISelectionChangedListener)

getSelection

public org.eclipse.jface.viewers.ISelection getSelection()
Specified by:
getSelection in interface org.eclipse.jface.viewers.ISelectionProvider
See Also:
ISelectionProvider.getSelection()

removeSelectionChangedListener

public void removeSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener listener)
Specified by:
removeSelectionChangedListener in interface org.eclipse.jface.viewers.ISelectionProvider
See Also:
ISelectionProvider.removeSelectionChangedListener(ISelectionChangedListener)

setSelection

public void setSelection(org.eclipse.jface.viewers.ISelection selection)
Specified by:
setSelection in interface org.eclipse.jface.viewers.ISelectionProvider
See Also:
ISelectionProvider.setSelection(ISelection)

fireSelectionChange

protected void fireSelectionChange()
Fires a selection change and sets the last selection to the given selection.


createSelectionDialog

protected abstract AbstractViewerSelectionDialog<T,?> createSelectionDialog(org.eclipse.swt.widgets.Shell parentShell)
Create the dialog for selecting an entity.

Parameters:
parentShell - the parent shell for the dialog
Returns:
the entity dialog

getControl

public org.eclipse.swt.widgets.Control getControl()
Get the main selector control

Returns:
the main control

getSelectedObject

public T getSelectedObject()
Get the selected entity definition

Returns:
the selected entity definition or null

Humboldt Alignment Editor 2.5.0

Build 2012-12-03_12-30-59
Revision 9d2dd4b0318cda9f1393b1ddd390f7f792d70a2d