org.apache.myfaces.custom.schedule.model
Class SimpleScheduleModel

java.lang.Object
  extended by org.apache.myfaces.custom.schedule.model.AbstractScheduleModel
      extended by org.apache.myfaces.custom.schedule.model.SimpleScheduleModel
All Implemented Interfaces:
Serializable, ScheduleModel

public class SimpleScheduleModel
extends AbstractScheduleModel
implements Serializable

A simple implementation of the ScheduleModel, not backed by any kind of datasource: entries have to be added manually.

Version:
$Revision: 371736 $
Author:
Jurgen Lust (latest modification by $Author: werpu $)
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.myfaces.custom.schedule.model.AbstractScheduleModel
timeZone
 
Fields inherited from interface org.apache.myfaces.custom.schedule.model.ScheduleModel
DAY, MONTH, WEEK, WORKWEEK
 
Constructor Summary
SimpleScheduleModel()
          Creates a new SimpleScheduleModel object.
 
Method Summary
 void addEntry(ScheduleEntry entry)
          Add an entry to the model.
protected  void loadDayAttributes(Day day)
           Load any attributes for this day: is it a working day or a holiday, and what is the name of the day (e.g.
protected  Collection loadEntries(Date startDate, Date endDate)
           Load the schedule entries that fall between the startDate and the endDate.
 void removeEntry(ScheduleEntry entry)
          Remove an entry from the model.
 void removeSelectedEntry()
          Remove the currently selected entry from this model.
 void setHoliday(Date date, String holidayName)
          Set the name of a holiday.
 
Methods inherited from class org.apache.myfaces.custom.schedule.model.AbstractScheduleModel
add, clear, containsDate, containsRepeatedIntervals, get, getCalendarInstance, getDays, getMode, getSelectedDate, getSelectedEntry, getTimeZone, isEmpty, isEntrySelected, iterator, refresh, setDay, setMode, setMonth, setSelectedDate, setSelectedEntry, setWeek, setWorkWeek, size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleScheduleModel

public SimpleScheduleModel()
Creates a new SimpleScheduleModel object.

Method Detail

setHoliday

public void setHoliday(Date date,
                       String holidayName)
Set the name of a holiday.

Parameters:
date - the date
holidayName - the name of the holiday

addEntry

public void addEntry(ScheduleEntry entry)
Add an entry to the model.

Specified by:
addEntry in interface ScheduleModel
Parameters:
entry - the entry to add

removeEntry

public void removeEntry(ScheduleEntry entry)
Remove an entry from the model.

Specified by:
removeEntry in interface ScheduleModel
Parameters:
entry - the entry to remove

removeSelectedEntry

public void removeSelectedEntry()
Description copied from interface: ScheduleModel
Remove the currently selected entry from this model. If no entry is currently selected, nothing should happen.

Specified by:
removeSelectedEntry in interface ScheduleModel
See Also:
ScheduleModel.removeSelectedEntry()

loadEntries

protected Collection loadEntries(Date startDate,
                                 Date endDate)
Description copied from class: AbstractScheduleModel

Load the schedule entries that fall between the startDate and the endDate.

Specified by:
loadEntries in class AbstractScheduleModel
Parameters:
startDate - 0 AM on the start date
endDate - 12 PM on the end date
See Also:
AbstractScheduleModel.loadEntries(java.util.Date, java.util.Date)

loadDayAttributes

protected void loadDayAttributes(Day day)
Description copied from class: AbstractScheduleModel

Load any attributes for this day: is it a working day or a holiday, and what is the name of the day (e.g. "Christmas").

Specified by:
loadDayAttributes in class AbstractScheduleModel
Parameters:
day - the day that should be loaded
See Also:
AbstractScheduleModel.loadDayAttributes(org.apache.myfaces.custom.schedule.model.Day)


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.