net.sf.jzeno.echo.databinding
Class DynaQuickSelectField

java.lang.Object
  extended by nextapp.echo.AbstractComponent
      extended by net.sf.jzeno.echo.components.CustomComponent
          extended by net.sf.jzeno.echo.databinding.DynaQuickSelectField
All Implemented Interfaces:
java.io.Serializable, BindingTarget, PropertyComponent, RebindableComponent, EventSink, EventSource, Precreation, CollectionChangeListener, Component, FastComponent, FastComponentContainer

public class DynaQuickSelectField
extends CustomComponent
implements FastComponent, Precreation, CollectionChangeListener

Entry field that allows a user to select an object from a list of possibilities by entering a code corresponding to the object to select in an input field , or select the code from a list of possibilities in a dialog .

This component allways selects a single java bean from a list of possible beans. You should bind this component to a property that is the same type as the java beans in the list of possibilities.

See Also:
Serialized Form

Nested Class Summary
 class DynaQuickSelectField.DefaultValidator
           
 
Field Summary
static int CHARACTER_UNITS
           
static int PERCENT_UNITS
           
static int PIXEL_UNITS
           
 
Fields inherited from interface nextapp.echo.Component
BACKGROUND_CHANGED_PROPERTY, CHILDREN_CHANGED_PROPERTY, ENABLED_CHANGED_PROPERTY, FONT_CHANGED_PROPERTY, FOREGROUND_CHANGED_PROPERTY, IDENTIFIER_CHANGED_PROPERTY, LOCALE_CHANGED_PROPERTY, MODEL_CHANGED_PROPERTY, SELECTABLE_CHANGED_PROPERTY, STYLE_BACKGROUND, STYLE_FONT, STYLE_FOREGROUND, UPDATE_PROPERTY, VISIBLE_CHANGED_PROPERTY
 
Constructor Summary
DynaQuickSelectField()
           Creates an unbound component.
DynaQuickSelectField(java.lang.Class beanClass, java.lang.String property, java.lang.String constructionHints)
           Creates a bound component.
 
