com.vaadin.client.ui.
Class VAbstractPopupCalendar<PANEL extends VAbstractCalendarPanel<R>,R extends Enum<R>>
- 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.client.ui.VDateField<R>
-
- com.vaadin.client.ui.VAbstractTextualDate<R>
-
- com.vaadin.client.ui.VAbstractPopupCalendar<PANEL,R>
-
Type Parameters:
PANEL
- the calendar panel type this field usesR
- the resolution type which this field is based on (day, month, ...)All Implemented Interfaces:
com.google.gwt.event.dom.client.ChangeHandler
,com.google.gwt.event.dom.client.ClickHandler
,com.google.gwt.event.dom.client.KeyDownHandler
,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.HasEnabled
,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
,HandlesAriaCaption
,HandlesAriaInvalid
,HandlesAriaRequired
,Field
,SubPartAware
,Iterable<com.google.gwt.user.client.ui.Widget>
Direct Known Subclasses:
public abstract class VAbstractPopupCalendar<PANEL extends VAbstractCalendarPanel<R>,R extends Enum<R>> extends VAbstractTextualDate<R> implements com.google.gwt.event.dom.client.ClickHandler, com.google.gwt.event.logical.shared.CloseHandler<com.google.gwt.user.client.ui.PopupPanel>
Represents a date selection component with a text field and a popup date/time selector. Note: To change the keyboard assignments used in the popup dialog you should extend
com.vaadin.client.ui.VAbstractCalendarPanel
and then pass set it by calling thesetCalendarPanel(VAbstractCalendarPanel panel)
method.Since:
8.0
Author:
Vaadin Ltd
-
-
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.HasWidgets
com.google.gwt.user.client.ui.HasWidgets.ForIsWidget
-
-
Field Summary
Fields Modifier and Type Field Description PANEL
calendar
For internal use only.
com.google.gwt.user.client.ui.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.VAbstractTextualDate
lenient, text
-
Fields inherited from class com.vaadin.client.ui.VDateField
bufferedDateString, bufferedResolutions, CLASSNAME, client, connector, currentLocale, dts, enabled, readonly, rpc, showISOWeekNumbers
-
-
Constructor Summary
Constructors Constructor Description VAbstractPopupCalendar(PANEL calendarPanel, R resolution)
Constructs a date selection widget with a text field and a pop-up date/time selector.
-
Method Summary
All Methods Modifier and Type Method Description 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.
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(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.
protected boolean
hasChildFocus()
Returns whether any of the child components has focus.
boolean
isTextFieldEnabled()
Checks whether the text field is enabled.
protected void
onAttach()
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)
protected void
onDetach()
void
openCalendarPanel()
Opens the calendar panel popup.
void
setDescriptionForAssistiveDevices(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(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(String rangeEnd)
Sets the end range for this component.
void
setRangeStart(String rangeStart)
Sets the start range for this component.
void
setStyleName(String style)
void
setStylePrimaryName(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()
Updates style names for the widget (and its children).
protected void
updateTextFieldEnabled()
Updates the text field's enabled status to correspond with the latest value set through
setTextFieldEnabled(boolean)
and this component's generalsetEnabled(boolean)
.void
updateValue(Date newDate)
Changes the current date, and updates the
VDateField.bufferedResolutions
, possiblyVDateField.sendBufferedValues()
to the server if needed.-
Methods inherited from class com.vaadin.client.ui.VAbstractTextualDate
checkGroupFocus, cleanFormat, createFormatString, focus, getFormatString, getISODate, getPlaceHolder, getText, onChange, onKeyDown, setAriaInvalid, setAriaRequired, setFormatString, setISODate, setPlaceholder, setText, setTimeZone, updateAndSendBufferedValues, updateBufferedResolutions, updateBufferedValues
-
Methods inherited from class com.vaadin.client.ui.VDateField
doGetResolutions, getClient, getCurrentDate, getCurrentLocale, getCurrentResolution, getDate, getDate, getDateTimeService, getDefaultDate, getId, getResolutions, getResolutionVariable, isEnabled, isReadonly, isShowISOWeekNumbers, isYear, resolutionAsString, sendBufferedValues, sendBufferedValuesWithDelay, setCurrentDate, setCurrentDate, setCurrentLocale, setCurrentResolution, setDate, setDefaultDate, setDefaultDate, setReadonly, setShowISOWeekNumbers, supportsTime
-
Methods inherited from class com.google.gwt.user.client.ui.ComplexPanel
add, 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, 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, onLoad, onUnload, removeFromParent, setLayoutData, sinkEvents, unsinkEvents
-
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, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString
-
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.IndexedPanel
getWidget, getWidgetCount, getWidgetIndex, remove
-
Methods inherited from interface com.google.gwt.user.client.ui.IndexedPanel.ForIsWidget
getWidgetIndex
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
calendarToggle
public final com.google.gwt.user.client.ui.Button calendarToggle
For internal use only. May be removed or replaced in the future.
-
calendar
public PANEL extends VAbstractCalendarPanel<R> 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
-
VAbstractPopupCalendar
public VAbstractPopupCalendar(PANEL calendarPanel, R resolution)
Constructs a date selection widget with a text field and a pop-up date/time selector.
Parameters:
calendarPanel
- the calendar panel instance that should be displayed in the pop-upresolution
- the resolution this widget should display (day, month, ...)
-
-
Method Detail
-
onAttach
protected void onAttach()
Overrides:
onAttach
in classcom.google.gwt.user.client.ui.Widget
-
onDetach
protected void onDetach()
Overrides:
onDetach
in classcom.google.gwt.user.client.ui.Widget
-
updateValue
public void updateValue(Date newDate)
Changes the current date, and updates the
VDateField.bufferedResolutions
, possiblyVDateField.sendBufferedValues()
to the server if needed.Parameters:
newDate
- the newDate
to update
-
isTextFieldEnabled
public boolean isTextFieldEnabled()
Checks whether the text field is enabled.
Returns:
The current state of the text field.
See Also:
-
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 #6790.
If the text field is enabled, it represents this widget within the browser's tabulator focus cycle. When the text field is disabled, that role is instead given to the date selection button. If the entire component is disabled, the focus cycle skips this widget altogether.
Parameters:
textFieldEnabled
-true
if the text field should be enabled,false
if disabled
-
updateTextFieldEnabled
protected void updateTextFieldEnabled()
Updates the text field's enabled status to correspond with the latest value set through
setTextFieldEnabled(boolean)
and this component's generalsetEnabled(boolean)
.See Also:
-
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 interfaceHandlesAriaCaption
Overrides:
bindAriaCaption
in classVAbstractTextualDate<R extends Enum<R>>
Parameters:
captionElement
- Element of the caption
-
setStyleName
public void setStyleName(String style)
Overrides:
setStyleName
in classcom.google.gwt.user.client.ui.UIObject
-
setStylePrimaryName
public void setStylePrimaryName(String style)
Overrides:
setStylePrimaryName
in classcom.google.gwt.user.client.ui.UIObject
-
updateStyleNames
protected void updateStyleNames()
Description copied from class:
VAbstractTextualDate
Updates style names for the widget (and its children).
Overrides:
updateStyleNames
in classVAbstractTextualDate<R extends Enum<R>>
-
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 interfacecom.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 interfacecom.google.gwt.event.logical.shared.CloseHandler<PANEL extends VAbstractCalendarPanel<R>>
-
setFocus
public void setFocus(boolean focus)
Sets focus to Calendar panel.
Parameters:
focus
-true
forfocus
,false
forblur
-
setEnabled
public void setEnabled(boolean enabled)
Specified by:
setEnabled
in interfacecom.google.gwt.user.client.ui.HasEnabled
Overrides:
setEnabled
in classVAbstractTextualDate<R extends Enum<R>>
-
setFocusedDate
public void setFocusedDate(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 classVAbstractTextualDate<R extends Enum<R>>
See Also:
-
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 interfacecom.google.gwt.user.client.EventListener
Overrides:
onBrowserEvent
in classcom.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:
the key code that opens the calendar panel
-
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
. ThesubPart
identifier is component specific and may be any string of characters, numbers, space characters and brackets.Specified by:
getSubPartElement
in interfaceSubPartAware
Overrides:
getSubPartElement
in classVAbstractTextualDate<R extends Enum<R>>
Parameters:
subPart
- The identifier for the element inside the componentReturns:
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 withsubElement
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 assubElement
because interactions with the DIV and the root button element produce the same result.Specified by:
getSubPartName
in interfaceSubPartAware
Overrides:
getSubPartName
in classVAbstractTextualDate<R extends Enum<R>>
Parameters:
subElement
- The element the identifier string should uniquely identifyReturns:
An identifier that uniquely identifies
subElement
or null if no identifier could be provided.
-
setDescriptionForAssistiveDevices
public void setDescriptionForAssistiveDevices(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 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(String 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:
rangeStart
- - the allowed range's start date
-
setRangeEnd
public void setRangeEnd(String 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:
rangeEnd
- - the allowed range's end date
-
hasChildFocus
protected boolean hasChildFocus()
Description copied from class:
VAbstractTextualDate
Returns whether any of the child components has focus.
Overrides:
hasChildFocus
in classVAbstractTextualDate<R extends Enum<R>>
Returns:
true
if any of the child component has focus,false
otherwise
-
-