sos.reports
Class DefaultReportEditorModel

java.lang.Object
  |
  +--sos.reports.AbstractReportEditorModel
        |
        +--sos.reports.DefaultReportEditorModel
All Implemented Interfaces:
ReportEditorModel

public class DefaultReportEditorModel
extends AbstractReportEditorModel
implements ReportEditorModel

A report editor model in which editors are associated with classes. When asked to edit an element, this class uses the class of the element's object to determine the editor. If the object is null, it uses the element's prototype object to determine the edior.

Since:
1.0

Constructor Summary
DefaultReportEditorModel()
          Creates an instance of DefaultReportEditorModel.
 
Method Summary
 ElementEditor getClassEditor(java.lang.Class theClass)
          Returns the editor associated with the specified class, or null, if there is no editor.
 ElementEditor getEditor(Element element)
          Returns the editor that can edit the specified element, or null, if the element cannot be edited.
 void setClassEditor(java.lang.Class editableClass, ElementEditor editor)
          Sets the editor for the specified class.
 
Methods inherited from class sos.reports.AbstractReportEditorModel
reportChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface sos.reports.ReportEditorModel
reportChanged
 

Constructor Detail

DefaultReportEditorModel

public DefaultReportEditorModel()
Creates an instance of DefaultReportEditorModel.

Method Detail

getClassEditor

public ElementEditor getClassEditor(java.lang.Class theClass)
Returns the editor associated with the specified class, or null, if there is no editor.

Parameters:
theClass - the class for which the editor is requested
Returns:
the editor associated with theClass, or null, if none
Throws:
java.lang.NullPointerException - if theClass is null

getEditor

public ElementEditor getEditor(Element element)
Description copied from interface: ReportEditorModel
Returns the editor that can edit the specified element, or null, if the element cannot be edited.

Specified by:
getEditor in interface ReportEditorModel
Parameters:
element - report element to be edited
Returns:
an editor to edit element, or null

setClassEditor

public void setClassEditor(java.lang.Class editableClass,
                           ElementEditor editor)
Sets the editor for the specified class. If editor is null, it removes the editor for the specified class.

Parameters:
editableClass - class for which the editor should be used
editor - editor to edit instances of editableClass
Throws:
java.lang.NullPointerException - if editableClass is null


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