Method Summary
 void applyContext()
           
 void changed(java.util.Collection collection)
           
 void close(ActionEvent event)
           Closes the dialog with all possible java beans.
 Color getBackground()
          Returns the background color of the component.
 java.util.Comparator getComparator()
           
 Decorator getDecorator()
           Gets the Decorator instance that is used to determine the label values that the user must enter in the input field.
 Decorator getDialogDecorator()
           Gets the decorator implementation that is used in the listbox on the dialog part of this component.
 java.lang.String getDialogLabelProperty()
           Gets the label property that is used in the dialog.
 java.lang.String getDialogTitle()
           Gets the title of the dialog.
 int getDialogWidth()
           
 Font getFont()
          Returns the font.
 Color getForeground()
          Returns the foreground of the component.
 java.lang.String getInvalidMessage()
           Gets the message key that is added to the screen, when the component is marked as invalid.
 java.lang.String getInvalidMessageKey()
          Deprecated.  
 java.lang.String getLabelProperty()
           Gets the property of the java beans, in the list of possibilities, of which the value must be entered by the user in the input field.
 java.util.List getList()
           Gets the list of possible java beans the user can select from.
 int getMaximumLength()
           Gets the maximum number of characters the user can enter in the input field.
 java.lang.String getNullLabel()
           Gets the label, corresponding to the data binding target value null.
 java.lang.Object getSelectedObject()
           Gets the java bean that is currently selected from the list of possible beans.
 java.lang.String getText()
           Gets the currently entered value by the user.
 java.lang.String getToolTipText()
           
 int getWidth()
           Gets the width of the text field.
 int getWidthUnits()
           Gets the units in which width is specified.
 boolean isConvertToLowerCase()
           
 boolean isConvertToUpperCase()
           
 boolean isReadOnly()
           
 boolean isRequired()
           Query if the editor is required to be filled in.
 void open()
           Opens the dialog to allow the user to select from a list of possible java beans.
 void rebind()
           This operation causes the component to reset it's content to that of the domain model.
 void setActionCommand(java.lang.String command)
           
 void setBackground(Color background)
          Sets the background color of the component.
 void setColumns(int columns)
          Deprecated.  
 void setComparator(java.util.Comparator comparator)
           
 void setConvertToLowerCase(boolean convertToLowerCase)
           
 void setConvertToUpperCase(boolean convertToUpperCase)
           
 void setDecorator(Decorator decorator)
           Sets the Decorator instance that is used to determine the label values that the user must enter in the input field.
 void setDialogDecorator(Decorator decorator)
           Sets a decorator implementation that is used in the listbox on the dialog part of this component.
 void setDialogLabelProperty(java.lang.String labelProperty)
           Sets the label property that is used in the dialog.
 void setDialogTitle(java.lang.String title)
           Sets the title of the dialog.
 void setDialogWidth(int i)
           
 void setFocused(boolean newValue)
           Sets whether or not this component has input focus.
 void setFont(Font font)
          Sets the font of the component.
 void setForeground(Color foreground)
          Sets the foreground color of the component.
 void setInvalidMessage(java.lang.String errorMessage)
           Sets the message key that is shown when the component is marked as invalid.
 void setInvalidMessageKey(java.lang.String errorMessage)
          Deprecated.  
 void setLabelProperty(java.lang.String labelProperty)
           Sets the property of the java beans, in the list of possibilities, of which the value must be entered by the user in the input field.
 void setList(java.util.List data)
           Sets the list of possible java beans the user can select from.
 void setMaximumLength(int maxLength)
           Sets the maximum number of characters the user can enter in the input field.
 void setNullLabel(java.lang.String nullLabel)
           Sets the label, corresponding to the data binding target value null.
 void setReadOnly(boolean readOnly)
           Mark this component as read-only.
 void setRequired(boolean required)
           Determine if the editor is required to be filled in.
 void setSelectedObject(java.lang.Object selectedObject)
           Sets the java bean that is currently selected.
 void setText(java.lang.String text)
           Sets the value in the input field.
 void setToolTipText(java.lang.String toolTipText)
           
 void setWidth(int width)
           Sets the width of the text field.
 void setWidthUnits(int units)
           Sets the units in which width is specified.
 void valueChange(ActionEvent event)
           
 
Methods inherited from class net.sf.jzeno.echo.components.CustomComponent
addValidator, fireActionEvent, fireActionEvent, fireActionEvent, getActionCommand, getBean, getBeanClass, getNullObject, getProperty, getValidationErrors, getValidators, getValue, isBound, isMarkedInvalid, isValid, markInvalid, markValid, preRender, removeValidator, setBean, setBeanClass, setNullObject, setProperty, setValue, traceValue, validate
 
Methods inherited from class nextapp.echo.AbstractComponent
add, add, addHierarchyListener, addPropertyChangeListener, applyStyle, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getClientId, getComponent, getComponentCount, getComponents, getEchoInstance, getIdentifier, getListenerList, getLocale, getParent, indexOf, init, isAncestorOf, isDifferent, isEnabled, isFocused, isRecursivelyVisible, isRegistered, isSelectableForScriptRecorder, isShowing, isVisible, processHierarchyEvent, remove, remove, removeAll, removeHierarchyListener, removePropertyChangeListener, setClientId, setEnabled, setIdentifier, setLocale, setParent, setRegistered, setSelectableForScriptRecorder, setVisible, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CHARACTER_UNITS

public static final int CHARACTER_UNITS
See Also:
Constant Field Values

PIXEL_UNITS

public static final int PIXEL_UNITS
See Also:
Constant Field Values

PERCENT_UNITS

public static final int PERCENT_UNITS
See Also:
Constant Field Values
Constructor Detail

DynaQuickSelectField

public DynaQuickSelectField()

Creates an unbound component.


DynaQuickSelectField

