Package com.vaadin.v7.client.ui
Class VCalendarPanel
- 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.HTMLTable
-
- com.google.gwt.user.client.ui.FlexTable
-
- com.vaadin.client.ui.FocusableFlexTable
-
- com.vaadin.v7.client.ui.VCalendarPanel
-
- All Implemented Interfaces:
com.google.gwt.event.dom.client.BlurHandler,com.google.gwt.event.dom.client.FocusHandler,com.google.gwt.event.dom.client.HasAllDragAndDropHandlers,com.google.gwt.event.dom.client.HasBlurHandlers,com.google.gwt.event.dom.client.HasClickHandlers,com.google.gwt.event.dom.client.HasDoubleClickHandlers,com.google.gwt.event.dom.client.HasDragEndHandlers,com.google.gwt.event.dom.client.HasDragEnterHandlers,com.google.gwt.event.dom.client.HasDragHandlers,com.google.gwt.event.dom.client.HasDragLeaveHandlers,com.google.gwt.event.dom.client.HasDragOverHandlers,com.google.gwt.event.dom.client.HasDragStartHandlers,com.google.gwt.event.dom.client.HasDropHandlers,com.google.gwt.event.dom.client.HasFocusHandlers,com.google.gwt.event.dom.client.HasKeyDownHandlers,com.google.gwt.event.dom.client.HasKeyPressHandlers,com.google.gwt.event.dom.client.KeyDownHandler,com.google.gwt.event.dom.client.KeyPressHandler,com.google.gwt.event.dom.client.MouseDownHandler,com.google.gwt.event.dom.client.MouseOutHandler,com.google.gwt.event.dom.client.MouseUpHandler,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.IsWidget,com.google.gwt.user.client.ui.SourcesTableEvents,Focusable,SubPartAware,Iterable<com.google.gwt.user.client.ui.Widget>
public class VCalendarPanel extends FocusableFlexTable implements com.google.gwt.event.dom.client.KeyDownHandler, com.google.gwt.event.dom.client.KeyPressHandler, com.google.gwt.event.dom.client.MouseOutHandler, com.google.gwt.event.dom.client.MouseDownHandler, com.google.gwt.event.dom.client.MouseUpHandler, com.google.gwt.event.dom.client.BlurHandler, com.google.gwt.event.dom.client.FocusHandler, SubPartAware
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceVCalendarPanel.FocusChangeListenerFocusChangeListener is notified when the panel changes its _focused_ value.classVCalendarPanel.FocusedDateHelper class to inform the screen reader that the user changed the selected date.static interfaceVCalendarPanel.FocusOutListenerBlur listener that listens to blur event from the panel.static interfaceVCalendarPanel.SubmitListenerstatic interfaceVCalendarPanel.TimeChangeListenerDispatches an event when the panel when time is changed.classVCalendarPanel.VTimeTimeSelector is a widget consisting of list boxes that modify the Date object that is given for.-
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.FlexTable
com.google.gwt.user.client.ui.FlexTable.FlexCellFormatter
-
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.HTMLTable
com.google.gwt.user.client.ui.HTMLTable.Cell, com.google.gwt.user.client.ui.HTMLTable.CellFormatter, com.google.gwt.user.client.ui.HTMLTable.ColumnFormatter, com.google.gwt.user.client.ui.HTMLTable.RowFormatter
-
-
Constructor Summary
Constructors Constructor Description VCalendarPanel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intgetBackwardKey()The key that selects the previous day in the calendar.protected intgetCloseKey()Returns the key that closes the popup window if this is a VPopopCalendar.DategetDate()protected intgetForwardKey()The key that selects the next day in the calendar.protected intgetNextKey()The key that selects the next week in the calendar.protected intgetPreviousKey()The key that selects the previous week in the calendar.protected intgetResetKey()Returns the reset key which will reset the calendar to the previous selection.ResolutiongetResolution()protected intgetSelectKey()Returns the select key which selects the value.VCalendarPanel.SubmitListenergetSubmitListener()Returns the submit listener that listens to selection made from the panel.com.google.gwt.user.client.ElementgetSubPartElement(String subPart)StringgetSubPartName(com.google.gwt.user.client.Element subElement)protected booleanhandleNavigation(int keycode, boolean ctrl, boolean shift)Handles the keyboard navigation.protected booleanhandleNavigationDayMode(int keycode, boolean ctrl, boolean shift)Handle keyboard navigation what the resolution is set to DAY.protected booleanhandleNavigationMonthMode(int keycode, boolean ctrl, boolean shift)Handle the keyboard navigation when the resolution is set to MONTH.protected booleanhandleNavigationYearMode(int keycode, boolean ctrl, boolean shift)Handles the keyboard navigation when the resolution is set to years.booleanisShowISOWeekNumbers()Returns whether ISO 8601 week numbers should be shown in the value selector or not.voidonBlur(com.google.gwt.event.dom.client.BlurEvent event)protected voidonDetach()voidonFocus(com.google.gwt.event.dom.client.FocusEvent event)voidonKeyDown(com.google.gwt.event.dom.client.KeyDownEvent event)voidonKeyPress(com.google.gwt.event.dom.client.KeyPressEvent event)voidonMouseDown(com.google.gwt.event.dom.client.MouseDownEvent event)voidonMouseOut(com.google.gwt.event.dom.client.MouseOutEvent event)voidonMouseUp(com.google.gwt.event.dom.client.MouseUpEvent event)protected booleanonTabOut(com.google.gwt.event.dom.client.DomEvent<?> event)If true should be returned if the panel will not be used after this event.protected booleanonValueChange()voidrenderCalendar()Updates the calendar and text field with the selected dates.voidrenderCalendar(boolean updateDate)For internal use only.voidsetDate(Date currentDate)Sets the data of the Panel.voidsetDateTimeService(DateTimeService dateTimeService)voidsetFocusChangeListener(VCalendarPanel.FocusChangeListener listener)The given FocusChangeListener is notified when the focused date changes by user either clicking on a new date or by using the keyboard.voidsetFocusOutListener(VCalendarPanel.FocusOutListener listener)A focus out listener is triggered when the panel loosed focus.voidsetParentField(VDateField parent)voidsetRangeEnd(Date newRangeEnd)Sets the end range for this component.voidsetRangeStart(Date newRangeStart)Sets the start range for this component.voidsetResolution(Resolution resolution)voidsetShowISOWeekNumbers(boolean showISOWeekNumbers)voidsetStyleName(String style)voidsetStylePrimaryName(String style)voidsetSubmitListener(VCalendarPanel.SubmitListener submitListener)The submit listener is called when the user selects a value from the calendar either by clicking the day or selects it by keyboard.voidsetTimeChangeListener(VCalendarPanel.TimeChangeListener listener)The time change listener is triggered when the user changes the time.-
Methods inherited from class com.vaadin.client.ui.FocusableFlexTable
addBlurHandler, addFocusHandler, addKeyDownHandler, addKeyPressHandler, focus, setFocus
-
Methods inherited from class com.google.gwt.user.client.ui.FlexTable
addCell, getCellCount, getFlexCellFormatter, getRowCount, insertCell, insertRow, prepareCell, prepareRow, removeAllRows, removeCell, removeCells, removeRow
-
Methods inherited from class com.google.gwt.user.client.ui.HTMLTable
addClickHandler, addDoubleClickHandler, addDragEndHandler, addDragEnterHandler, addDragHandler, addDragLeaveHandler, addDragOverHandler, addDragStartHandler, addDropHandler, addTableListener, checkCellBounds, checkRowBounds, clear, clear, clearCell, createCell, getBodyElement, getCellForEvent, getCellFormatter, getCellPadding, getCellSpacing, getColumnFormatter, getDOMCellCount, getDOMCellCount, getDOMCellCount, getDOMRowCount, getDOMRowCount, getDOMRowCount, getEventTargetCell, getHTML, getRowFormatter, getText, getWidget, insertCells, internalClearCell, internalClearCell, isCellPresent, iterator, onEnsureDebugId, prepareColumn, remove, removeTableListener, setBorderWidth, setCellFormatter, setCellPadding, setCellSpacing, setColumnFormatter, setHTML, setHTML, setRowFormatter, setText, setWidget, setWidget
-
Methods inherited from class com.google.gwt.user.client.ui.Panel
add, 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, onAttach, onBrowserEvent, 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, 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 java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
setParentField
public void setParentField(VDateField parent)
-
onValueChange
protected boolean onValueChange()
-
getResolution
public Resolution getResolution()
-
setResolution
public void setResolution(Resolution resolution)
-
setStyleName
public void setStyleName(String style)
- Overrides:
setStyleNamein classcom.google.gwt.user.client.ui.UIObject
-
setStylePrimaryName
public void setStylePrimaryName(String style)
- Overrides:
setStylePrimaryNamein classcom.google.gwt.user.client.ui.UIObject
-
setDateTimeService
public void setDateTimeService(DateTimeService dateTimeService)
-
isShowISOWeekNumbers
public boolean isShowISOWeekNumbers()
Returns whether ISO 8601 week numbers should be shown in the value selector or not. ISO 8601 defines that a week always starts with a Monday so the week numbers are only shown if this is the case.- Returns:
- true if week number should be shown, false otherwise
-
setShowISOWeekNumbers
public void setShowISOWeekNumbers(boolean showISOWeekNumbers)
-
renderCalendar
public void renderCalendar()
Updates the calendar and text field with the selected dates.
-
renderCalendar
public void renderCalendar(boolean updateDate)
For internal use only. May be removed or replaced in the future. Updates the calendar and text field with the selected dates.- Parameters:
updateDate- The value false prevents setting the selected date of the calendar based on focusedDate. That can be used when only the resolution of the calendar is changed and no date has been selected.
-
onKeyDown
public void onKeyDown(com.google.gwt.event.dom.client.KeyDownEvent event)
- Specified by:
onKeyDownin interfacecom.google.gwt.event.dom.client.KeyDownHandler
-
onKeyPress
public void onKeyPress(com.google.gwt.event.dom.client.KeyPressEvent event)
- Specified by:
onKeyPressin interfacecom.google.gwt.event.dom.client.KeyPressHandler
-
handleNavigationYearMode
protected boolean handleNavigationYearMode(int keycode, boolean ctrl, boolean shift)Handles the keyboard navigation when the resolution is set to years.- Parameters:
keycode- The keycode to processctrl- Is ctrl pressed?shift- is shift pressed- Returns:
- Returns true if the keycode was processed, else false
-
handleNavigationMonthMode
protected boolean handleNavigationMonthMode(int keycode, boolean ctrl, boolean shift)Handle the keyboard navigation when the resolution is set to MONTH.- Parameters:
keycode- The keycode to handlectrl- Was the ctrl key pressed?shift- Was the shift key pressed?- Returns:
-
handleNavigationDayMode
protected boolean handleNavigationDayMode(int keycode, boolean ctrl, boolean shift)Handle keyboard navigation what the resolution is set to DAY.- Parameters:
keycode- The keycode to handlectrl- Was the ctrl key pressed?shift- Was the shift key pressed?- Returns:
- Return true if the key press was handled by the method, else return false.
-
handleNavigation
protected boolean handleNavigation(int keycode, boolean ctrl, boolean shift)Handles the keyboard navigation.- Parameters:
keycode- The key code that was pressedctrl- Was the ctrl key pressedshift- Was the shift key pressed- Returns:
- Return true if key press was handled by the component, else return false
-
getResetKey
protected int getResetKey()
Returns the reset key which will reset the calendar to the previous selection. By default this is backspace but it can be overridden to change the key to whatever you want.- Returns:
-
getSelectKey
protected int getSelectKey()
Returns the select key which selects the value. By default this is the enter key but it can be changed to whatever you like by overriding this method.- Returns:
-
getCloseKey
protected int getCloseKey()
Returns the key that closes the popup window if this is a VPopopCalendar. Else this does nothing. By default this is the Escape key but you can change the key to whatever you want by overriding this method.- Returns:
-
getForwardKey
protected int getForwardKey()
The key that selects the next day in the calendar. By default this is the right arrow key but by overriding this method it can be changed to whatever you like.- Returns:
-
getBackwardKey
protected int getBackwardKey()
The key that selects the previous day in the calendar. By default this is the left arrow key but by overriding this method it can be changed to whatever you like.- Returns:
-
getNextKey
protected int getNextKey()
The key that selects the next week in the calendar. By default this is the down arrow key but by overriding this method it can be changed to whatever you like.- Returns:
-
getPreviousKey
protected int getPreviousKey()
The key that selects the previous week in the calendar. By default this is the up arrow key but by overriding this method it can be changed to whatever you like.- Returns:
-
onMouseOut
public void onMouseOut(com.google.gwt.event.dom.client.MouseOutEvent event)
- Specified by:
onMouseOutin interfacecom.google.gwt.event.dom.client.MouseOutHandler
-
onMouseDown
public void onMouseDown(com.google.gwt.event.dom.client.MouseDownEvent event)
- Specified by:
onMouseDownin interfacecom.google.gwt.event.dom.client.MouseDownHandler
-
onMouseUp
public void onMouseUp(com.google.gwt.event.dom.client.MouseUpEvent event)
- Specified by:
onMouseUpin interfacecom.google.gwt.event.dom.client.MouseUpHandler
-
setDate
public void setDate(Date currentDate)
Sets the data of the Panel.- Parameters:
currentDate- The date to set
-
getDate
public Date getDate()
-
onTabOut
protected boolean onTabOut(com.google.gwt.event.dom.client.DomEvent<?> event)
If true should be returned if the panel will not be used after this event.- Parameters:
event-- Returns:
-
setFocusOutListener
public void setFocusOutListener(VCalendarPanel.FocusOutListener listener)
A focus out listener is triggered when the panel loosed focus. This can happen either after a user clicks outside the panel or tabs out.- Parameters:
listener- The listener to trigger
-
setSubmitListener
public void setSubmitListener(VCalendarPanel.SubmitListener submitListener)
The submit listener is called when the user selects a value from the calendar either by clicking the day or selects it by keyboard.- Parameters:
submitListener- The listener to trigger
-
setFocusChangeListener
public void setFocusChangeListener(VCalendarPanel.FocusChangeListener listener)
The given FocusChangeListener is notified when the focused date changes by user either clicking on a new date or by using the keyboard.- Parameters:
listener- The FocusChangeListener to be notified
-
setTimeChangeListener
public void setTimeChangeListener(VCalendarPanel.TimeChangeListener listener)
The time change listener is triggered when the user changes the time.- Parameters:
listener-
-
getSubmitListener
public VCalendarPanel.SubmitListener getSubmitListener()
Returns the submit listener that listens to selection made from the panel.- Returns:
- The listener or NULL if no listener has been set
-
onBlur
public void onBlur(com.google.gwt.event.dom.client.BlurEvent event)
- Specified by:
onBlurin interfacecom.google.gwt.event.dom.client.BlurHandler
-
onFocus
public void onFocus(com.google.gwt.event.dom.client.FocusEvent event)
- Specified by:
onFocusin interfacecom.google.gwt.event.dom.client.FocusHandler
-
getSubPartName
public String getSubPartName(com.google.gwt.user.client.Element subElement)
- Specified by:
getSubPartNamein interfaceSubPartAware
-
getSubPartElement
public com.google.gwt.user.client.Element getSubPartElement(String subPart)
- Specified by:
getSubPartElementin interfaceSubPartAware
-
onDetach
protected void onDetach()
- Overrides:
onDetachin classcom.google.gwt.user.client.ui.Widget
-
setRangeStart
public void setRangeStart(Date newRangeStart)
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:
newRangeStart- - the allowed range's start date
-
setRangeEnd
public void setRangeEnd(Date newRangeEnd)
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:
newRangeEnd- - the allowed range's end date
-
-