net.sf.nachocalendar.model

Interface DateSelectionModel

public interface DateSelectionModel

Author:
Ignacio Merani

Field Summary

static int
MULTIPLE_INTERVAL_SELECTION
Used to support multiple Date intevals.
static int
SINGLE_INTERVAL_SELECTION
Used to support only one Date interval.
static int
SINGLE_SELECTION
Used to support only one Date selected.

Method Summary

void
addDateSelectionListener(DateSelectionListener listener)
Registers DateSelectionListener to receive events.
void
addSelectionInterval(Date from, Date to)
Adds the interval to the selection.
void
clearSelection()
Clears the current selection.
Date
getLeadSelectionDate()
Returns the lead selection Date.
Object
getSelectedDate()
Returns the selected Date.
Object[]
getSelectedDates()
Sets the selected Dates.
int
getSelectionMode()
Returns the selection mode.
boolean
getValueIsAdjusting()
Returns true if the current changes to the value property are part of a series of changes.
boolean
isSelectedDate(Date date)
Checks if provided date is selected.
boolean
isSelectionEmpty()
Checks if selection is empty.
void
removeDateSelectionListener(DateSelectionListener listener)
Removes DateSelectionListener from the list of listeners.
void
removeSelectionInterval(Date from, Date to)
Removes the interval from selection.
void
setLeadSelectionDate(Date date)
Sets the lead selection Date.
void
setSelectedDate(Object date)
Sets the selected Date.
void
setSelectedDates(Object[] dates)
Sets the selected Dates.
void
setSelectionMode(int selectionMode)
Sets the selection mode.
void
setValueIsAdjusting(boolean b)
This attribute indicates that any upcoming changes to the value of the model should be considered a single event.

Field Details

MULTIPLE_INTERVAL_SELECTION

public static final int MULTIPLE_INTERVAL_SELECTION
Used to support multiple Date intevals.
Field Value:
2

SINGLE_INTERVAL_SELECTION

public static final int SINGLE_INTERVAL_SELECTION
Used to support only one Date interval.
Field Value:
1

SINGLE_SELECTION

public static final int SINGLE_SELECTION
Used to support only one Date selected.
Field Value:
0

Method Details

addDateSelectionListener

public void addDateSelectionListener(DateSelectionListener listener)
Registers DateSelectionListener to receive events.
Parameters:
listener - The listener to register.

addSelectionInterval

public void addSelectionInterval(Date from,
                                 Date to)
Adds the interval to the selection.
Parameters:
from - starting date
to - end date

clearSelection

public void clearSelection()
Clears the current selection.

getLeadSelectionDate

public Date getLeadSelectionDate()
Returns the lead selection Date.
Returns:
lead selection Date.

getSelectedDate

public Object getSelectedDate()
Returns the selected Date.
Returns:
selected Date.

getSelectedDates

public Object[] getSelectedDates()
Sets the selected Dates.
Returns:
selected Dates.

getSelectionMode

public int getSelectionMode()
Returns the selection mode.
Returns:
selection mode.

getValueIsAdjusting

public boolean getValueIsAdjusting()
Returns true if the current changes to the value property are part of a series of changes.
Returns:

isSelectedDate

public boolean isSelectedDate(Date date)
Checks if provided date is selected.
Parameters:
date - Date to check.
Returns:
true if date is selected

isSelectionEmpty

public boolean isSelectionEmpty()
Checks if selection is empty.
Returns:
true if selection is empty.

removeDateSelectionListener

public void removeDateSelectionListener(DateSelectionListener listener)
Removes DateSelectionListener from the list of listeners.
Parameters:
listener - The listener to remove.

removeSelectionInterval

public void removeSelectionInterval(Date from,
                                    Date to)
Removes the interval from selection.
Parameters:
from - starting date
to - end date

setLeadSelectionDate

public void setLeadSelectionDate(Date date)
Sets the lead selection Date.
Parameters:
date - lead selection Date.

setSelectedDate

public void setSelectedDate(Object date)
Sets the selected Date.
Parameters:
date - selected Date.

setSelectedDates

public void setSelectedDates(Object[] dates)
Sets the selected Dates.
Parameters:
dates - selected Dates.

setSelectionMode

public void setSelectionMode(int selectionMode)
Sets the selection mode.
Parameters:
selectionMode - the new selection mode.

setValueIsAdjusting

public void setValueIsAdjusting(boolean b)
This attribute indicates that any upcoming changes to the value of the model should be considered a single event.
Parameters:
b -