nl.coderight.jazz.form.field.lookup
Class LookupField<V>

java.lang.Object
  extended by nl.coderight.jazz.form.FormField<V>
      extended by nl.coderight.jazz.form.FormControl<V>
          extended by nl.coderight.jazz.form.field.scrollable.ScrollableField<V>
              extended by nl.coderight.jazz.form.field.selectable.SelectableField<V>
                  extended by nl.coderight.jazz.form.field.selectable.ListSelectableField<V>
                      extended by nl.coderight.jazz.form.field.lookup.LookupField<V>
All Implemented Interfaces:
ClipboardSupport, Editable, DataBindable<V>, DataSelectable<V>, Validation
Direct Known Subclasses:
LookupComboField, LookupTextField

public abstract class LookupField<V>
extends ListSelectableField<V>
implements Validation, Editable, ClipboardSupport

Base class for lookup fields (auto-complete).

See Also:
LookupTextField, LookupComboField

Nested Class Summary
protected  class LookupField.ListModel
           
 
Nested classes/interfaces inherited from class nl.coderight.jazz.form.field.selectable.SelectableField
SelectableField.KeyTypeSearchListener
 
Nested classes/interfaces inherited from class nl.coderight.jazz.form.field.scrollable.ScrollableField
ScrollableField.ScrollBarCorner, ScrollableField.ScrollBarPolicy
 
Field Summary
 
Fields inherited from class nl.coderight.jazz.form.FormField
Config
 
Constructor Summary
LookupField(String bindID, String selectID)
           
 
Method Summary
protected  void backupSelection()
           
protected abstract  void configPopupComponent(LookupField.ListModel model)
           
 void copy()
           
 void cut()
           
 String getDisplayID()
           
 ValidationError getError()
           
protected  nl.coderight.jazz.form.field.lookup.LookupField.LookupEditor getField()
           
 String getLookupID()
           
 String getText()
           
 V getValue()
          Returns field value.
 boolean hasFocus()
           
protected abstract  void hidePopup()
           
 boolean isEditable()
           
protected abstract  boolean isPopupVisible()
           
 boolean isScrollable()
           
 boolean isValid()
           
 int locationToIndex(Point point)
           
protected  void notifyDataChanged()
           
protected  void onKeyTyped(KeyEvent evt)
           
protected  void onSelect()
           
 void paste()
           
protected  void restoreSelection()
           
 void setCopyAction(Action action)
           
 void setCutAction(Action action)
           
 void setDisplayID(String displayID)
           
 void setEditable(boolean editable)
           
 void setIcon(Icon icon)
           
 void setLength(int length)
           
 void setLookupID(String lookupID)
          Sets the match property.
 void setLookupIgnoreCase(boolean ignoreCase)
          Turn case-sensitive lookup on/off.
 void setLookupMinimumLength(int length)
          Sets the minimum characters for the popup to become visible.
 void setMask(String mask)
           
 void setMask(String mask, boolean containsLiteralCharacters)
           
 void setMaxLength(int maxLength)
           
 void setOnChangeEvent(Event onChangeEvent)
           
 void setPasteAction(Action action)
           
protected abstract  void setRenderer(ListCellRenderer renderer)
           
 void setRequired(boolean required)
           
 void setRequiredMessage(Message message)
           
 void setValue(V value)
          Sets field value.
protected abstract  void showPopup()
           
 void validate()
           
 
Methods inherited from class nl.coderight.jazz.form.field.selectable.ListSelectableField
createSortComparator, delete, delete, getData, getIndex, getValue, getValueAt, getValueCount, insert, insert, onFilterChanged, onRebuildFinished, onRebuildProgress, onRebuildStart, setData, setValueAt, sort, update
 
Methods inherited from class nl.coderight.jazz.form.field.selectable.SelectableField
addFilter, dispose, filter, getBindID, getFilters, getRelationID, getSelectedIndex, getSelectID, getSelectionBackground, getSelectionCount, getSelectionForeground, getSortComparator, getSortID, getSortOrder, isSortingEnabled, onChange, onFocusGained, onPopup, onSearchFinished, onSearchProgress, onSearchStart, search, search, searchAll, setOnSelectAction, setOnSelectCondition, setOnSelectEvent, setOnSelectGroup, setRelationID, setSelectedIndex, setSelectID, setSelectionBackground, setSelectionForeground, setSortComparator, setSortID, setSortingEnabled, setSortOrder
 
Methods inherited from class nl.coderight.jazz.form.field.scrollable.ScrollableField
getComponent, getFocusComponent, getPreferredSize, getViewportSize, isOpaque, onViewportChanged, setBackground, setBackgroundImage, setBorder, setColumnHeader, setComponent, setCorner, setEnabled, setForeground, setOpaque, setPreferredSize, setRowHeader, setScrollable, setScrollBarPolicy, setTitle
 
