com.vaadin.terminal.gwt.client.ui.


Class VPopupCalendar

java.lang.Object
  com.google.gwt.user.client.ui.UIObject
      com.google.gwt.user.client.ui.Widget
          com.google.gwt.user.client.ui.Panel
              com.google.gwt.user.client.ui.ComplexPanel
                  com.google.gwt.user.client.ui.FlowPanel
                      com.vaadin.terminal.gwt.client.ui.VDateField
                          com.vaadin.terminal.gwt.client.ui.VTextualDate
                              com.vaadin.terminal.gwt.client.ui.VPopupCalendar

All Implemented Interfaces:

com.google.gwt.event.dom.client.ChangeHandler, com.google.gwt.event.dom.client.ClickHandler, com.google.gwt.event.logical.shared.CloseHandler<com.google.gwt.user.client.ui.PopupPanel>, 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.HasWidgets, com.google.gwt.user.client.ui.HasWidgets.ForIsWidget, com.google.gwt.user.client.ui.IndexedPanel, com.google.gwt.user.client.ui.IndexedPanel.ForIsWidget, com.google.gwt.user.client.ui.InsertPanel, com.google.gwt.user.client.ui.InsertPanel.ForIsWidget, com.google.gwt.user.client.ui.IsWidget, ContainerResizedListener, Focusable, Paintable, Field, SubPartAware, Iterable<com.google.gwt.user.client.ui.Widget>

public class VPopupCalendar
extends VTextualDate
implements Paintable, Field, com.google.gwt.event.dom.client.ClickHandler, com.google.gwt.event.logical.shared.CloseHandler<com.google.gwt.user.client.ui.PopupPanel>, SubPartAware

Represents a date selection component with a text field and a popup date selector. Note: To change the keyboard assignments used in the popup dialog you should extend com.vaadin.terminal.gwt.client.ui.VCalendarPanel and then pass set it by calling the setCalendarPanel(VCalendarPanel panel) method.

Nested Class Summary
 
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
 
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.InsertPanel
com.google.gwt.user.client.ui.InsertPanel.ForIsWidget
 
Nested classes/interfaces inherited from interface com.google.gwt.user.client.ui.HasWidgets
com.google.gwt.user.client.ui.HasWidgets.ForIsWidget
 
Field Summary
 
Fields inherited from class com.vaadin.terminal.gwt.client.ui.VTextualDate
fieldExtraWidth
 
Fields inherited from class com.vaadin.terminal.gwt.client.ui.VDateField
CLASSNAME, currentLocale, currentResolution, dts, enabled, immediate, readonly, RESOLUTION_DAY, RESOLUTION_HOUR, RESOLUTION_MIN, RESOLUTION_MONTH, RESOLUTION_MSEC, RESOLUTION_SEC, RESOLUTION_YEAR, WEEK_NUMBERS
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
VPopupCalendar()
           
 
Method Summary
protected  void buildDate()
          Updates the text field according to the current date (provided by VDateField.getDate()).
protected  void buildDate(boolean forceValid)
          Update the text field contents from the date.
 void closeCalendarPanel()
          Closes the open popup panel
protected  int getFieldExtraWidth()
          Returns pixels in x-axis reserved for other than textfield content.
protected  int getOpenCalenderPanelKey()
          Get the key code that opens the calendar panel.
 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.
 void onBrowserEvent(com.google.gwt.user.client.Event event)
           
 void onClick(com.google.gwt.event.dom.client.ClickEvent event)
           
 void onClose(com.google.gwt.event.logical.shared.CloseEvent<com.google.gwt.user.client.ui.PopupPanel> event)
           
 void openCalendarPanel()
          Opens the calendar panel popup
 void setFocus(boolean focus)
          Sets focus to Calendar panel.
 void setStyleName(String style)
           
 void updateFromUIDL(UIDL uidl, ApplicationConnection client)
           
 
Methods inherited from class com.vaadin.terminal.gwt.client.ui.VTextualDate
focus, getFormatString, getText, iLayout, iLayout, isUndefinedWidth, onChange, setPrompting, setText, setWidth, updateWidth
 
