org.mockcentral.editor.nodes.expectation.part.wizard
Class ElementListSelector

java.lang.Object
  extended by org.mockcentral.editor.nodes.expectation.part.wizard.ElementListSelector

public class ElementListSelector
extends java.lang.Object

A class used to select matching elements from a supplied array of Objects, for use by AbstractFieldEditor instances.

Author:
David Hutchinson

Constructor Summary
ElementListSelector(AbstractFieldEditor editor, java.lang.String prompt, java.lang.String fieldName, boolean matchRequired, org.eclipse.swt.widgets.Composite parent, org.eclipse.jface.viewers.ILabelProvider labelProvider)
          Creates a new instance.
 
Method Summary
 void setElements(java.lang.Object[] elements)
          Sets the Array of elements for the FilteredList.
 void setFilter(java.lang.String filter)
          Sets the value for the filter used to look for matches.
protected  void updateSelection(java.lang.Object[] selection, java.lang.String textValue)
          Checks for a valid selection in the FilteredList, updates the bean if there is a valid selection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ElementListSelector

public ElementListSelector(AbstractFieldEditor editor,
                           java.lang.String prompt,
                           java.lang.String fieldName,
                           boolean matchRequired,
                           org.eclipse.swt.widgets.Composite parent,
                           org.eclipse.jface.viewers.ILabelProvider labelProvider)
Creates a new instance.

Parameters:
editor - the AbstractFieldEditor enclosing this instance.
fieldName - the name of the Field belonging to the SignaturePartBean being edited.
matchRequired - whether a matching value from the list must be selected, or any value entered into the text control is acceptable.
parent - the Composite within the AbstractFieldEditor that encloses this instance.
labelProvider - the ILabelProvider used for rendering the elements in the list.
Method Detail

setElements

public void setElements(java.lang.Object[] elements)
Sets the Array of elements for the FilteredList.

Parameters:
elements - the Array of elements for the FilteredList.

setFilter

public void setFilter(java.lang.String filter)
Sets the value for the filter used to look for matches. This method places the supplied String into the Text control used for entering matchable values and updates the status.

Parameters:
filter - the value for the filter used to look for matches.

updateSelection

protected void updateSelection(java.lang.Object[] selection,
                               java.lang.String textValue)
Checks for a valid selection in the FilteredList, updates the bean if there is a valid selection.

Parameters:
selection - the current selection in the FilteredList.
textValue - the current text in the Text control.