public class NameFinderInput<T extends DataObject,F extends DataObjectFactory<T> & NameFinder<T>> extends ParseAbstractInput<java.lang.Integer> implements AutoComplete<T,java.lang.Integer>, DataObjectItemInput<T>
DataObjectItemInput for NameFinder factories.
This is a text AutoComplete input using the permitted names
optionally creating bootstrap entries| Modifier and Type | Field and Description |
|---|---|
protected F |
factory |
validators| Constructor and Description |
|---|
NameFinderInput(F factory,
boolean create,
boolean restrict,
BaseFilter<T> autocomplete)
create input
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Integer |
convert(java.lang.Object v)
Perform any supported type conversions to to generate a value of the
target type
|
AppContext |
getContext() |
T |
getItembyValue(java.lang.Integer value)
get the domain object from the Input value if defined
|
protected Logger |
getLogger() |
java.lang.String |
getMatchError() |
java.lang.String |
getString(java.lang.Integer val)
get a String representation of an Object that is compatible with the way
the input is parsed
|
java.util.Set<T> |
getSuggestions()
Get the set of Items corresponding to a suggested values
|
java.lang.String |
getSuggestionText(T item)
get the suggestion text.
|
java.lang.String |
getValue(T item)
Map an item to the corresponding value (compatible with the parse method).
|
boolean |
isCreate() |
void |
parse(java.lang.String v)
Set the value of the input by parsing a textual representation of the
input.
|
T |
parseItem(java.lang.String v) |
java.lang.Integer |
parseValue(java.lang.String v)
Parse a String into the correct type for this input.
|
void |
setCreate(boolean create) |
void |
setItem(T item)
Set the value of the input using an item
|
void |
setMatchError(java.lang.String match_error) |
accept, getBoxWidth, getMaxResultLength, getSingle, setBoxWidth, setMaxResultLength, setSinglegetValue, setKey, setValueaddValidator, getKey, getPrettyString, getString, removeValidator, validate, validateInnerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetCount, getItemsaccept, addValidator, getKey, getPrettyString, getValue, isEmpty, removeValidator, setKey, setValue, validategetStringprotected final F extends DataObjectFactory<T> & NameFinder<T> factory
public NameFinderInput(F factory, boolean create, boolean restrict, BaseFilter<T> autocomplete)
create - make entry if not foundrestrict - restrict with filterautocomplete - suggestions/restrict filterfactory - DataObjectFactory and NameFinderpublic T parseItem(java.lang.String v) throws ParseException
ParseExceptionpublic void parse(java.lang.String v)
throws ParseException
ParseInputParseInput.parseValue(String) and Input.setValue(Object)
but it can be overridden for example if the natural parse mechanism generates an Item
in an item input.parse in interface ParseInput<java.lang.Integer>ParseExceptionpublic java.lang.Integer parseValue(java.lang.String v)
throws ParseException
ParseInputInput.getString(Object) method.parseValue in interface ParseInput<java.lang.Integer>ParseExceptionpublic T getItembyValue(java.lang.Integer value)
ItemInputgetItembyValue in interface ItemInput<java.lang.Integer,T extends DataObject>value - input Valuepublic void setItem(T item)
ItemInputsetItem in interface ItemInput<java.lang.Integer,T extends DataObject>public java.util.Set<T> getSuggestions()
AutoCompletegetSuggestions in interface AutoComplete<T extends DataObject,java.lang.Integer>public AppContext getContext()
protected Logger getLogger()
public java.lang.String getValue(T item)
AutoCompletegetValue in interface AutoComplete<T extends DataObject,java.lang.Integer>public java.lang.String getSuggestionText(T item)
AutoCompletegetSuggestionText in interface AutoComplete<T extends DataObject,java.lang.Integer>public java.lang.String getString(java.lang.Integer val)
BaseInputgetString in interface Input<java.lang.Integer>getString in class BaseInput<java.lang.Integer>ParseInputpublic boolean isCreate()
public void setCreate(boolean create)
create - the create to setpublic java.lang.Integer convert(java.lang.Object v)
throws TypeError
Inputpublic java.lang.String getMatchError()
public void setMatchError(java.lang.String match_error)