com.vaadin.client.ui
Class VCalendarPanel

java.lang.Object
  extended by FlexTable
      extended by com.vaadin.client.ui.FocusableFlexTable
          extended by com.vaadin.client.ui.VCalendarPanel
All Implemented Interfaces:
Focusable, SubPartAware

public class VCalendarPanel
extends FocusableFlexTable
implements SubPartAware


Nested Class Summary
static interface VCalendarPanel.FocusChangeListener
          FocusChangeListener is notified when the panel changes its _focused_ value.
 class VCalendarPanel.FocusedDate
          Helper class to inform the screen reader that the user changed the selected date.
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.
 
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.
 java.util.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.
 com.vaadin.shared.ui.datefield.Resolution 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(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.
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(BlurEvent event)
           
protected  void onDetach()
           
 void onFocus(FocusEvent event)
           
 void onKeyDown(KeyDownEvent event)
           
 void onKeyPress(KeyPressEvent event)
           
 void onMouseDown(MouseDownEvent event)
           
 void onMouseOut(MouseOutEvent event)
           
 void onMouseUp(MouseUpEvent event)
           
protected  boolean onTabOut( 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 renderCalendar(boolean updateDate)
          For internal use only.
 void setDate(java.util.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 setParentField(VDateField parent)
           
 void setRangeEnd(java.util.Date newRangeEnd)
          Sets the end range for this component.
 void setRangeStart(java.util.Date newRangeStart)
          Sets the start range for this component.
 void setResolution(com.vaadin.shared.ui.datefield.Resolution resolution)
           
 void setShowISOWeekNumbers(boolean showISOWeekNumbers)
           
 void setStyleName(java.lang.String style)
           
 void setStylePrimaryName(java.lang.String style)
           
 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.client.ui.FocusableFlexTable
addBlurHandler, addFocusHandler, addKeyDownHandler, addKeyPressHandler, focus, setFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VCalendarPanel

public VCalendarPanel()
Method Detail

setParentField

public void setParentField(VDateField parent)

onValueChange

protected boolean onValueChange()

getResolution

public com.vaadin.shared.ui.datefield.Resolution getResolution()

setResolution

public void setResolution(com.vaadin.shared.ui.datefield.Resolution resolution)

setStyleName

public void setStyleName(java.lang.String style)

setStylePrimaryName

public void setStylePrimaryName(java.lang.String style)

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(KeyDownEvent event)

onKeyPress

public void onKeyPress(KeyPressEvent event)

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 process
ctrl - 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 handle
ctrl - 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 handle
ctrl - 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 pressed
ctrl - Was the ctrl key pressed
shift - 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 overriden 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(MouseOutEvent event)

onMouseDown

public void onMouseDown(MouseDownEvent event)

onMouseUp

public void onMouseUp(MouseUpEvent event)

setDate

public void setDate(java.util.Date currentDate)
Sets the data of the Panel.

Parameters:
currentDate - The date to set

getDate

public java.util.Date getDate()

onTabOut

protected boolean onTabOut( 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 calender 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(BlurEvent event)

onFocus

public void onFocus(FocusEvent event)

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
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.

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
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.

onDetach

protected void onDetach()

setRangeStart

public void setRangeStart(java.util.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:
startDate - - the allowed range's start date

setRangeEnd

public void setRangeEnd(java.util.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:
endDate - - the allowed range's end date


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