com.google.gwt.widgetideas.datepicker.client
Class CalendarView<MyDatePicker extends DatePicker>

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by com.google.gwt.user.client.ui.Composite
              extended by com.google.gwt.widgetideas.datepicker.client.CalendarView<MyDatePicker>
Type Parameters:
MyDatePicker - the date picker type used with this calendar view.
All Implemented Interfaces:
com.google.gwt.user.client.EventListener
Direct Known Subclasses:
SimpleCalendarView

public abstract class CalendarView<MyDatePicker extends DatePicker>
extends com.google.gwt.user.client.ui.Composite

The CalendarView is a calendar grid that represents the current view of a DatePicker.


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
 
Field Summary
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
CalendarView()
           
 
Method Summary
abstract  void addDateStyle(java.util.Date date, java.lang.String styleName)
          Adds a stylename to the cell of the supplied date.
 void addDateStyles(java.lang.Iterable<java.util.Date> dates, java.lang.String styleName)
           
protected  void addMonths(int numMonths)
           
protected  MyDatePicker getDatePicker()
           
abstract  java.util.Date getFirstVisibleDate()
          Returns the first date that is currently shown by the calendar.
abstract  java.util.Date getLastVisibleDate()
          Returns the last date that is currently shown by the calendar.
 CalendarModel getModel()
           
abstract  boolean isDateEnabled(java.util.Date d)
           
 boolean isVisible(java.util.Date date)
           
abstract  void refresh()
          Refresh the component.
abstract  void removeStyleName(java.util.Date date, java.lang.String styleName)
          Removes a stylename from the cell of the supplied date.
abstract  void setDateEnabled(java.util.Date date, boolean enabled)
          Enables or Disables a particular date.
 void setEnabledDates(java.lang.Iterable<java.util.Date> dates, boolean enabled)
          Enables or disables multiple dates.
protected abstract  void setup()
          Set up the component.
protected  void updateHighlightedDate(java.util.Date date)
           
 
Methods inherited from class com.google.gwt.user.client.ui.Composite
getElement, getWidget, initWidget, isAttached, onAttach, onDetach, setWidget
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
doAttachChildren, doDetachChildren, getParent, onBrowserEvent, onLoad, onUnload, removeFromParent, setElement
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, setHeight, setPixelSize, setSize, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkEvents, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CalendarView

public CalendarView()
Method Detail

addDateStyle

public abstract void addDateStyle(java.util.Date date,
                                  java.lang.String styleName)
Adds a stylename to the cell of the supplied date. TEMP

Parameters:
date - date that will have the supplied style added
styleName - style name to add

addDateStyles

public void addDateStyles(java.lang.Iterable<java.util.Date> dates,
                          java.lang.String styleName)

getFirstVisibleDate

public abstract java.util.Date getFirstVisibleDate()
Returns the first date that is currently shown by the calendar.


getLastVisibleDate

public abstract java.util.Date getLastVisibleDate()
Returns the last date that is currently shown by the calendar.


isDateEnabled

public abstract boolean isDateEnabled(java.util.Date d)

isVisible

public boolean isVisible(java.util.Date date)

refresh

public abstract void refresh()
Refresh the component. Usually called because the model's current date has changed.


removeStyleName

public abstract void removeStyleName(java.util.Date date,
                                     java.lang.String styleName)
Removes a stylename from the cell of the supplied date.

Parameters:
date - date that will have the supplied style added
styleName - style name to remove

setDateEnabled

public abstract void setDateEnabled(java.util.Date date,
                                    boolean enabled)
Enables or Disables a particular date. by default all valid dates are enabled after a rendering event. Disabled dates cannot be selected.

Parameters:
date - date to enable or disable
enabled - true for enabled, false for disabled

setEnabledDates

public void setEnabledDates(java.lang.Iterable<java.util.Date> dates,
                            boolean enabled)
Enables or disables multiple dates.

Parameters:
dates - dates to [en|dis]able
enabled - true to enable, false to disable

updateHighlightedDate

protected final void updateHighlightedDate(java.util.Date date)

getModel

public CalendarModel getModel()

addMonths

protected void addMonths(int numMonths)

getDatePicker

protected MyDatePicker getDatePicker()

setup

protected abstract void setup()
Set up the component.