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 entriesModifier 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, setSingle
getValue, setKey, setValue
addValidator, getKey, getPrettyString, getString, removeValidator, validate, validateInner
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCount, getItems
accept, addValidator, getKey, getPrettyString, getValue, isEmpty, removeValidator, setKey, setValue, validate
getString
protected 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 NameFinder
public T parseItem(java.lang.String v) throws ParseException
ParseException
public void parse(java.lang.String v) throws ParseException
ParseInput
ParseInput.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>
ParseException
public java.lang.Integer parseValue(java.lang.String v) throws ParseException
ParseInput
Input.getString(Object)
method.parseValue
in interface ParseInput<java.lang.Integer>
ParseException
public T getItembyValue(java.lang.Integer value)
ItemInput
getItembyValue
in interface ItemInput<java.lang.Integer,T extends DataObject>
value
- input Valuepublic void setItem(T item)
ItemInput
setItem
in interface ItemInput<java.lang.Integer,T extends DataObject>
public java.util.Set<T> getSuggestions()
AutoComplete
getSuggestions
in interface AutoComplete<T extends DataObject,java.lang.Integer>
public AppContext getContext()
protected Logger getLogger()
public java.lang.String getValue(T item)
AutoComplete
getValue
in interface AutoComplete<T extends DataObject,java.lang.Integer>
public java.lang.String getSuggestionText(T item)
AutoComplete
getSuggestionText
in interface AutoComplete<T extends DataObject,java.lang.Integer>
public java.lang.String getString(java.lang.Integer val)
BaseInput
getString
in interface Input<java.lang.Integer>
getString
in class BaseInput<java.lang.Integer>
ParseInput
public boolean isCreate()
public void setCreate(boolean create)
create
- the create to setpublic java.lang.Integer convert(java.lang.Object v) throws TypeError
Input
public java.lang.String getMatchError()
public void setMatchError(java.lang.String match_error)