org.cruxframework.crux.widgets.client.datepicker
Class CruxCalendarView

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 org.cruxframework.crux.widgets.client.datepicker.CruxCalendarView
All Implemented Interfaces:
com.google.gwt.event.logical.shared.HasAttachHandlers, 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.IsRenderable, com.google.gwt.user.client.ui.IsWidget

public final class CruxCalendarView
extends com.google.gwt.user.client.ui.Composite

Author:
Samuel Almeida Cardoso (samuel@cruxframework.org)

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
 org.cruxframework.crux.widgets.client.datepicker.GWTOverriddenDefaultCalendarView.CellGrid grid
           
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
CruxCalendarView()
           
 
Method Summary
protected  void addMonths(int numMonths)
           
 void addStyleToDate(String styleName, Date date)
          Adds a style name to the cell of the supplied date.
protected  org.cruxframework.crux.widgets.client.datepicker.GWTOverriddenDatePicker getDatePicker()
           
 Date getFirstDate()
          Returns the first date that is currently shown by the calendar.
 org.cruxframework.crux.widgets.client.datepicker.GWTOverriddenDefaultCalendarView.CellGrid getGrid()
           
 Date getLastDate()
          Returns the last date that is currently shown by the calendar.
 org.cruxframework.crux.widgets.client.datepicker.GWTOverriddenCalendarModel getModel()
           
 boolean isDateEnabled(Date d)
          Is the cell representing the given date enabled?
 void refresh()
          Refresh the component.
protected  void refreshAll()
          Refreshes the GWTOverriddenDatePicker, GWTOverriddenCalendarView, and GWTOverriddenCalendarModel.
 void removeStyleFromDate(String styleName, Date date)
          Removes a visible style name from the cell of the supplied date.
 void setAriaSelectedCell(Date date)
          Sets aria-selected in the given date's cell and clears the other cells.
 void setEnabledOnDate(boolean enabled, Date date)
          Enables or Disables a particular date. by default all valid dates are enabled after a rendering event.
protected  void setHighlightedDate(Date date)
          Allows the calendar view to update the date picker's highlighted date.
 void setup()
          Set up the component.
 
Methods inherited from class com.google.gwt.user.client.ui.Composite
claimElement, getWidget, initializeClaimedElement, initWidget, isAttached, onAttach, onBrowserEvent, onDetach, render, render, resolvePotentialElement, setWidget
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, 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, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

grid

public org.cruxframework.crux.widgets.client.datepicker.GWTOverriddenDefaultCalendarView.CellGrid grid
Constructor Detail

CruxCalendarView

public CruxCalendarView()
Method Detail

getGrid

public org.cruxframework.crux.widgets.client.datepicker.GWTOverriddenDefaultCalendarView.CellGrid getGrid()

addStyleToDate

public void addStyleToDate(String styleName,
                           Date date)
Adds a style name to the cell of the supplied date. This style is only set until the next time the GWTOverriddenCalendarView is refreshed.

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

getFirstDate

public Date getFirstDate()
Returns the first date that is currently shown by the calendar.

Returns:
the first date.

getLastDate

public Date getLastDate()
Returns the last date that is currently shown by the calendar.

Returns:
the last date.

isDateEnabled

public boolean isDateEnabled(Date d)
Is the cell representing the given date enabled?

Parameters:
d - the date
Returns:
is the date enabled

refresh

public void refresh()
Refresh the component. Usually called because the model's current date has changed. In general, only should be called by GWTOverriddenDatePicker. Use refreshAll() if you need to refresh all components.


removeStyleFromDate

public void removeStyleFromDate(String styleName,
                                Date date)
Removes a visible style name from the cell of the supplied date.

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

setAriaSelectedCell

public void setAriaSelectedCell(Date date)
Sets aria-selected in the given date's cell and clears the other cells.

Parameters:
date - the date of the cell where aria-selected should be set, or null to clear aria-selected.

setEnabledOnDate

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

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

setup

public void setup()
Set up the component.


setHighlightedDate

protected final void setHighlightedDate(Date date)
Allows the calendar view to update the date picker's highlighted date.

Parameters:
date - the highlighted date

getModel

public org.cruxframework.crux.widgets.client.datepicker.GWTOverriddenCalendarModel getModel()

addMonths

protected void addMonths(int numMonths)

getDatePicker

protected org.cruxframework.crux.widgets.client.datepicker.GWTOverriddenDatePicker getDatePicker()

refreshAll

protected void refreshAll()
Refreshes the GWTOverriddenDatePicker, GWTOverriddenCalendarView, and GWTOverriddenCalendarModel.



Copyright © 2015. All rights reserved.