public DynaQuickSelectField(java.lang.Class beanClass,
                            java.lang.String property,
                            java.lang.String constructionHints)

Creates a bound component. Bind this componen to a property of type java.util.collection.

Method Detail

open

public void open()

Opens the dialog to allow the user to select from a list of possible java beans.


valueChange

public void valueChange(ActionEvent event)

close

public void close(ActionEvent event)

Closes the dialog with all possible java beans.


rebind

public void rebind()
Description copied from interface: RebindableComponent

This operation causes the component to reset it's content to that of the domain model.

Specified by:
rebind in interface RebindableComponent
Overrides:
rebind in class CustomComponent

setList

public void setList(java.util.List data)

Sets the list of possible java beans the user can select from.


getList

public java.util.List getList()

Gets the list of possible java beans the user can select from.


getMaximumLength

public int getMaximumLength()

Gets the maximum number of characters the user can enter in the input field.


setMaximumLength

public void setMaximumLength(int maxLength)

Sets the maximum number of characters the user can enter in the input field.


setColumns

public void setColumns(int columns)
Deprecated. 

Sets the width of the input field. Specified in characters on screen.


setWidth

public void setWidth(int width)

Sets the width of the text field.


getWidth

public int getWidth()

Gets the width of the text field.


setWidthUnits

public void setWidthUnits(int units)

Sets the units in which width is specified.


getWidthUnits

public int getWidthUnits()

Gets the units in which width is specified.


isRequired

public boolean isRequired()
Description copied from interface: PropertyComponent

Query if the editor is required to be filled in.

Specified by:
isRequired in interface PropertyComponent
Overrides:
isRequired in class CustomComponent

setRequired

public void setRequired(boolean required)
Description copied from interface: PropertyComponent

Determine if the editor is required to be filled in.

Specified by:
setRequired in interface PropertyComponent
Overrides:
setRequired in class CustomComponent

getText

public java.lang.String getText()

Gets the currently entered value by the user.


setText

public void setText(java.lang.String text)

Sets the value in the input field.


getInvalidMessage

public java.lang.String getInvalidMessage()

Gets the message key that is added to the screen, when the component is marked as invalid. Also see setInvalidMessage(String).


getInvalidMessageKey

public java.lang.String getInvalidMessageKey()
Deprecated. 


setInvalidMessage

public void setInvalidMessage(java.lang.String errorMessage)

Sets the message key that is shown when the component is marked as invalid. Typically the component is marked invalid when you call EchoSupport.doValidationRecursively(Component) in your code. The value specified for this property is translated through the i18n support in jZeno (i18n.properties).


setInvalidMessageKey

public void setInvalidMessageKey(java.lang.String errorMessage)
Deprecated. 


setNullLabel

public void setNullLabel(java.lang.String nullLabel)

Sets the label, corresponding to the data binding target value null. If the user selects this label (which will appear at the top of the list), the value null will be written to the data binding target. If the data binding target is null this label will be selected on the screen. If you don't want a selection corresponding to null, set this property to null (this is also the default).


getNullLabel

public java.lang.String getNullLabel()

Gets the label, corresponding to the data binding target value null. Also see setNullLabel(String).


isReadOnly

public boolean isReadOnly()
Specified by:
isReadOnly in interface PropertyComponent
Overrides:
isReadOnly in class CustomComponent

setReadOnly

public void setReadOnly(boolean readOnly)
Description copied from interface: PropertyComponent

Mark this component as read-only.

Specified by:
setReadOnly in interface PropertyComponent
Overrides:
setReadOnly in class CustomComponent

setFocused

public void setFocused(boolean newValue)

Sets whether or not this component has input focus.

Specified by:
setFocused in interface Component
Overrides:
setFocused in class AbstractComponent
Parameters:
newValue - True if the component is to be focused.

getSelectedObject

public java.lang.Object getSelectedObject()

Gets the java bean that is currently selected from the list of possible beans.


setSelectedObject

public void setSelectedObject(java.lang.Object selectedObject)

Sets the java bean that is currently selected.


