com.vaadin.client.ui
Class VPopupCalendar

java.lang.Object
  extended by FlowPanel
      extended by com.vaadin.client.ui.VDateField
          extended by com.vaadin.client.ui.VTextualDate
              extended by com.vaadin.client.ui.VPopupCalendar
All Implemented Interfaces:
com.google.gwt.event.logical.shared.CloseHandler<PopupPanel>, com.google.gwt.event.shared.EventHandler, Focusable, HandlesAriaCaption, HandlesAriaInvalid, HandlesAriaRequired, Field, SubPartAware

public class VPopupCalendar
extends VTextualDate
implements Field, com.google.gwt.event.logical.shared.CloseHandler<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.client.ui.VCalendarPanel and then pass set it by calling the setCalendarPanel(VCalendarPanel panel) method.


Field Summary
 VCalendarPanel calendar
          For internal use only.
 Button calendarToggle
          For internal use only.
 boolean parsable
          For internal use only.
 VOverlay popup
          For internal use only.
 
Fields inherited from class com.vaadin.client.ui.VTextualDate
ATTR_INPUTPROMPT, formatStr, inputPrompt, lenient, text
 
Fields inherited from class com.vaadin.client.ui.VDateField
CLASSNAME, client, currentLocale, currentResolution, dts, enabled, immediate, paintableId, readonly, RESOLUTION_DAY, RESOLUTION_HOUR, RESOLUTION_MIN, RESOLUTION_MONTH, RESOLUTION_SEC, RESOLUTION_YEAR, showISOWeekNumbers
 
Constructor Summary
VPopupCalendar()
           
 
Method Summary
 void bindAriaCaption(com.google.gwt.user.client.Element captionElement)
          Called to bind the provided caption (label in HTML speak) element to the main input element of the Widget.
 void buildDate()
          For internal use only.
protected  void buildDate(boolean forceValid)
          Update the text field contents from the date.
 void closeCalendarPanel()
          Closes the open popup panel
 java.lang.String getDescriptionForAssistiveDevices()
          Get the description that explains the usage of the Widget for users of assistive devices.
protected  int getOpenCalenderPanelKey()
          Get the key code that opens the calendar panel.
 com.google.gwt.user.client.Element getSubPartElement(java.lang.String subPart)
          Locates an element inside a component using the identifier provided in subPart.
 java.lang.String getSubPartName(com.google.gwt.user.client.Element subElement)
          Provides an identifier that identifies the element within the component.
 boolean isTextFieldEnabled()
          Checks whether the text field is enabled.
protected  void onAttach()
           
 void onBrowserEvent(com.google.gwt.user.client.Event event)
           
 void onClick(ClickEvent event)
           
 void onClose(com.google.gwt.event.logical.shared.CloseEvent<PopupPanel> event)
           
protected  void onDetach()
           
 void openCalendarPanel()
          Opens the calendar panel popup
 void setDescriptionForAssistiveDevices(java.lang.String descriptionForAssistiveDevices)
          Set a description that explains the usage of the Widget for users of assistive devices.
 void setEnabled(boolean enabled)
           
 void setFocus(boolean focus)
          Sets focus to Calendar panel.
 void setFocusedDate(java.util.Date selectedDate)
          Sets the content of a special field for assistive devices, so that they can recognize the change and inform the user (reading out in case of screen reader)
 void setRangeEnd(java.util.Date rangeEnd)
          Sets the end range for this component.
 void setRangeStart(java.util.Date rangeStart)
          Sets the start range for this component.
 void setStyleName(java.lang.String style)
           
 void setStylePrimaryName(java.lang.String style)
           
 void setTextFieldEnabled(boolean textFieldEnabled)
          Sets the state of the text field of this component.
 void setTextFieldTabIndex()
          Set correct tab index for disabled text field in IE as the value set in setTextFieldEnabled(...) gets overridden in TextualDateConnection.updateFromUIDL(...)
protected  void updateStyleNames()
           
protected  void updateTextFieldEnabled()
           
 void updateValue(java.util.Date newDate)
           
 
Methods inherited from class com.vaadin.client.ui.VTextualDate
focus, getFormatString, getText, onChange, onKeyDown, setAriaInvalid, setAriaRequired, setPrompting, setText
 
