com.bradrydzewski.gwt.calendar.client
Class CalendarView

java.lang.Object
  extended by com.bradrydzewski.gwt.calendar.client.CalendarView
All Implemented Interfaces:
HasSettings
Direct Known Subclasses:
AgendaView, DayView, MonthView

public abstract class CalendarView
extends Object
implements HasSettings

Abstract base class defining the operations to render a calendar and user-input dispatching methods.

Subclasses will provide the details of rendering the calendar to visualize by day (Day View), monthly (month view), agenda (list view) and the logic implementing the user-input event processing.

Author:
Brad Rydzewski

Field Summary
protected  CalendarWidget calendarWidget
          Calendar widget bound to the view.
 
Constructor Summary
CalendarView()
           
 
Method Summary
 void attach(CalendarWidget calendarWidget)
          Attaches this view to the provided CalendarWidget.
 void createAppointment(Appointment appt)
           
 void createAppointment(Date start, Date end)
           
 void deleteAppointment(Appointment appt)
           
 void detatch()
          Detaches this view from the currently associated CalendarWidget.
abstract  void doLayout()
           
 void doSizing()
           
 int getDisplayedDays()
          Returns the configured number of days the calendar should display at a given time.
 CalendarSettings getSettings()
           
abstract  String getStyleName()
          Returns the CSS style name of this calendar view.
abstract  void onAppointmentSelected(Appointment appt)
           
 void onDeleteKeyPressed()
          Processes user com.google.gwt.event.dom.client.KeyCodes.KEY_DELETE keystrokes.
abstract  void onDoubleClick(com.google.gwt.user.client.Element element, com.google.gwt.user.client.Event event)
           
 void onDownArrowKeyPressed()
          Processes user com.google.gwt.event.dom.client.KeyCodes.KEY_DOWN keystrokes.
 void onLeftArrowKeyPressed()
          Processes user com.google.gwt.event.dom.client.KeyCodes.KEY_LEFT keystrokes.
abstract  void onMouseOver(com.google.gwt.user.client.Element element, com.google.gwt.user.client.Event event)
           
 void onRightArrowKeyPressed()
          Processes user com.google.gwt.event.dom.client.KeyCodes.KEY_RIGHT keystrokes.
abstract  void onSingleClick(com.google.gwt.user.client.Element element, com.google.gwt.user.client.Event event)
           
 void onUpArrowKeyPressed()
          Processes user com.google.gwt.event.dom.client.KeyCodes.KEY_UP keystrokes.
 void openAppointment(Appointment appt)
           
 void scrollToHour(int hour)
           
 void selectAppointment(Appointment appt)
           
 void selectNextAppointment()
           
 void selectPreviousAppointment()
           
 void setDisplayedDays(int displayedDays)
          Sets the configured number of days the calendar should display at a given time.
 void setSettings(CalendarSettings settings)
           
 void updateAppointment(Appointment toAppt)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

calendarWidget

protected CalendarWidget calendarWidget
Calendar widget bound to the view.

See Also:
CalendarWidget
Constructor Detail

CalendarView

public CalendarView()
Method Detail

attach

public void attach(CalendarWidget calendarWidget)
Attaches this view to the provided CalendarWidget.

Parameters:
calendarWidget - The interactive widget containing the calendar

detatch

public void detatch()
Detaches this view from the currently associated CalendarWidget. TODO: The CalendarWidget might still have a reference to this CalendarView, is that correct??


getStyleName

public abstract String getStyleName()
Returns the CSS style name of this calendar view.

Returns:
The CSS style that should be used when rendering this calendar view

doSizing

public void doSizing()

doLayout

public abstract void doLayout()

getDisplayedDays

public int getDisplayedDays()
Returns the configured number of days the calendar should display at a given time.

Returns:
The number of days this calendar view should display at a given time

setDisplayedDays

public void setDisplayedDays(int displayedDays)
Sets the configured number of days the calendar should display at a given time.

Parameters:
displayedDays - The number of days this calendar view should display at a given time

onDoubleClick

public abstract void onDoubleClick(com.google.gwt.user.client.Element element,
                                   com.google.gwt.user.client.Event event)

onSingleClick

public abstract void onSingleClick(com.google.gwt.user.client.Element element,
                                   com.google.gwt.user.client.Event event)

onMouseOver

public abstract void onMouseOver(com.google.gwt.user.client.Element element,
                                 com.google.gwt.user.client.Event event)

onDeleteKeyPressed

public void onDeleteKeyPressed()
Processes user com.google.gwt.event.dom.client.KeyCodes.KEY_DELETE keystrokes. The CalendarView implementation is empty so that subclasses are not forced to implement it if no specific logic is needed for com.google.gwt.event.dom.client.KeyCodes.KEY_DELETE keystrokes.


onUpArrowKeyPressed

public void onUpArrowKeyPressed()
Processes user com.google.gwt.event.dom.client.KeyCodes.KEY_UP keystrokes. The CalendarView implementation is empty so that subclasses are not forced to implement it if no specific logic is needed for com.google.gwt.event.dom.client.KeyCodes.KEY_UP keystrokes.


onDownArrowKeyPressed

public void onDownArrowKeyPressed()
Processes user com.google.gwt.event.dom.client.KeyCodes.KEY_DOWN keystrokes. The CalendarView implementation is empty so that subclasses are not forced to implement it if no specific logic is needed for com.google.gwt.event.dom.client.KeyCodes.KEY_DOWN keystrokes.


onLeftArrowKeyPressed

public void onLeftArrowKeyPressed()
Processes user com.google.gwt.event.dom.client.KeyCodes.KEY_LEFT keystrokes. The CalendarView implementation is empty so that subclasses are not forced to implement it if no specific logic is needed for com.google.gwt.event.dom.client.KeyCodes.KEY_LEFT keystrokes.


onRightArrowKeyPressed

public void onRightArrowKeyPressed()
Processes user com.google.gwt.event.dom.client.KeyCodes.KEY_RIGHT keystrokes. The CalendarView implementation is empty so that subclasses are not forced to implement it if no specific logic is needed for com.google.gwt.event.dom.client.KeyCodes.KEY_RIGHT keystrokes.


onAppointmentSelected

public abstract void onAppointmentSelected(Appointment appt)

selectAppointment

public final void selectAppointment(Appointment appt)

selectNextAppointment

public final void selectNextAppointment()

selectPreviousAppointment

public final void selectPreviousAppointment()

updateAppointment

public final void updateAppointment(Appointment toAppt)

deleteAppointment

public final void deleteAppointment(Appointment appt)

openAppointment

public final void openAppointment(Appointment appt)

createAppointment

public final void createAppointment(Appointment appt)

createAppointment

public final void createAppointment(Date start,
                                    Date end)

scrollToHour

public void scrollToHour(int hour)

getSettings

public CalendarSettings getSettings()
Specified by:
getSettings in interface HasSettings

setSettings

public void setSettings(CalendarSettings settings)
Specified by:
setSettings in interface HasSettings


Copyright © 2012. All Rights Reserved.