setDialogDecorator

public void setDialogDecorator(Decorator decorator)

Sets a decorator implementation that is used in the listbox on the dialog part of this component. This allows you to provide a more complex label in the dialog.


getDialogDecorator

public Decorator getDialogDecorator()

Gets the decorator implementation that is used in the listbox on the dialog part of this component.


setDialogLabelProperty

public void setDialogLabelProperty(java.lang.String labelProperty)

Sets the label property that is used in the dialog. This allows you to have a different label property used to determine user input in the input field, than in the dialog.


getDialogLabelProperty

public java.lang.String getDialogLabelProperty()

Gets the label property that is used in the dialog.


setDialogTitle

public void setDialogTitle(java.lang.String title)

Sets the title of the dialog.


getDialogTitle

public java.lang.String getDialogTitle()

Gets the title of the dialog.


getDecorator

public Decorator getDecorator()

Gets the Decorator instance that is used to determine the label values that the user must enter in the input field.

Specified by:
getDecorator in interface PropertyComponent
Overrides:
getDecorator in class CustomComponent

setDecorator

public void setDecorator(Decorator decorator)

Sets the Decorator instance that is used to determine the label values that the user must enter in the input field.

Specified by:
setDecorator in interface PropertyComponent
Overrides:
setDecorator in class CustomComponent

getLabelProperty

public java.lang.String getLabelProperty()

Gets the property of the java beans, in the list of possibilities, of which the value must be entered by the user in the input field.


setLabelProperty

public void setLabelProperty(java.lang.String labelProperty)

Sets the property of the java beans, in the list of possibilities, of which the value must be entered by the user in the input field.


setComparator

public void setComparator(java.util.Comparator comparator)

getComparator

public java.util.Comparator getComparator()

setBackground

public void setBackground(Color background)
Description copied from interface: Component
Sets the background color of the component.

Specified by:
setBackground in interface Component
Overrides:
setBackground in class AbstractComponent
Parameters:
background - The new background color of the component.

getBackground

public Color getBackground()
Description copied from interface: Component
Returns the background color of the component.

Specified by:
getBackground in interface Component
Overrides:
getBackground in class AbstractComponent
Returns:
The background color of the component.

setForeground

public void setForeground(Color foreground)
Description copied from interface: Component
Sets the foreground color of the component.

Specified by:
setForeground in interface Component
Overrides:
setForeground in class AbstractComponent
Parameters:
foreground - The new foreground color of the component.

getForeground

public Color getForeground()
Description copied from interface: Component
Returns the foreground of the component.

Specified by:
getForeground in interface Component
Overrides:
getForeground in class AbstractComponent
Returns:
The foreground of the component.

setDialogWidth

public void setDialogWidth(int i)

getDialogWidth

public int getDialogWidth()

applyContext

public void applyContext()
Specified by:
applyContext in interface Precreation

getToolTipText

public java.lang.String getToolTipText()

setToolTipText

public void setToolTipText(java.lang.String toolTipText)

setFont

public void setFont(Font font)
Description copied from interface: Component
Sets the font of the component.

Specified by:
setFont in interface Component
Overrides:
setFont in class AbstractComponent
Parameters:
font - The new font of the component.

getFont

public Font getFont()
Description copied from interface: Component
Returns the font.

Specified by:
getFont in interface Component
Overrides:
getFont in class AbstractComponent
Returns:
The font of the component.

changed

public void changed(java.util.Collection collection)
Specified by:
changed in interface CollectionChangeListener

isConvertToLowerCase

public boolean isConvertToLowerCase()

isConvertToUpperCase

public boolean isConvertToUpperCase()

setConvertToLowerCase

public void setConvertToLowerCase(boolean convertToLowerCase)

setConvertToUpperCase

public void setConvertToUpperCase(boolean convertToUpperCase)

setActionCommand

public void setActionCommand(java.lang.String command)
Specified by:
setActionCommand in interface EventSource
Overrides:
setActionCommand in class CustomComponent