Methods inherited from class com.vaadin.client.ui.VDateField
getClient, getCurrentDate, getCurrentLocale, getCurrentResolution, getDate, getDateTimeService, getId, getMilliseconds, getTime, isEnabled, isImmediate, isReadonly, isShowISOWeekNumbers, resolutionToString, setCurrentDate, setCurrentLocale, setCurrentResolution, setDate, setImmediate, setMilliseconds, setReadonly, setShowISOWeekNumbers
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.google.gwt.event.logical.shared.CloseHandler
onClose
 

Field Detail

calendarToggle

public final Button calendarToggle
For internal use only. May be removed or replaced in the future.


calendar

public VCalendarPanel calendar
For internal use only. May be removed or replaced in the future.


popup

public final VOverlay popup
For internal use only. May be removed or replaced in the future.


parsable

public boolean parsable
For internal use only. May be removed or replaced in the future.

Constructor Detail

VPopupCalendar

public VPopupCalendar()
Method Detail

onAttach

protected void onAttach()

onDetach

protected void onDetach()

updateValue

public void updateValue(java.util.Date newDate)

isTextFieldEnabled

public boolean isTextFieldEnabled()
Checks whether the text field is enabled.

Returns:
The current state of the text field.
See Also:
setTextFieldEnabled(boolean)

setTextFieldEnabled

public void setTextFieldEnabled(boolean textFieldEnabled)
Sets the state of the text field of this component. By default the text field is enabled. Disabling it causes only the button for date selection to be active, thus preventing the user from entering invalid dates. See http://dev.vaadin.com/ticket/6790.

Parameters:
state -

updateTextFieldEnabled

protected void updateTextFieldEnabled()

setTextFieldTabIndex

public void setTextFieldTabIndex()
Set correct tab index for disabled text field in IE as the value set in setTextFieldEnabled(...) gets overridden in TextualDateConnection.updateFromUIDL(...)

Since:
7.3.1

bindAriaCaption

public void bindAriaCaption(com.google.gwt.user.client.Element captionElement)
Description copied from interface: HandlesAriaCaption
Called to bind the provided caption (label in HTML speak) element to the main input element of the Widget. Binding should be removed from the main input field when captionElement is null.

Specified by:
bindAriaCaption in interface HandlesAriaCaption
Overrides:
bindAriaCaption in class VTextualDate
Parameters:
captionElement - Element of the caption

setStyleName

public void setStyleName(java.lang.String style)

setStylePrimaryName

public void setStylePrimaryName(java.lang.String style)

updateStyleNames

protected void updateStyleNames()
Overrides:
updateStyleNames in class VTextualDate

openCalendarPanel

public void openCalendarPanel()
Opens the calendar panel popup


onClick

public void onClick(ClickEvent event)

onClose

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

setFocus

public void setFocus(boolean focus)
Sets focus to Calendar panel.

Parameters:
focus -

setEnabled

public void setEnabled(boolean enabled)
Overrides:
setEnabled in class VTextualDate

setFocusedDate

public void setFocusedDate(java.util.Date selectedDate)
Sets the content of a special field for assistive devices, so that they can recognize the change and inform the user (reading out in case of screen reader)

Parameters:
selectedDate - Date that is currently selected

buildDate

public void buildDate()
For internal use only. May be removed or replaced in the future.

Overrides:
buildDate in class VTextualDate
See Also:
VTextualDate.buildDate()

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)

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(java.lang.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 java.lang.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.

setDescriptionForAssistiveDevices

public void setDescriptionForAssistiveDevices(java.lang.String descriptionForAssistiveDevices)
Set a description that explains the usage of the Widget for users of assistive devices.

Parameters:
descriptionForAssistiveDevices - String with the description

getDescriptionForAssistiveDevices

public java.lang.String getDescriptionForAssistiveDevices()
Get the description that explains the usage of the Widget for users of assistive devices.

Returns:
String with the description

setRangeStart

public void setRangeStart(java.util.Date rangeStart)
Sets the start range for this component. The start range is inclusive, and it depends on the current resolution, what is considered inside the range.

Parameters:
startDate - - the allowed range's start date

setRangeEnd

public void setRangeEnd(java.util.Date rangeEnd)
Sets the end range for this component. The end range is inclusive, and it depends on the current resolution, what is considered inside the range.

Parameters:
endDate - - the allowed range's end date


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