|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectComposite
org.spiffyui.client.widgets.multivaluesuggest.MultivalueSuggestBoxBase
public abstract class MultivalueSuggestBoxBase
A SuggestBox that allows for multiple values selection and autocomplete.
Nested Class Summary | |
---|---|
class |
MultivalueSuggestBoxBase.Option
Bean for name-value pairs |
protected class |
MultivalueSuggestBoxBase.OptionResultSet
Bean for total size and options |
class |
MultivalueSuggestBoxBase.OptionSuggestion
A bean to serve as a custom suggestion so that the value is available and the replace will look like it is supporting multivalues |
protected class |
MultivalueSuggestBoxBase.SelectedItem
This class represents a UI element for a selected item. |
Constructor Summary | |
---|---|
MultivalueSuggestBoxBase(MultivalueSuggestHelper restHelper,
boolean isMultivalued)
Constructor that will place the FormFeedback for you. |
|
MultivalueSuggestBoxBase(MultivalueSuggestHelper helper,
boolean isMultivalued,
boolean placeFormFeedback)
Constructor. |
Method Summary | |
---|---|
HandlerRegistration |
addKeyUpHandler(KeyUpHandler handler)
Add a KeyUpHandler to the suggest box |
HandlerRegistration |
addValueChangeHandler(
|
protected MultivalueSuggestBoxBase.Option |
createOption(JSONObject jsonOpt)
Create and return a new Option with fields populated |
protected MultivalueSuggestBoxBase.OptionSuggestion |
createOptionSuggestion(MultivalueSuggestBoxBase.Option o,
java.lang.String fullText,
java.lang.String query)
Create and return a new OptionSuggestion with fields populated |
FormFeedback |
getFeedback()
Get the FormFeedback widget used. |
protected MultivalueSuggestHelper |
getHelper()
Get the suggest helper for this suggest box. |
java.lang.String |
getInvalidReason(java.lang.String invalids,
java.lang.String reason)
Get the parameterized localized String for invalid values. |
java.lang.String |
getInvalidText(java.lang.String invalids)
Get the parameterized localized String for invalid values. |
SuggestBox |
getSuggestBox()
Gets the SuggestBox field |
int |
getTabIndex()
|
java.lang.String |
getText()
Gets the text within the text field of the suggest box |
java.lang.String |
getValue()
Get the value(s) as a String. |
java.util.Map<java.lang.String,java.lang.String> |
getValueMap()
Get the value map |
protected void |
handleQueryResponse(RESTObjectCallBack<MultivalueSuggestBoxBase.OptionResultSet> callback,
JSONValue val)
Handle the query response for getting items to suggest. |
void |
onKeyUp(KeyUpEvent event)
|
void |
onLoad()
|
void |
onSelection(
|
protected abstract void |
queryOptions(java.lang.String query,
int from,
int to,
RESTObjectCallBack<MultivalueSuggestBoxBase.OptionResultSet> callback)
Retrieve Options (name-value pairs) that are suggested |
void |
setAccessKey(char key)
|
void |
setDelay(int delay)
Set the time in milliseconds a user should stop typing before a query to the server is sent. |
void |
setDisplaySeparator(java.lang.String displaySeparator)
Set the delimiting character(s) between the display texts. |
void |
setFeedback(FormFeedback feedback)
Set the FormFeedback widget used. |
void |
setFocus(boolean focused)
|
void |
setLoadingText(java.lang.String loadingText)
Sets the loading text String |
void |
setPageSize(int pageSize)
Set the maximum number of options in the selection dropdown list at a time. |
void |
setTabIndex(int index)
|
void |
setText(java.lang.String text)
Sets the text within the text field of the suggest box |
void |
setValidText(java.lang.String validText)
Sets the valid text String. |
void |
setValueDelim(java.lang.String valueDelim)
Set the delimiting character(s) between values if calling getValue to get all the values in the value map as a single String. |
void |
setValueMap(java.util.Map<java.lang.String,java.lang.String> valueMap)
Call this method to set the default values. |
void |
updateFormFeedback(int status,
java.lang.String tooltip)
Convenience method to set the status and tooltip of the FormFeedback |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MultivalueSuggestBoxBase(MultivalueSuggestHelper restHelper, boolean isMultivalued)
restHelper
- the REST helper for getting remote values for this suggest boxisMultivalued
- whether or not to allow multiple valuespublic MultivalueSuggestBoxBase(MultivalueSuggestHelper helper, boolean isMultivalued, boolean placeFormFeedback)
helper
- - a MultivalueSuggestHelper objectisMultivalued
- - whether or not to allow multiple valuesplaceFormFeedback
- - if false, the FormFeedback will be placed by the calling classMethod Detail |
---|
public void onLoad()
protected MultivalueSuggestHelper getHelper()
public void updateFormFeedback(int status, java.lang.String tooltip)
status
- - a FormFeedback statustooltip
- - a String tooltippublic java.lang.String getValue()
public java.util.Map<java.lang.String,java.lang.String> getValueMap()
public void setValueMap(java.util.Map<java.lang.String,java.lang.String> valueMap)
valueMap
- the valueMap to setprotected MultivalueSuggestBoxBase.Option createOption(JSONObject jsonOpt)
jsonOpt
- - the JSONObject to populate Option
protected MultivalueSuggestBoxBase.OptionSuggestion createOptionSuggestion(MultivalueSuggestBoxBase.Option o, java.lang.String fullText, java.lang.String query)
o
- - the Option to get values to populate the OptionSuggestionfullText
- - the full text in the text field of the suggest boxquery
- - the query portion of the full text
public void onSelection(event)
public SuggestBox getSuggestBox()
public java.lang.String getText()
public void setText(java.lang.String text)
text
- to setpublic int getTabIndex()
public void setAccessKey(char key)
public void setFocus(boolean focused)
public void setTabIndex(int index)
public HandlerRegistration addKeyUpHandler(KeyUpHandler handler)
handler
- to add
public HandlerRegistration addValueChangeHandler(handler)
public void onKeyUp(KeyUpEvent event)
public void setDisplaySeparator(java.lang.String displaySeparator)
displaySeparator
- The displaySeparator to set.public void setValueDelim(java.lang.String valueDelim)
valueDelim
- The valueDelim to set.public void setPageSize(int pageSize)
pageSize
- The pageSize to set.public void setDelay(int delay)
delay
- The delay to set.public FormFeedback getFeedback()
public void setFeedback(FormFeedback feedback)
feedback
- The feedback to set.public java.lang.String getInvalidText(java.lang.String invalids)
invalids
- - the value or values that are invalid.
public java.lang.String getInvalidReason(java.lang.String invalids, java.lang.String reason)
invalids
- - the value or values that are invalid.reason
- - the reason or message returned about the invalid value
public void setValidText(java.lang.String validText)
validText
- The validText to set.public void setLoadingText(java.lang.String loadingText)
loadingText
- The loadingText to set.protected abstract void queryOptions(java.lang.String query, int from, int to, RESTObjectCallBack<MultivalueSuggestBoxBase.OptionResultSet> callback)
query
- - the String search termfrom
- - the 0-based begin index intto
- - the end index inclusive intcallback
- - the RESTObjectCallBack to handle the responseprotected void handleQueryResponse(RESTObjectCallBack<MultivalueSuggestBoxBase.OptionResultSet> callback, JSONValue val)
callback
- the callback for the requestval
- the value we are getting suggestions for
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |