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

All Known Implementing Classes:
AbstractScheduleModel, SimpleScheduleModel

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(Date date)
           Check if the schedule contains the specified date
 boolean containsRepeatedIntervals()
           
 Object get(int index)
           Get the day at position index.
 int getMode()
           
 Date getSelectedDate()
           
 ScheduleEntry getSelectedEntry()
           
 TimeZone getTimeZone()
           
 boolean isEmpty()
           
 boolean isEntrySelected()
           
 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(Date date)
           
 void setSelectedEntry(ScheduleEntry selectedEntry)
           
 int size()
           
 

Field Detail

DAY

static final int DAY
See Also:
Constant Field Values

WORKWEEK

static final int WORKWEEK
See Also:
Constant Field Values

WEEK

static final int WEEK
See Also:
Constant Field Values

MONTH

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

isEmpty

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

setMode

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

getMode

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

setSelectedDate

void setSelectedDate(Date date)
Parameters:
date - the date to select

getSelectedDate

Date getSelectedDate()
Returns:
the selected date

setSelectedEntry

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

getSelectedEntry

ScheduleEntry getSelectedEntry()
Returns:
the selected entry

isEntrySelected

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

containsDate

boolean containsDate(Date date)

Check if the schedule contains the specified date

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

get

Object get(int index)

Get the day at position index.

Parameters:
index - the index
Returns:
the day

iterator

Iterator iterator()
Returns:
an iterator for the days

size

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

addEntry

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

Parameters:
entry - the entry to be added

removeEntry

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

Parameters:
entry - the entry to be removed

removeSelectedEntry

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


refresh

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


getTimeZone

TimeZone getTimeZone()
Returns:
The timezone for which the model should be built

containsRepeatedIntervals

boolean containsRepeatedIntervals()
Returns:
true, if each day contains the same set of intervals


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