|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.google.gwt.user.client.ui.UIObject com.google.gwt.user.client.ui.Widget com.google.gwt.user.client.ui.Composite com.vaadin.terminal.gwt.client.ui.combobox.VFilterSelect
public class VFilterSelect
Client side implementation of the Select component. TODO needs major refactoring (to be extensible etc)
Nested Class Summary | |
---|---|
class |
VFilterSelect.FilterSelectSuggestion
Represents a suggestion in the suggestion popup box |
protected static class |
VFilterSelect.Select
|
class |
VFilterSelect.SuggestionMenu
The menu where the suggestions are rendered |
class |
VFilterSelect.SuggestionPopup
Represents the popup box with the selection options. |
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject |
---|
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled |
Field Summary | |
---|---|
protected boolean |
allowNewItem
|
protected static String |
ATTR_INPUTPROMPT
|
static String |
ATTR_NO_TEXT_INPUT
|
protected ApplicationConnection |
client
|
protected int |
currentPage
|
protected VFilterSelect.FilterSelectSuggestion |
currentSuggestion
The current suggestion selected from the dropdown. |
protected List<VFilterSelect.FilterSelectSuggestion> |
currentSuggestions
A collection of available suggestions (options) as received from the server. |
protected boolean |
enabled
|
protected int |
filteringmode
|
static int |
FILTERINGMODE_CONTAINS
|
static int |
FILTERINGMODE_OFF
|
static int |
FILTERINGMODE_STARTSWITH
|
protected boolean |
focused
|
protected boolean |
immediate
|
protected boolean |
initDone
|
protected String |
inputPrompt
|
protected String |
lastFilter
|
protected String |
lastNewItemString
|
protected boolean |
nullSelectionAllowed
|
protected boolean |
nullSelectItem
|
protected int |
pageLength
|
protected String |
paintableId
|
protected boolean |
popupOpenerClicked
|
protected boolean |
prompting
|
protected boolean |
readonly
|
protected String |
selectedOptionKey
|
protected VFilterSelect.Select |
selectPopupItemWhenResponseIsReceived
|
protected VFilterSelect.SuggestionPopup |
suggestionPopup
|
protected int |
suggestionPopupMinWidth
|
protected com.google.gwt.user.client.ui.TextBox |
tb
The text box where the filter is written |
protected int |
totalMatches
|
protected boolean |
updateSelectionWhenReponseIsReceived
|
protected boolean |
waitingForFilteringResponse
|
Fields inherited from class com.google.gwt.user.client.ui.UIObject |
---|
DEBUG_ID_PREFIX |
Constructor Summary | |
---|---|
VFilterSelect()
Default constructor |
Method Summary | |
---|---|
void |
filterOptions(int page)
Filters the options at a certain page. |
void |
filterOptions(int page,
String filter)
Filters the options at certain page using the given filter |
void |
focus()
Sets focus to this widget. |
com.google.gwt.user.client.Element |
getSubPartElement(String subPart)
Locates an element inside a component using the identifier provided in subPart . |
String |
getSubPartName(com.google.gwt.user.client.Element subElement)
Provides an identifier that identifies the element within the component. |
boolean |
hasNextPage()
Does the Select have more pages? |
protected int |
minWidth(String captions)
Calculate minimum width for FilterSelect textarea |
void |
onBlur(com.google.gwt.event.dom.client.BlurEvent event)
|
void |
onClick(com.google.gwt.event.dom.client.ClickEvent event)
Listener for popupopener |
protected void |
onDetach()
|
void |
onFocus(com.google.gwt.event.dom.client.FocusEvent event)
|
void |
onKeyDown(com.google.gwt.event.dom.client.KeyDownEvent event)
|
void |
onKeyUp(com.google.gwt.event.dom.client.KeyUpEvent event)
Triggered when a key was depressed |
void |
onSuggestionSelected(VFilterSelect.FilterSelectSuggestion suggestion)
Triggered when a suggestion is selected |
protected void |
setPromptingOff(String text)
Turns prompting off. |
protected void |
setPromptingOn()
Turns prompting on. |
protected void |
setSelectedItemIcon(String iconUri)
Sets the icon URI of the selected item. |
protected void |
setTextboxText(String text)
Sets the text in the text box. |
protected void |
setTextInputEnabled(boolean textInputEnabled)
|
void |
setWidth(String width)
|
protected void |
updateReadOnly()
|
protected void |
updateRootWidth()
Calculates the width of the select if the select has undefined width. |
Methods inherited from class com.google.gwt.user.client.ui.Composite |
---|
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, render, render, resolvePotentialElement, setWidget |
Methods inherited from class com.google.gwt.user.client.ui.Widget |
---|
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isOrWasAttached, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents |
Methods inherited from class com.google.gwt.user.client.ui.UIObject |
---|
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, sinkBitlessEvent, toString, unsinkEvents |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int FILTERINGMODE_OFF
public static final int FILTERINGMODE_STARTSWITH
public static final int FILTERINGMODE_CONTAINS
protected int pageLength
protected final com.google.gwt.user.client.ui.TextBox tb
protected final VFilterSelect.SuggestionPopup suggestionPopup
protected ApplicationConnection client
protected String paintableId
protected int currentPage
protected final List<VFilterSelect.FilterSelectSuggestion> currentSuggestions
protected boolean immediate
protected String selectedOptionKey
protected boolean waitingForFilteringResponse
protected boolean updateSelectionWhenReponseIsReceived
protected boolean initDone
protected String lastFilter
protected VFilterSelect.Select selectPopupItemWhenResponseIsReceived
protected VFilterSelect.FilterSelectSuggestion currentSuggestion
protected int totalMatches
protected boolean allowNewItem
protected boolean nullSelectionAllowed
protected boolean nullSelectItem
protected boolean enabled
protected boolean readonly
protected int filteringmode
protected static final String ATTR_INPUTPROMPT
public static final String ATTR_NO_TEXT_INPUT
protected String inputPrompt
protected boolean prompting
protected boolean popupOpenerClicked
protected int suggestionPopupMinWidth
protected String lastNewItemString
protected boolean focused
Constructor Detail |
---|
public VFilterSelect()
Method Detail |
---|
public boolean hasNextPage()
public void filterOptions(int page)
page
- The page which items are to be filteredpublic void filterOptions(int page, String filter)
page
- The page to filterfilter
- The filter to apply to the componentsprotected void updateReadOnly()
protected void setTextInputEnabled(boolean textInputEnabled)
protected void setTextboxText(String text)
text
- the text to set in the text boxprotected void setPromptingOn()
protected void setPromptingOff(String text)
text
- The text the text box should contain.public void onSuggestionSelected(VFilterSelect.FilterSelectSuggestion suggestion)
suggestion
- The suggestion that just got selected.protected void setSelectedItemIcon(String iconUri)
iconUri
- The URI of the iconpublic void onKeyDown(com.google.gwt.event.dom.client.KeyDownEvent event)
onKeyDown
in interface com.google.gwt.event.dom.client.KeyDownHandler
public void onKeyUp(com.google.gwt.event.dom.client.KeyUpEvent event)
onKeyUp
in interface com.google.gwt.event.dom.client.KeyUpHandler
event
- The KeyUpEvent of the key depressedpublic void onClick(com.google.gwt.event.dom.client.ClickEvent event)
onClick
in interface com.google.gwt.event.dom.client.ClickHandler
protected int minWidth(String captions)
public void onFocus(com.google.gwt.event.dom.client.FocusEvent event)
onFocus
in interface com.google.gwt.event.dom.client.FocusHandler
public void onBlur(com.google.gwt.event.dom.client.BlurEvent event)
onBlur
in interface com.google.gwt.event.dom.client.BlurHandler
public void focus()
Focusable
focus
in interface Focusable
protected void updateRootWidth()
public void setWidth(String width)
setWidth
in class com.google.gwt.user.client.ui.UIObject
protected void onDetach()
onDetach
in class com.google.gwt.user.client.ui.Composite
public com.google.gwt.user.client.Element getSubPartElement(String subPart)
SubPartAware
subPart
. The subPart
identifier is component specific and
may be any string of characters, numbers, space characters and brackets.
getSubPartElement
in interface SubPartAware
subPart
- The identifier for the element inside the component
public String getSubPartName(com.google.gwt.user.client.Element subElement)
SubPartAware
subElement
is a part of the component and must never be null.
Note!
getSubPartElement(getSubPartName(element)) == element
is not
always true. A component can choose to provide a more generic
identifier for any given element if the results of all interactions with
subElement
are the same as interactions with the element
identified by the return value. For example a button can return an
identifier for the root element even though a DIV inside the button was
passed as subElement
because interactions with the DIV and the
root button element produce the same result.
getSubPartName
in interface SubPartAware
subElement
- The element the identifier string should uniquely identify
subElement
or null
if no identifier could be provided.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |