|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sos.reports.AbstractReportSelectionModel | +--sos.reports.CompositeReportSelectionModel
A report selection model that combines a number of selection models into one. It gives precedence first to the model handling the selection and then to the list of selection models (in the order they were added).
TierReportSelectionModel
,
CellReportSelectionModel
,
TemplateReportSelectionModel
Constructor Summary | |
CompositeReportSelectionModel()
Creates an empty CompositeReportSelectionModel . |
|
CompositeReportSelectionModel(java.util.List selectionModels)
Creates a CompositeReportSelectionModel with the specified array
of selection models. |
|
CompositeReportSelectionModel(ReportSelectionModel[] selectionModels)
Creates a CompositeReportSelectionModel with the specified array
of selection models. |
Method Summary | |
void |
addSelectionModel(ReportSelectionModel selectionModel)
Appends the specified selection model to this model's collection. |
boolean |
canSelect(Element element,
boolean toggle,
boolean extend)
Returns true if the specified element is selectable given the current selection and the state of toggle and extend . |
void |
clearSelection()
Clears the current selection, if any. |
Element |
getAnchorSelectionElement()
Returns the element passed to the last successful invocation of select
with the extend paramter set to false . |
Element |
getLeadSelectionElement()
Returns the element passed to the last successful invocation of select . |
java.util.Set |
getSelectedElements()
Returns the set of selected elements. |
boolean |
isSelected(Element element)
Returns true if the specified element is selected. |
void |
removeSelectionModel(ReportSelectionModel selectionModel)
Removes the specified selection model from this model's collection. |
void |
reportChanged(ReportEvent event)
Updates itself (if necessary) as a result of a report modification. |
void |
select(Element element,
boolean toggle,
boolean extend)
Changes the selection. |
void |
setAnchorSelectionElement(Element element)
Sets the anchor selection element. |
void |
setLeadSelectionElement(Element element)
Sets the lead selection element. |
void |
setSelectedElements(java.util.Set elements)
Sets the selection to the report elements in the specified set. |
Methods inherited from class sos.reports.AbstractReportSelectionModel |
addReportSelectionListener, fireSelectionChanged, fireSelectionChanged, fireSelectionChanged, getValueIsAdjusting, removeReportSelectionListener, setValueIsAdjusting |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface sos.reports.ReportSelectionModel |
addReportSelectionListener, getValueIsAdjusting, removeReportSelectionListener, setValueIsAdjusting |
Constructor Detail |
public CompositeReportSelectionModel()
CompositeReportSelectionModel
. Use
addSelectionModel
to add selection models.
CompositeReportSelectionModel(ReportSelectionModel[])
,
CompositeReportSelectionModel(List)
,
addSelectionModel(sos.reports.ReportSelectionModel)
public CompositeReportSelectionModel(ReportSelectionModel[] selectionModels)
CompositeReportSelectionModel
with the specified array
of selection models.
selectionModels
- initial selection models
java.lang.NullPointerException
- if selectionModels
is null
or any element of the array is null
CompositeReportSelectionModel(List)
public CompositeReportSelectionModel(java.util.List selectionModels)
CompositeReportSelectionModel
with the specified array
of selection models.
selectionModels
- initial selection models
java.lang.ClassCastException
- if any element of the list is not an instance
of ReportSelectionModel
java.lang.NullPointerException
- if selectionModels
is null
CompositeReportSelectionModel(List)
Method Detail |
public void addSelectionModel(ReportSelectionModel selectionModel)
selectionModel
- selection model to add to this model's collection
java.lang.NullPointerException
- if selectionModel
is null
removeSelectionModel(sos.reports.ReportSelectionModel)
public boolean canSelect(Element element, boolean toggle, boolean extend)
ReportSelectionModel
toggle
and extend
.
A subsequent call to select
with the same arguments will
throw a NotSelectableException
if and only if this invocation returns
false
.
canSelect
in interface ReportSelectionModel
element
- report element on which the selection change is madetoggle
- whether or not the selection should be toggledextend
- whether or not the selection should be extended to include
the specified element
true
if the selection can succeedReportSelectionModel.select(sos.reports.Element, boolean, boolean)
public void clearSelection()
ReportSelectionModel
getSelectedElements
will return an empty set.
clearSelection
in interface ReportSelectionModel
public Element getAnchorSelectionElement()
ReportSelectionModel
select
with the extend
paramter set to false
.
getAnchorSelectionElement
in interface ReportSelectionModel
select
with the extend
paramter set to false
public Element getLeadSelectionElement()
ReportSelectionModel
select
.
getLeadSelectionElement
in interface ReportSelectionModel
select
public java.util.Set getSelectedElements()
ReportSelectionModel
getSelectedElements
in interface ReportSelectionModel
public boolean isSelected(Element element)
ReportSelectionModel
true
if the specified element is selected.
isSelected
in interface ReportSelectionModel
element
- report element in question
true
if element
is in the selectionpublic void removeSelectionModel(ReportSelectionModel selectionModel)
selectionModel
currently holds the selection, the selection
is cleared.
selectionModel
- selection model to remove from this model's collection
java.lang.NullPointerException
- if selectionModel
is null
addSelectionModel(sos.reports.ReportSelectionModel)
public void reportChanged(ReportEvent event)
ReportSelectionModel
reportChanged
in interface ReportSelectionModel
reportChanged
in class AbstractReportSelectionModel
event
- the event describing how the report has changedpublic void select(Element element, boolean toggle, boolean extend) throws NotSelectableException
ReportSelectionModel
select
in interface ReportSelectionModel
element
- report element on which the selection change is madetoggle
- whether or not the selection should be toggledextend
- whether or not the selection should be extended to include
the specified element
NotSelectableException
- if the action cannot be carried out because
one or more of the needed report elements are not selectableReportSelectionModel.canSelect(sos.reports.Element, boolean, boolean)
public void setAnchorSelectionElement(Element element) throws NotSelectableException
ReportSelectionModel
setAnchorSelectionElement
in interface ReportSelectionModel
element
- report element to use as the anchor
NotSelectableException
- if element
is not selectableReportSelectionModel.getAnchorSelectionElement()
public void setLeadSelectionElement(Element element) throws NotSelectableException
ReportSelectionModel
setLeadSelectionElement
in interface ReportSelectionModel
element
- report element to use as the lead anchor
NotSelectableException
- if element
is not selectableReportSelectionModel.getLeadSelectionElement()
public void setSelectedElements(java.util.Set elements) throws NotSelectableException
ReportSelectionModel
setSelectedElements
in interface ReportSelectionModel
elements
- report elements to be selected
NotSelectableException
- if any element in the set is not selectable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |