com.vaadin.terminal.gwt.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.terminal.gwt.client.ui.FocusableFlexTable
com.vaadin.terminal.gwt.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.HasBlurHandlers, com.google.gwt.event.dom.client.HasClickHandlers, com.google.gwt.event.dom.client.HasDoubleClickHandlers, 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.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>
- 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
public class VCalendarPanel
Nested Class Summary | |
---|---|
static interface |
VCalendarPanel.FocusChangeListener
FocusChangeListener is notified when the panel changes its _focused_ value. |
static interface |
VCalendarPanel.FocusOutListener
Blur listener that listens to blur event from the panel |
static interface |
VCalendarPanel.SubmitListener
|
static interface |
VCalendarPanel.TimeChangeListener
Dispatches an event when the panel when time is changed |
class |
VCalendarPanel.VTime
TimeSelector is a widget consisting of list boxes that modifie 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 |
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 inherited from class com.google.gwt.user.client.ui.UIObject |
---|
DEBUG_ID_PREFIX |
Constructor Summary | |
---|---|
VCalendarPanel()
|
Method Summary | |
---|---|
protected int |
getBackwardKey()
The key that selects the previous day in the calendar. |
protected int |
getCloseKey()
Returns the key that closes the popup window if this is a VPopopCalendar. |
Date |
getDate()
|
protected int |
getForwardKey()
The key that selects the next day in the calendar. |
protected int |
getNextKey()
The key that selects the next week in the calendar. |
protected int |
getPreviousKey()
The key that selects the previous week in the calendar. |
protected int |
getResetKey()
Returns the reset key which will reset the calendar to the previous selection. |
int |
getResolution()
|
protected int |
getSelectKey()
Returns the select key which selects the value. |
VCalendarPanel.SubmitListener |
getSubmitListener()
Returns the submit listener that listens to selection made from the 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 |
handleNavigation(int keycode,
boolean ctrl,
boolean shift)
Handles the keyboard navigation |
protected boolean |
handleNavigationDayMode(int keycode,
boolean ctrl,
boolean shift)
Handle keyboard navigation what the resolution is set to DAY |
protected boolean |
handleNavigationMonthMode(int keycode,
boolean ctrl,
boolean shift)
Handle the keyboard navigation when the resolution is set to MONTH |
protected boolean |
handleNavigationYearMode(int keycode,
boolean ctrl,
boolean shift)
Handles the keyboard navigation when the resolution is set to years. |
boolean |
isShowISOWeekNumbers()
Returns whether ISO 8601 week numbers should be shown in the value selector or not. |
void |
onBlur(com.google.gwt.event.dom.client.BlurEvent event)
|
protected void |
onDetach()
|
void |
onFocus(com.google.gwt.event.dom.client.FocusEvent event)
|
void |
onKeyDown(com.google.gwt.event.dom.client.KeyDownEvent event)
|
void |
onKeyPress(com.google.gwt.event.dom.client.KeyPressEvent event)
|
void |
onMouseDown(com.google.gwt.event.dom.client.MouseDownEvent event)
|
void |
onMouseOut(com.google.gwt.event.dom.client.MouseOutEvent event)
|
void |
onMouseUp(com.google.gwt.event.dom.client.MouseUpEvent event)
|
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. |
protected boolean |
onValueChange()
|
void |
renderCalendar()
Updates the calendar and text field with the selected dates. |
void |
setDate(Date currentDate)
Sets the data of the Panel. |
void |
setDateTimeService(DateTimeService dateTimeService)
|
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. |
void |
setFocusOutListener(VCalendarPanel.FocusOutListener listener)
A focus out listener is triggered when the panel loosed focus. |
void |
setResolution(int resolution)
|
void |
setShowISOWeekNumbers(boolean showISOWeekNumbers)
|
void |
setSubmitListener(VCalendarPanel.SubmitListener submitListener)
The submit listener is called when the user selects a value from the calender either by clicking the day or selects it by keyboard. |
void |
setTimeChangeListener(VCalendarPanel.TimeChangeListener listener)
The time change listener is triggered when the user changes the time. |
Methods inherited from class com.vaadin.terminal.gwt.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, addTableListener, checkCellBounds, checkRowBounds, clear, clear, clearCell, createCell, getBodyElement, getCellForEvent, getCellFormatter, getCellPadding, getCellSpacing, getColumnFormatter, getDOMCellCount, getDOMCellCount, getDOMRowCount, getDOMRowCount, getEventTargetCell, getHTML, getRowFormatter, getText, getWidget, insertCells, 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, 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, onBrowserEvent, 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, removeStyleDependentName, removeStyleName, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, 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.event.shared.HasHandlers |
---|
fireEvent |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Methods inherited from interface com.google.gwt.event.shared.HasHandlers |
---|
fireEvent |
Constructor Detail |
---|
VCalendarPanel
public VCalendarPanel()
Method Detail |
---|
onValueChange
protected boolean onValueChange()
getResolution
public int getResolution()
setResolution
public void setResolution(int resolution)
setDateTimeService
public void setDateTimeService(DateTimeService dateTimeService)
isShowISOWeekNumbers
public boolean isShowISOWeekNumbers()
- Returns:
- true if week number should be shown, false otherwise
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.
setShowISOWeekNumbers
public void setShowISOWeekNumbers(boolean showISOWeekNumbers)
renderCalendar
public void renderCalendar()
Updates the calendar and text field with the selected dates.
onKeyDown
public void onKeyDown(com.google.gwt.event.dom.client.KeyDownEvent event)
- Specified by:
onKeyDown
in interfacecom.google.gwt.event.dom.client.KeyDownHandler
onKeyPress
public void onKeyPress(com.google.gwt.event.dom.client.KeyPressEvent event)
- Specified by:
onKeyPress
in interfacecom.google.gwt.event.dom.client.KeyPressHandler
handleNavigationYearMode
protected boolean handleNavigationYearMode(int keycode,
boolean ctrl,
boolean shift)
- Parameters:
keycode
- The keycode to processctrl
- Is ctrl pressed?shift
- is shift pressed- Returns:
- Returns true if the keycode was processed, else false
Handles the keyboard navigation when the resolution is set to years.
handleNavigationMonthMode
protected boolean handleNavigationMonthMode(int keycode,
boolean ctrl,
boolean shift)
- Parameters:
keycode
- The keycode to handlectrl
- Was the ctrl key pressed?shift
- Was the shift key pressed?- Returns:
Handle the keyboard navigation when the resolution is set to MONTH
handleNavigationDayMode
protected boolean handleNavigationDayMode(int keycode,
boolean ctrl,
boolean shift)
- 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.
Handle keyboard navigation what the resolution is set to DAY
handleNavigation
protected boolean handleNavigation(int keycode,
boolean ctrl,
boolean shift)
- 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
Handles the keyboard navigation
getResetKey
protected int getResetKey()
- Returns:
Returns the reset key which will reset the calendar to the previous selection. By default this is backspace but it can be overriden to change the key to whatever you want.
getSelectKey
protected int getSelectKey()
- Returns:
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.
getCloseKey
protected int getCloseKey()
- Returns:
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.
getForwardKey
protected int getForwardKey()
- Returns:
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.
getBackwardKey
protected int getBackwardKey()
- Returns:
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.
getNextKey
protected int getNextKey()
- Returns:
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.
getPreviousKey
protected int getPreviousKey()
- Returns:
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.
onMouseOut
public void onMouseOut(com.google.gwt.event.dom.client.MouseOutEvent event)
- Specified by:
onMouseOut
in interfacecom.google.gwt.event.dom.client.MouseOutHandler
onMouseDown
public void onMouseDown(com.google.gwt.event.dom.client.MouseDownEvent event)
- Specified by:
onMouseDown
in interfacecom.google.gwt.event.dom.client.MouseDownHandler
onMouseUp
public void onMouseUp(com.google.gwt.event.dom.client.MouseUpEvent event)
- Specified by:
onMouseUp
in interfacecom.google.gwt.event.dom.client.MouseUpHandler
setDate
public void setDate(Date currentDate)
- Parameters:
currentDate
- The date to set
Sets the data of the Panel.
getDate
public Date getDate()
onTabOut
protected boolean onTabOut(com.google.gwt.event.dom.client.DomEvent<?> event)
- Parameters:
event
-- Returns:
If true should be returned if the panel will not be used after this event.
setFocusOutListener
public void setFocusOutListener(VCalendarPanel.FocusOutListener listener)
- Parameters:
listener
- The listener to trigger
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.
setSubmitListener
public void setSubmitListener(VCalendarPanel.SubmitListener submitListener)
- Parameters:
submitListener
- The listener to trigger
The submit listener is called when the user selects a value from the calender either by clicking the day or selects it by keyboard.
setFocusChangeListener
public void setFocusChangeListener(VCalendarPanel.FocusChangeListener listener)
- Parameters:
listener
- The FocusChangeListener to be notified
The given FocusChangeListener is notified when the focused date changes by user either clicking on a new date or by using the keyboard.
setTimeChangeListener
public void setTimeChangeListener(VCalendarPanel.TimeChangeListener listener)
- Parameters:
listener
-
The time change listener is triggered when the user changes the time.
getSubmitListener
public VCalendarPanel.SubmitListener getSubmitListener()
- Returns:
- The listener or NULL if no listener has been set
Returns the submit listener that listens to selection made from the panel
onBlur
public void onBlur(com.google.gwt.event.dom.client.BlurEvent event)
- Specified by:
onBlur
in interfacecom.google.gwt.event.dom.client.BlurHandler
onFocus
public void onFocus(com.google.gwt.event.dom.client.FocusEvent event)
- Specified by:
onFocus
in interfacecom.google.gwt.event.dom.client.FocusHandler
getSubPartName
public String getSubPartName(com.google.gwt.user.client.Element subElement)
- Specified by:
getSubPartName
in interfaceSubPartAware
- 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.
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.
getSubPartElement
public com.google.gwt.user.client.Element getSubPartElement(String subPart)
- Specified by:
getSubPartElement
in interfaceSubPartAware
- 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.
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.
onDetach
protected void onDetach()
- Overrides:
onDetach
in classcom.google.gwt.user.client.ui.Widget