com.vaadin.terminal.gwt.client.ui
Class VFilterSelect

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.google.gwt.user.client.ui.Composite
              extended by com.vaadin.terminal.gwt.client.ui.VFilterSelect
All Implemented Interfaces:
com.google.gwt.event.dom.client.BlurHandler, com.google.gwt.event.dom.client.ClickHandler, com.google.gwt.event.dom.client.FocusHandler, com.google.gwt.event.dom.client.KeyDownHandler, com.google.gwt.event.dom.client.KeyUpHandler, com.google.gwt.event.logical.shared.HasAttachHandlers, com.google.gwt.event.shared.EventHandler, com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener, com.google.gwt.user.client.ui.IsWidget, Focusable, Paintable, Field, SubPartAware

public class VFilterSelect
extends com.google.gwt.user.client.ui.Composite
implements Paintable, Field, com.google.gwt.event.dom.client.KeyDownHandler, com.google.gwt.event.dom.client.KeyUpHandler, com.google.gwt.event.dom.client.ClickHandler, com.google.gwt.event.dom.client.FocusHandler, com.google.gwt.event.dom.client.BlurHandler, Focusable, SubPartAware

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
 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
static String ATTR_NO_TEXT_INPUT
           
static int FILTERINGMODE_CONTAINS
           
static int FILTERINGMODE_OFF
           
static int FILTERINGMODE_STARTSWITH
           
protected  int pageLength
           
 
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  void onAttach()
           
 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
 void setHeight(String height)
           
 void setWidth(String width)
           
 void updateFromUIDL(UIDL uidl, ApplicationConnection client)
           
 
Methods inherited from class com.google.gwt.user.client.ui.Composite
getWidget, initWidget, isAttached, onBrowserEvent, 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, 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

FILTERINGMODE_OFF

public static final int FILTERINGMODE_OFF
See Also:
Constant Field Values

FILTERINGMODE_STARTSWITH

public static final int FILTERINGMODE_STARTSWITH
See Also:
Constant Field Values

FILTERINGMODE_CONTAINS

public static final int FILTERINGMODE_CONTAINS
See Also:
Constant Field Values

pageLength

protected int pageLength

ATTR_NO_TEXT_INPUT

public static final String ATTR_NO_TEXT_INPUT
See Also:
Constant Field Values
Constructor Detail

VFilterSelect

public VFilterSelect()
Default constructor

Method Detail

hasNextPage

public boolean hasNextPage()
Does the Select have more pages?

Returns:
true if a next page exists, else false if the current page is the last page

filterOptions

public void filterOptions(int page)
Filters the options at a certain page. Uses the text box input as a filter

Parameters:
page - The page which items are to be filtered

filterOptions

public void filterOptions(int page,
                          String filter)
Filters the options at certain page using the given filter

Parameters:
page - The page to filter
filter - The filter to apply to the components

updateFromUIDL

public void updateFromUIDL(UIDL uidl,
                           ApplicationConnection client)
Specified by:
updateFromUIDL in interface Paintable

onAttach

protected void onAttach()
Overrides:
onAttach in class com.google.gwt.user.client.ui.Composite

onSuggestionSelected

public void onSuggestionSelected(VFilterSelect.FilterSelectSuggestion suggestion)
Triggered when a suggestion is selected

Parameters:
suggestion - The suggestion that just got selected.

onKeyDown

public void onKeyDown(com.google.gwt.event.dom.client.KeyDownEvent event)
Specified by:
onKeyDown in interface com.google.gwt.event.dom.client.KeyDownHandler

onKeyUp

public void onKeyUp(com.google.gwt.event.dom.client.KeyUpEvent event)
Triggered when a key was depressed

Specified by:
onKeyUp in interface com.google.gwt.event.dom.client.KeyUpHandler
Parameters:
event - The KeyUpEvent of the key depressed

onClick

public void onClick(com.google.gwt.event.dom.client.ClickEvent event)
Listener for popupopener

Specified by:
onClick in interface com.google.gwt.event.dom.client.ClickHandler

onFocus

public void onFocus(com.google.gwt.event.dom.client.FocusEvent event)
Specified by:
onFocus in interface com.google.gwt.event.dom.client.FocusHandler

onBlur

public void onBlur(com.google.gwt.event.dom.client.BlurEvent event)
Specified by:
onBlur in interface com.google.gwt.event.dom.client.BlurHandler

focus

public void focus()
Description copied from interface: Focusable
Sets focus to this widget.

Specified by:
focus in interface Focusable

setWidth

public void setWidth(String width)
Overrides:
setWidth in class com.google.gwt.user.client.ui.UIObject

setHeight

public void setHeight(String height)
Overrides:
setHeight in class com.google.gwt.user.client.ui.UIObject

onDetach

protected void onDetach()
Overrides:
onDetach in class com.google.gwt.user.client.ui.Composite

getSubPartElement

public com.google.gwt.user.client.Element getSubPartElement(String subPart)
Description copied from interface: SubPartAware
Locates an element inside a component using the identifier provided in subPart. The subPart identifier is component specific and may be any string of characters, numbers, space characters and brackets.

Specified by:
getSubPartElement in interface SubPartAware
Parameters:
subPart - The identifier for the element inside the component
Returns:
The element identified by subPart or null if the element could not be found.

getSubPartName

public String getSubPartName(com.google.gwt.user.client.Element subElement)
Description copied from interface: SubPartAware
Provides an identifier that identifies the element within the component. The 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.

Specified by:
getSubPartName in interface SubPartAware
Parameters:
subElement - The element the identifier string should uniquely identify
Returns:
An identifier that uniquely identifies subElement or null if no identifier could be provided.


Copyright © 2000-2011 Vaadin Ltd. All Rights Reserved.