to.etc.domui.component.agenda
Class BasicScheduleModel<T extends ScheduleItem>

java.lang.Object
  extended by to.etc.domui.component.agenda.BasicScheduleModel<T>
All Implemented Interfaces:
ScheduleModel<T>

public class BasicScheduleModel<T extends ScheduleItem>
extends java.lang.Object
implements ScheduleModel<T>


Constructor Summary
BasicScheduleModel()
           
 
Method Summary
 void addHoliday(ScheduleHoliday h)
           
 void addItem(T i)
           
 void addScheduleListener(ScheduleModelChangedListener<T> chl)
           
 void addWorkHour(java.util.Date start, java.util.Date end)
           
 void addWorkHour(ScheduleWorkHour h)
           
 void changeItem(T i)
           
 void deleteItem(T i)
           
protected  void fireItemAdded(T si)
           
protected  void fireItemChanged(T si)
           
protected  void fireItemDeleted(T si)
           
protected  void fireModelChanged()
           
protected  java.util.List<ScheduleModelChangedListener<T>> getListeners()
           
 java.util.List<ScheduleHoliday> getScheduleHolidays(java.util.Date start, java.util.Date end)
          Returns a list of holidays in the given period.
 java.util.List<T> getScheduleItems(java.util.Date start, java.util.Date end)
          Get schedule items in the specified period.
 java.util.List<ScheduleWorkHour> getScheduleWorkHours(java.util.Date start, java.util.Date end)
          Returns the work hours for the user on each day in the given period.
 void removeScheduleListener(ScheduleModelChangedListener<T> chl)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicScheduleModel

public BasicScheduleModel()
Method Detail

getScheduleHolidays

public java.util.List<ScheduleHoliday> getScheduleHolidays(java.util.Date start,
                                                           java.util.Date end)
                                                    throws java.lang.Exception
Description copied from interface: ScheduleModel
Returns a list of holidays in the given period. Each holiday can be a single day only; the date it contains gets time-truncated. This gets called only once as long as the component's date range does not change. This means that this call should not cache it's response to this call.

Specified by:
getScheduleHolidays in interface ScheduleModel<T extends ScheduleItem>
Returns:
Throws:
java.lang.Exception

getScheduleItems

public java.util.List<T> getScheduleItems(java.util.Date start,
                                          java.util.Date end)
                                                        throws java.lang.Exception
Description copied from interface: ScheduleModel
Get schedule items in the specified period. This gets called only once as long as the component's date range does not change. This means that this call should not cache it's response to this call.

Specified by:
getScheduleItems in interface ScheduleModel<T extends ScheduleItem>
Returns:
Throws:
java.lang.Exception

getScheduleWorkHours

public java.util.List<ScheduleWorkHour> getScheduleWorkHours(java.util.Date start,
                                                             java.util.Date end)
                                                      throws java.lang.Exception
Description copied from interface: ScheduleModel
Returns the work hours for the user on each day in the given period. This call must return WorkHour's where each hour's start and end date is fully filled with an actual date range falling fully on a single day. To specify a lunch period return two WorkHour periods for a day. This call may just return an empty list if no work hour display logic is wanted.

Specified by:
getScheduleWorkHours in interface ScheduleModel<T extends ScheduleItem>
Returns:
Throws:
java.lang.Exception

addHoliday

public void addHoliday(ScheduleHoliday h)
                throws java.lang.Exception
Throws:
java.lang.Exception

addItem

public void addItem(T i)
             throws java.lang.Exception
Throws:
java.lang.Exception

deleteItem

public void deleteItem(T i)
                throws java.lang.Exception
Throws:
java.lang.Exception

changeItem

public void changeItem(T i)
                throws java.lang.Exception
Throws:
java.lang.Exception

addWorkHour

public void addWorkHour(ScheduleWorkHour h)
                 throws java.lang.Exception
Throws:
java.lang.Exception

addWorkHour

public void addWorkHour(java.util.Date start,
                        java.util.Date end)
                 throws java.lang.Exception
Throws:
java.lang.Exception

addScheduleListener

public void addScheduleListener(ScheduleModelChangedListener<T> chl)
Specified by:
addScheduleListener in interface ScheduleModel<T extends ScheduleItem>

removeScheduleListener

public void removeScheduleListener(ScheduleModelChangedListener<T> chl)
Specified by:
removeScheduleListener in interface ScheduleModel<T extends ScheduleItem>

getListeners

protected java.util.List<ScheduleModelChangedListener<T>> getListeners()

fireModelChanged

protected void fireModelChanged()
                         throws java.lang.Exception
Throws:
java.lang.Exception

fireItemAdded

protected void fireItemAdded(T si)
                      throws java.lang.Exception
Throws:
java.lang.Exception

fireItemDeleted

protected void fireItemDeleted(T si)
                        throws java.lang.Exception
Throws:
java.lang.Exception

fireItemChanged

protected void fireItemChanged(T si)
                        throws java.lang.Exception
Throws:
java.lang.Exception