public class TextSearchField extends SearchField
SearchField.Meaning, SearchField.OrderComparator
Modifier and Type | Field and Description |
---|---|
protected boolean |
freeSearch |
protected boolean |
halfWidth |
protected java.lang.String |
hint |
protected boolean |
number |
advanced, data, displayName, id, meaning, visible
Constructor and Description |
---|
TextSearchField() |
TextSearchField(java.lang.String id,
java.lang.String displayName,
boolean advanced,
boolean halfWidth,
java.lang.String hint,
boolean freeSearch,
boolean number) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getHint()
The hint to display inside the search field
|
boolean |
isFreeSearch()
Returns true if this is the "free search" field.
|
boolean |
isHalfWidth()
Set to true to make the field appear next to the one before (only needed on the second
field).
|
boolean |
isNumber()
Set to true if only numbers are allowed in this field
|
void |
setFreeSearch(boolean freeSearch)
Set to true if this is the "free search" field.
|
void |
setHalfWidth(boolean halfWidth)
Set to true to make the field appear next to the one before (only needed on the second
field).
|
void |
setHint(java.lang.String hint)
The hint to display inside the search field
|
void |
setNumber(boolean number)
Set to true if only numbers are allowed in this field
|
org.json.JSONObject |
toJSON()
Serialize a SearchField to a JSONObject.
|
fromJSON, getData, getDisplayName, getId, getMeaning, isAdvanced, isVisible, setAdvanced, setData, setDisplayName, setId, setMeaning, setVisible, toString
protected java.lang.String hint
protected boolean freeSearch
protected boolean number
protected boolean halfWidth
public TextSearchField()
public TextSearchField(java.lang.String id, java.lang.String displayName, boolean advanced, boolean halfWidth, java.lang.String hint, boolean freeSearch, boolean number)
id
- ID of the search field, later given to your search() functiondisplayName
- The name to display for the search fieldadvanced
- Set if this field should only be shown when showing the advanced search
formhalfWidth
- Set to true to make the field appear next to the one before (only needed
on the second field). The displayName will not be shown.hint
- The hint to display inside the search fieldfreeSearch
- Set to true if this is the "free search" field. There may only be one or
none of those in one librarynumber
- Set to true if only numbers are allowed in this fieldpublic java.lang.String getHint()
public void setHint(java.lang.String hint)
public boolean isFreeSearch()
public void setFreeSearch(boolean freeSearch)
public boolean isNumber()
public void setNumber(boolean number)
public boolean isHalfWidth()
public void setHalfWidth(boolean halfWidth)
public org.json.JSONObject toJSON() throws org.json.JSONException
SearchField
toJSON
in class SearchField
org.json.JSONException