com.vaadin.terminal.gwt.client.ui.datefield
Class VPopupCalendar

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.Panel
              extended by com.google.gwt.user.client.ui.ComplexPanel
                  extended by com.google.gwt.user.client.ui.FlowPanel
                      extended by com.vaadin.terminal.gwt.client.ui.datefield.VDateField
                          extended by com.vaadin.terminal.gwt.client.ui.datefield.VTextualDate
                              extended by com.vaadin.terminal.gwt.client.ui.datefield.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.HasVisibility, 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, Focusable, Field, SubPartAware, Iterable<com.google.gwt.user.client.ui.Widget>

public class VPopupCalendar
extends VTextualDate
implements 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
protected  VCalendarPanel calendar
           
protected  com.google.gwt.user.client.ui.Button calendarToggle
           
protected  boolean parsable
           
protected  VOverlay popup
           
protected static String POPUP_PRIMARY_STYLE_NAME
           
 
Fields inherited from class com.vaadin.terminal.gwt.client.ui.datefield.VTextualDate
ATTR_INPUTPROMPT, formatStr, inputPrompt, lenient, text
 
Fields inherited from class com.vaadin.terminal.gwt.client.ui.datefield.VDateField
CLASSNAME, client, currentLocale, currentResolution, dts, enabled, immediate, paintableId, readonly, RESOLUTION_DAY, RESOLUTION_HOUR, RESOLUTION_MIN, RESOLUTION_MONTH, RESOLUTION_SEC, RESOLUTION_YEAR, showISOWeekNumbers, 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 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)
           
protected  void updateValue(Date newDate)
           
 
Methods inherited from class com.vaadin.terminal.gwt.client.ui.datefield.VTextualDate
focus, getFormatString, getText, onChange, setPrompting, setText
 
Methods inherited from class com.vaadin.terminal.gwt.client.ui.datefield.VDateField
getClient, getCurrentDate, getCurrentLocale, getCurrentResolution, getDate, getDateTimeService, getId, getMilliseconds, getTime, 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, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, 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.ForIsWidget
getWidgetIndex
 
Methods inherited from interface com.google.gwt.user.client.ui.IndexedPanel
getWidget, getWidgetCount, getWidgetIndex, remove
 

Field Detail

POPUP_PRIMARY_STYLE_NAME

protected static final String POPUP_PRIMARY_STYLE_NAME
See Also:
Constant Field Values

calendarToggle

protected final com.google.gwt.user.client.ui.Button calendarToggle

calendar

protected VCalendarPanel calendar

popup

protected final VOverlay popup

parsable

protected boolean parsable
Constructor Detail

VPopupCalendar

public VPopupCalendar()
Method Detail

updateValue

protected void updateValue(Date newDate)

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 -

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 com.google.gwt.user.client.ui.Widget

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.


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