public final class Selection
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
void |
add(DateTime date)
Adds the specified date to the selection.
|
void |
add(DateTime start,
DateTime end)
Adds the specified date range to the selection.
|
void |
add(DateTime start,
DateTime end,
Resource resource)
Adds the specified date range to the selection of the
specified resource.
|
void |
add(DateTime start,
DateTime end,
Resource[] resources)
Adds to the selection the specified date range associated with the specified resources.
|
void |
addChangeListener(ChangeListener listener)
Adds a
ChangeListener to the selection. |
boolean |
contains(DateTime date)
Determines whether the specified date is currently selected.
|
boolean |
containsDay(DateTime date)
Determines whether any part of the specified day is selected.
|
java.lang.Boolean |
getAllowMultiple()
Gets a value indicating whether users are allowed
to select multiple elements at a time.
|
java.lang.Boolean |
getContinuous()
Gets a value indicating whether users can select
only one range of dates in the calendar.
|
java.util.List<DateTime> |
getDayRanges()
Gets a read-only collection of
DateTime objects, sorted chronologically. |
java.lang.Boolean |
getEnabled()
Gets a value indicating whether users are allowed
to select any cells in the calendar.
|
boolean |
getIsEmpty()
Gets a value indicating whether this selection is empty.
|
java.util.List<DateTime> |
getRanges()
Gets a read-only collection of
DateTime objects, sorted chronologically. |
Resource |
getResource()
Gets the resource related to the current selection.
|
Resource[] |
getResources()
Gets the resources related to the current selection.
|
Style |
getSelectedElementsStyle()
Gets the visualization style to apply to selected elements.
|
SelectionStyle |
getStyle()
Gets the style of the selection frame
drawn around selected calendar cells.
|
void |
remove(DateTime date)
Removes the specified date from the selection.
|
void |
remove(DateTime start,
DateTime end)
Removes the specified date range from the selection.
|
void |
removeChangeListener(ChangeListener listener)
Removes the specified
ChangeListener from the selection. |
void |
reset()
Clears the selection.
|
void |
restore(SelectionState state)
Restores a previously saved state.
|
SelectionState |
save()
Saves the current selection state.
|
void |
set(DateTime date)
Selects the specified date cell.
|
void |
set(DateTime start,
DateTime end)
Selects a range of date cells.
|
void |
set(DateTime start,
DateTime end,
Resource resource)
Selects a range of date cells for a specified resource.
|
void |
set(DateTime start,
DateTime end,
Resource[] resources)
Selects a range of date cells associated with the specified resources.
|
void |
setAllowMultiple(java.lang.Boolean value)
Sets a value indicating whether users are allowed
to select multiple elements at a time.
|
void |
setContinuous(java.lang.Boolean value)
Sets a value indicating whether users can select
only one range of dates in the calendar.
|
void |
setEnabled(java.lang.Boolean value)
Sets a value indicating whether users are allowed
to select any cells in the calendar.
|
void |
setSelectedElementsStyle(Style value)
Sets the visualization style to apply to selected elements.
|
void |
setStyle(SelectionStyle value)
Sets the style of the selection frame
drawn around selected calendar cells.
|
public SelectionState save()
SelectionState
object representing the current selection state.public void restore(SelectionState state)
state
- A previously saved selection state.public void set(DateTime date)
date
- A date whose calendar cell to select.public void set(DateTime start, DateTime end)
start
- Specifies the first date in the range.end
- Specifies the last date in the range.public void set(DateTime start, DateTime end, Resource resource)
Either all of the parameters contact, resource, location and task must be set to null or only one of them should be a non-null reference.
start
- Specifies the first date in the range.end
- Specifies the last date in the range.resource
- A reference to a Resource
to associate the selection with.public void set(DateTime start, DateTime end, Resource[] resources)
start
- Specifies the first date in the range.end
- Specifies the last date in the range.resources
- The resources associated with the specified interval.public void add(DateTime date)
date
- The date to be added to the selection.public void add(DateTime start, DateTime end)
start
- The start of the time range to be added to the selection.end
- The end of the time range to be added to the selection.public void add(DateTime start, DateTime end, Resource resource)
Either all of the parameters contact, resource, location and task must be set to null or only one of them should be a non-null reference.
start
- The start of the time range to be added to the selection.end
- The end of the time range to be added to the selection.resource
- A reference to a Resource
to associate the selection with.public void add(DateTime start, DateTime end, Resource[] resources)
start
- The start of the time range to be added to the selection.end
- The end of the time range to be added to the selection.resources
- The resources associated with the specified interval.public void remove(DateTime date)
date
- The date to be removed from the selection.public void remove(DateTime start, DateTime end)
start
- The start of the time range to be removed from the selection.end
- The end of the time range to be removed from the selection.public boolean contains(DateTime date)
date
- A date to search for in the selection.public boolean containsDay(DateTime date)
date
- A DateTime
instance specifying the day to check.public void reset()
public Style getSelectedElementsStyle()
Style
object specifying the style applied
to selected calendar cells. This cannot be null.public void setSelectedElementsStyle(Style value)
value
- A Style
object specifying the style applied
to selected calendar cells. This cannot be null.public boolean getIsEmpty()
public java.util.List<DateTime> getRanges()
DateTime
objects, sorted chronologically.
Each pair in the collection represents a selected time range.public java.util.List<DateTime> getDayRanges()
DateTime
objects, sorted chronologically.
Each pair in the collection represents an interval of selected days.
Any attempt to modify this connection will result in an exception.
List
class containing even number
of DateTime
objects.public java.lang.Boolean getAllowMultiple()
public void setAllowMultiple(java.lang.Boolean value)
value
- true to allow multiple selection; otherwise, false.
Set to null to use the corresponding value from the current theme.public java.lang.Boolean getContinuous()
public void setContinuous(java.lang.Boolean value)
value
- true to prevent users from selecting more than one,
continuous range of dates in the component; otherwise, false.
Set to null to use the corresponding value from the current theme.public java.lang.Boolean getEnabled()
public void setEnabled(java.lang.Boolean value)
value
- true if users are allowed to select calendar cells; otherwise, false.
Set to null to use the corresponding value from the current theme.public SelectionStyle getStyle()
SelectionStyle
constants.public void setStyle(SelectionStyle value)
value
- One of the SelectionStyle
constants.
Set to null to use the corresponding value from the current theme.public Resource getResource()
public Resource[] getResources()
This property is relevant in Resource
view
with enabled multiple grouping.
public void addChangeListener(ChangeListener listener)
ChangeListener
to the selection.listener
- The ChangeListener
to be added.public void removeChangeListener(ChangeListener listener)
ChangeListener
from the selection.listener
- The listener to be removed.