com.bradrydzewski.gwt.calendar.client.monthview
Class MonthViewStyleManager

java.lang.Object
  extended by com.bradrydzewski.gwt.calendar.client.monthview.MonthViewStyleManager
Direct Known Subclasses:
GoogleMonthViewStyleManager, ICalMonthViewStyleManager

public abstract class MonthViewStyleManager
extends Object

Applies styles in a month view based on the currently selected theme. This class provides a template method to consistently style the appointments in a month view. Subclasses provide appropriate appointment styles based on a specific theme using methods getViewAppointmentStyleForTheme(com.bradrydzewski.gwt.calendar.client.Appointment) and getDefaultViewAppointmentStyleForTheme().

Author:
Brad Rydzewski, Carlos D. Morales
See Also:
GoogleMonthViewStyleManager, ICalMonthViewStyleManager

Field Summary
protected static String APPOINTMENT_STYLE
           
protected static String APPOINTMENT_STYLE_MULTIDAY
           
protected static String APPOINTMENT_STYLE_SELECTED
           
protected static String BACKGROUND_COLOR_STYLE_ATTRIBUTE
           
protected static String BORDER_COLOR_STYLE_ATTRIBUTE
           
protected static String COLOR_STYLE_ATTRIBUTE
           
 
Constructor Summary
MonthViewStyleManager()
           
 
Method Summary
 void applyStyle(AppointmentWidget widget, boolean selected)
          Applies a style in the currently selected theme using the runtime-provided theme styles defined by getViewAppointmentStyleForTheme(com.bradrydzewski.gwt.calendar.client.Appointment) and getDefaultViewAppointmentStyleForTheme().
protected  void doApplyStyleInternal(AppointmentWidget widget, boolean selected)
          Template method to consistently apply the styles to an appointment in the month view.
protected abstract  ThemeAppointmentStyle getDefaultViewAppointmentStyleForTheme()
          Returns the default appointment style corresponding to the currently used theme.
protected abstract  ThemeAppointmentStyle getViewAppointmentStyleForTheme(Appointment appointment)
          Returns the appointment style appropriate to the passed appointment based on a specific theme.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

APPOINTMENT_STYLE

protected static final String APPOINTMENT_STYLE
See Also:
Constant Field Values

APPOINTMENT_STYLE_SELECTED

protected static final String APPOINTMENT_STYLE_SELECTED
See Also:
Constant Field Values

APPOINTMENT_STYLE_MULTIDAY

protected static final String APPOINTMENT_STYLE_MULTIDAY
See Also:
Constant Field Values

BACKGROUND_COLOR_STYLE_ATTRIBUTE

protected static final String BACKGROUND_COLOR_STYLE_ATTRIBUTE
See Also:
Constant Field Values

BORDER_COLOR_STYLE_ATTRIBUTE

protected static final String BORDER_COLOR_STYLE_ATTRIBUTE
See Also:
Constant Field Values

COLOR_STYLE_ATTRIBUTE

protected static final String COLOR_STYLE_ATTRIBUTE
See Also:
Constant Field Values
Constructor Detail

MonthViewStyleManager

public MonthViewStyleManager()
Method Detail

getViewAppointmentStyleForTheme

protected abstract ThemeAppointmentStyle getViewAppointmentStyleForTheme(Appointment appointment)
Returns the appointment style appropriate to the passed appointment based on a specific theme.

Parameters:
appointment - An appointment to be displayed in the month view, should include a style to be used
Returns:
The style to use with a theme, can be null if a default should be used
See Also:
getDefaultViewAppointmentStyleForTheme()

getDefaultViewAppointmentStyleForTheme

protected abstract ThemeAppointmentStyle getDefaultViewAppointmentStyleForTheme()
Returns the default appointment style corresponding to the currently used theme. Subclasses should provide a style to be used if no appropriate style can be identified (getViewAppointmentStyleForTheme(com.bradrydzewski.gwt.calendar.client.Appointment) returns null).

Returns:
The style to use with a theme if no specific style can be identified with getViewAppointmentStyleForTheme(com.bradrydzewski.gwt.calendar.client.Appointment)

applyStyle

public void applyStyle(AppointmentWidget widget,
                       boolean selected)
Applies a style in the currently selected theme using the runtime-provided theme styles defined by getViewAppointmentStyleForTheme(com.bradrydzewski.gwt.calendar.client.Appointment) and getDefaultViewAppointmentStyleForTheme().

Parameters:
widget - The widget to style
selected - Indicates if the appointment is the currently selected in the view

doApplyStyleInternal

protected void doApplyStyleInternal(AppointmentWidget widget,
                                    boolean selected)
Template method to consistently apply the styles to an appointment in the month view.

Parameters:
widget - The widget to style
selected - Indicates if the appointment is the currently selected in the view


Copyright © 2012. All Rights Reserved.