Methods inherited from class nl.coderight.jazz.form.FormControl
addField, addField, focus, focusField, focusNextField, focusPreviousField, getFields, registerKeyboardAction, setComponent, setLayout
 
Methods inherited from class nl.coderight.jazz.form.FormField
dispatchEvent, focusNextField, focusPreviousField, getBackground, getBorder, getCursor, getDataBinding, getForeground, getForm, getLabel, getParent, getToolTip, isBindable, isChanged, isEnabled, isFocusable, isReadonly, isShowing, isValueChanged, isVisible, onClick, onDoubleClick, onFocusLost, onMouseEnter, onMouseLeave, setBindID, setChanged, setCursor, setDataBinding, setFocusable, setOnFocusGainedEvent, setOnFocusLostEvent, setPopupMenu, setReadonly, setToolTip, setVisible, translate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface nl.coderight.jazz.form.field.bindable.DataBindable
isReadonly
 

Constructor Detail

LookupField

public LookupField(String bindID,
                   String selectID)
Method Detail

getField

protected final nl.coderight.jazz.form.field.lookup.LookupField.LookupEditor getField()

setIcon

public void setIcon(Icon icon)

getLookupID

public String getLookupID()

setLookupID

public void setLookupID(String lookupID)
Sets the match property.

Parameters:
lookupID -

getDisplayID

public String getDisplayID()

setDisplayID

public void setDisplayID(String displayID)

setLength

public void setLength(int length)

setMaxLength

public void setMaxLength(int maxLength)

setMask

public void setMask(String mask)

setMask

public void setMask(String mask,
                    boolean containsLiteralCharacters)

setCopyAction

public void setCopyAction(Action action)

setCutAction

public void setCutAction(Action action)

setPasteAction

public void setPasteAction(Action action)

copy

public void copy()
Specified by:
copy in interface ClipboardSupport

cut

public void cut()
Specified by:
cut in interface ClipboardSupport

paste

public void paste()
Specified by:
paste in interface ClipboardSupport

getText

public String getText()

locationToIndex

public final int locationToIndex(Point point)
Specified by:
locationToIndex in class SelectableField<V>

isScrollable

public final boolean isScrollable()
Overrides:
isScrollable in class ScrollableField<V>

hasFocus

public boolean hasFocus()
Overrides:
hasFocus in class FormControl<V>

setLookupIgnoreCase

public void setLookupIgnoreCase(boolean ignoreCase)
Turn case-sensitive lookup on/off.


setLookupMinimumLength

public void setLookupMinimumLength(int length)
Sets the minimum characters for the popup to become visible.


isEditable

public boolean isEditable()
Specified by:
isEditable in interface Editable

setEditable

public void setEditable(boolean editable)
Specified by:
setEditable in interface Editable

setOnChangeEvent

public void setOnChangeEvent(Event onChangeEvent)
Overrides:
setOnChangeEvent in class SelectableField<V>

setRequired

public void setRequired(boolean required)

setRequiredMessage

public void setRequiredMessage(Message message)

validate

public void validate()
              throws ValidationException
Specified by:
validate in interface Validation
Throws:
ValidationException

isValid

public boolean isValid()
Specified by:
isValid in interface Validation

getError

public ValidationError getError()
Specified by:
getError in interface Validation

getValue

public V getValue()
Description copied from class: FormField
Returns field value.

Specified by:
getValue in interface DataSelectable<V>
Overrides:
getValue in class SelectableField<V>

setValue

public void setValue(V value)
Description copied from class: FormField
Sets field value.

Specified by:
setValue in interface DataSelectable<V>
Overrides:
setValue in class SelectableField<V>

setRenderer

protected abstract void setRenderer(ListCellRenderer renderer)

configPopupComponent

protected abstract void configPopupComponent(LookupField.ListModel model)

isPopupVisible

protected abstract boolean isPopupVisible()

showPopup

protected abstract void showPopup()

hidePopup

protected abstract void hidePopup()

onSelect

protected void onSelect()
Overrides:
onSelect in class SelectableField<V>

onKeyTyped

protected void onKeyTyped(KeyEvent evt)

notifyDataChanged

protected void notifyDataChanged()
Specified by:
notifyDataChanged in class ListSelectableField<V>

backupSelection

protected final void backupSelection()
Overrides:
backupSelection in class ListSelectableField<V>

restoreSelection

protected final void restoreSelection()
Overrides:
restoreSelection in class ListSelectableField<V>


Copyright 2010 CodeRight, All rights reserved.