sos.reports
Class AbstractReport

java.lang.Object
  |
  +--sos.reports.AbstractReport
All Implemented Interfaces:
Report, java.io.Serializable

public abstract class AbstractReport
extends java.lang.Object
implements Report, java.io.Serializable

A partial implementation of the Report interface.

This class always returns false from isElementEditable and always throws UnsupportedOperationException in setObject. Subclasses that wish to allow the editing of elements should reimplement these methods accordingly.

Since:
1.0

Nested Class Summary
 class AbstractReport.AbstractCellElement
          A partial implementation of CellElement.
protected  class AbstractReport.AbstractElement
          A partial implementation of an Element.
protected  class AbstractReport.AbstractObjectElement
          A partial implementation of ObjectElement.
protected  class AbstractReport.AbstractTableElement
          A partial implementation of TableElement.
 class AbstractReport.AbstractTierElement
          A partial implementation of TierElement.
protected  class AbstractReport.DefaultObjectElement
          A default implementation of ObjectElement.
protected  class AbstractReport.DefaultTableElement
          A default implementation of TableElement that stores cells in lists of lists.
 
Constructor Summary
  AbstractReport()
          Creates an instance of AbstractReport with an empty theme.
protected AbstractReport(Theme theme)
          Creates an instance of AbstractReport with the specified theme.
 
Method Summary
 void addReportListener(ReportListener listener)
          Adds the specified ReportListener to this report.
protected  void fireContentChanged(Element element)
          Notifies registered listeners that the specified element's object has changed.
protected  void fireContentChanged(java.util.Set updatedElements)
          Notifies registered listeners that the objects of the elements in the specified set have changed.
protected  void fireReportEvent(ReportEvent event)
          Notifies registered listeners of the specified event.
protected  void fireStyleContextChanged()
          Notifies registered listeners that the underlying style context has changed.
 ReportTemplate getTemplate()
          Returns the report template for which this report was generated, or null if no template was used.
 Theme getTheme()
          Returns the theme controlling the appearance of this report.
 boolean isElementEditable(Element element)
          Returns true if this report supports the modification of the specified report element.
 void removeReportListener(ReportListener listener)
          Removes the specified ReportListener from this report.
 void setObject(Element element, java.lang.Object object)
          Sets the specified element's object to object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface sos.reports.Report
getRootElement
 

Constructor Detail

AbstractReport

public AbstractReport()
Creates an instance of AbstractReport with an empty theme.

See Also:
AbstractReport(Theme)

AbstractReport

protected AbstractReport(Theme theme)
Creates an instance of AbstractReport with the specified theme.

Parameters:
theme - this report's theme
Method Detail

fireReportEvent

protected void fireReportEvent(ReportEvent event)
Notifies registered listeners of the specified event.

Parameters:
event - event describing the change in the report

fireContentChanged

protected void fireContentChanged(Element element)
Notifies registered listeners that the specified element's object has changed.

Parameters:
element - whose object has changed
See Also:
fireContentChanged(Set)

fireContentChanged

protected void fireContentChanged(java.util.Set updatedElements)
Notifies registered listeners that the objects of the elements in the specified set have changed.

Parameters:
updatedElements - elements whose objects have changed
See Also:
fireContentChanged(Element)

fireStyleContextChanged

protected void fireStyleContextChanged()
Notifies registered listeners that the underlying style context has changed.


getTheme

public Theme getTheme()
Description copied from interface: Report
Returns the theme controlling the appearance of this report.

Specified by:
getTheme in interface Report
Returns:
this report's theme

getTemplate

public ReportTemplate getTemplate()
Description copied from interface: Report
Returns the report template for which this report was generated, or null if no template was used.

Specified by:
getTemplate in interface Report
Returns:
the report template that generated this report (may be null)

addReportListener

public void addReportListener(ReportListener listener)
Description copied from interface: Report
Adds the specified ReportListener to this report.

Specified by:
addReportListener in interface Report
Parameters:
listener - object that wishes to be notified when this report fires a ReportEvent

removeReportListener

public void removeReportListener(ReportListener listener)
Description copied from interface: Report
Removes the specified ReportListener from this report.

Specified by:
removeReportListener in interface Report
Parameters:
listener - object that no longer wishes to be notified when this report fires a ReportEvent

isElementEditable

public boolean isElementEditable(Element element)
Description copied from interface: Report
Returns true if this report supports the modification of the specified report element.

Specified by:
isElementEditable in interface Report
Parameters:
element - the report element in question
Returns:
true if element can be modified; false otherwise

setObject

public void setObject(Element element,
                      java.lang.Object object)
Description copied from interface: Report
Sets the specified element's object to object.

Specified by:
setObject in interface Report
Parameters:
element - the report element to associate with object
object - the object to associate with element


Copyright 2003, 2004 Side of Software (SOS). All rights reserved.