|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sos.reports.AbstractReportSelectionModel | +--sos.reports.TemplateReportSelectionModel
A report selection model that bases the selection model on the name of the report template.
TierReportSelectionModel
,
CellReportSelectionModel
,
CompositeReportSelectionModel
Constructor Summary | |
TemplateReportSelectionModel()
Creates an empty TemplateReportSelectionModel . |
|
TemplateReportSelectionModel(java.lang.String templateName,
ReportSelectionModel selectionModel)
Creates an instance of TemplateReportSelectionModel with an
initial selection model mapping. |
Method Summary | |
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 |
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. |
void |
setTemplateSelectionModel(java.lang.String templateName,
ReportSelectionModel selectionModel)
Associates the specified selection model to the specified template name. |
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 TemplateReportSelectionModel()
TemplateReportSelectionModel
. Use
setTemplateSelectionModel
to add selection models.
TemplateReportSelectionModel(String,ReportSelectionModel)
,
setTemplateSelectionModel(java.lang.String, sos.reports.ReportSelectionModel)
public TemplateReportSelectionModel(java.lang.String templateName, ReportSelectionModel selectionModel)
TemplateReportSelectionModel
with an
initial selection model mapping.
templateName
- name of the template for which to use selectionModel
selectionModel
- selection model to use if an element corresponding
to a report generated by a template named templateName
is being selectedMethod Detail |
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 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 setTemplateSelectionModel(java.lang.String templateName, ReportSelectionModel selectionModel)
templateName
, this selection model
will use selectionModel
. A null
selectionModel
unassociates any selection model from the template name.
templateName
- name of the template for which to use selectionModel
selectionModel
- selection model to use if an element corresponding
to a report generated by a template named templateName
is being selectedpublic 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 |