org.apache.myfaces.custom.schedule.model
Interface ScheduleModel

All Known Implementing Classes:
AbstractScheduleModel

public interface ScheduleModel

The underlying model of the UISchedule component. You should implement this interface when creating real implementations, which would typically be backed by a database.

Version:
$Revision: 368941 $
Author:
Jurgen Lust (latest modification by $Author: schof $)

Field Summary
static int DAY
           
static int MONTH
           
static int WEEK
           
static int WORKWEEK
           
 
Method Summary
 void addEntry(ScheduleEntry entry)
          Add an entry to the this model.
 boolean containsDate(java.util.Date date)
           Check if the schedule contains the specified date
 java.lang.Object get(int index)
           Get the day at position index.
 int getMode()
           
 java.util.Date getSelectedDate()
           
 ScheduleEntry getSelectedEntry()
           
 boolean isEmpty()
           
 boolean isEntrySelected()
           
 java.util.Iterator iterator()
           
 void refresh()
          Reload the entries for the currently selected period
 void removeEntry(ScheduleEntry entry)
          Remove an entry from this model
 void removeSelectedEntry()
          Remove the currently selected entry from this model.
 void setMode(int mode)
           
 void setSelectedDate(java.util.Date date)
           
 void setSelectedEntry(ScheduleEntry selectedEntry)
           
 int size()
           
 

Field Detail

DAY

public static final int DAY
See Also:
Constant Field Values

WORKWEEK

public static final int WORKWEEK
See Also:
Constant Field Values

WEEK

public static final int WEEK
See Also:
Constant Field Values

MONTH

public static final int MONTH
See Also:
Constant Field Values
Method Detail

isEmpty

public boolean isEmpty()
Returns:
true if there are no entries

setMode

public void setMode(int mode)
Parameters:
mode - the mode: DAY, WORKWEEK, WEEK or MONTH

getMode

public int getMode()
Returns:
the mode: DAY, WORKWEEK, WEEK or MONTH

setSelectedDate

public void setSelectedDate(java.util.Date date)
Parameters:
date - the date to select

getSelectedDate

public java.util.Date getSelectedDate()
Returns:
the selected date

setSelectedEntry

public void setSelectedEntry(ScheduleEntry selectedEntry)
Parameters:
selectedEntry - the entry to select

getSelectedEntry

public ScheduleEntry getSelectedEntry()
Returns:
the selected entry

isEntrySelected

public boolean isEntrySelected()
Returns:
whether an entry is currently selected

containsDate

public boolean containsDate(java.util.Date date)

Check if the schedule contains the specified date

Parameters:
date - the date to check
Returns:
whether the schedule containts this date

get

public java.lang.Object get(int index)

Get the day at position index.

Parameters:
index - the index
Returns:
the day

iterator

public java.util.Iterator iterator()
Returns:
an iterator for the days

size

public int size()
Returns:
the number of days in this model

addEntry

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

Parameters:
entry - the entry to be added

removeEntry

public void removeEntry(ScheduleEntry entry)
Remove an entry from this model

Parameters:
entry - the entry to be removed

removeSelectedEntry

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


refresh

public void refresh()
Reload the entries for the currently selected period



Copyright © 2007 Apache Software Foundation. All Rights Reserved.