Methods inherited from class com.vaadin.terminal.gwt.client.ui.VDateField
getClient, getCurrentDate, getCurrentLocale, getCurrentResolution, getDate, getDateTimeService, getId, getMilliseconds, isEnabled, isImmediate, isReadonly, isShowISOWeekNumbers, setCurrentDate, setCurrentLocale, setCurrentResolution, setDate, setMilliseconds
 
Methods inherited from class com.google.gwt.user.client.ui.FlowPanel
add, clear, insert, insert
 
Methods inherited from class com.google.gwt.user.client.ui.ComplexPanel
add, adjustIndex, checkIndexBoundsForAccess, checkIndexBoundsForInsertion, getChildren, getWidget, getWidgetCount, getWidgetIndex, getWidgetIndex, insert, insert, iterator, remove, remove
 
Methods inherited from class com.google.gwt.user.client.ui.Panel
add, adopt, adopt, disown, doAttachChildren, doDetachChildren, orphan, remove
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onDetach, 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, 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
 
Methods inherited from interface com.google.gwt.user.client.ui.InsertPanel.ForIsWidget
add
 
Methods inherited from interface com.google.gwt.user.client.ui.IndexedPanel
getWidget, getWidgetCount, getWidgetIndex, remove
 
Methods inherited from interface com.google.gwt.user.client.ui.IndexedPanel.ForIsWidget
getWidgetIndex
 
Methods inherited from interface com.google.gwt.user.client.ui.IndexedPanel
getWidget, getWidgetCount, getWidgetIndex, remove
 

Constructor Detail

VPopupCalendar

public VPopupCalendar()
Method Detail

updateFromUIDL

public void updateFromUIDL(UIDL uidl,
                           ApplicationConnection client)

Specified by:
updateFromUIDL in interface Paintable
Overrides:
updateFromUIDL in class VTextualDate

setStyleName

public void setStyleName(String style)

Overrides:
setStyleName in class com.google.gwt.user.client.ui.UIObject

openCalendarPanel

public void openCalendarPanel()

Opens the calendar panel popup

onClick

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

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

onClose

public void onClose(com.google.gwt.event.logical.shared.CloseEvent<com.google.gwt.user.client.ui.PopupPanel> event)

Specified by:
onClose in interface com.google.gwt.event.logical.shared.CloseHandler<com.google.gwt.user.client.ui.PopupPanel>

setFocus

public void setFocus(boolean focus)

Sets focus to Calendar panel.

Parameters:
focus -

getFieldExtraWidth

protected int getFieldExtraWidth()

Description copied from class: VTextualDate

Returns pixels in x-axis reserved for other than textfield content.

Overrides:
getFieldExtraWidth in class VTextualDate

Returns:
extra width in pixels

buildDate

protected void buildDate()

Description copied from class: VTextualDate

Updates the text field according to the current date (provided by VDateField.getDate()). Takes care of updating text, enabling and disabling the field, setting/removing readonly status and updating readonly styles. TODO: Split part of this into a method that only updates the text as this is what usually is needed except for updateFromUIDL.

Overrides:
buildDate in class VTextualDate

buildDate

protected void buildDate(boolean forceValid)

Update the text field contents from the date. See buildDate().

Parameters:
forceValid - true to force the text field to be updated, false to only update if the parsable flag is true.

onBrowserEvent

public void onBrowserEvent(com.google.gwt.user.client.Event event)

Specified by:
onBrowserEvent in interface com.google.gwt.user.client.EventListener
Overrides:
onBrowserEvent in class VDateField

getOpenCalenderPanelKey

protected int getOpenCalenderPanelKey()

Get the key code that opens the calendar panel. By default it is the down key but you can override this to be whatever you like

Returns:

closeCalendarPanel

public void closeCalendarPanel()

Closes the open popup panel

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
Overrides:
getSubPartElement in class VTextualDate

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
Overrides:
getSubPartName in class VTextualDate

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.