sos.reports
Class TierReportEditorModel

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

public class TierReportEditorModel
extends java.lang.Object
implements ReportEditorModel

A report editor model that uses editors that are registered with the row or column in which the element resides.

Since:
1.0
See Also:
DefaultReportEditorModel, TemplateReportEditorModel

Constructor Summary
TierReportEditorModel(int tierType)
          Creates an instance of TierReportEditorModel for the specified tier type with headers and footers not editable.
TierReportEditorModel(int tierType, boolean headerEditable, boolean footerEditable)
          Creates an instance of TierReportEditorModel for the specified tier type where the editability of headers and footers are specified.
 
Method Summary
 ElementEditor getEditor(Element element)
          Returns the editor that can edit the specified element, or null, if the element cannot be edited.
 ElementEditor getTierEditor(int tierIndex)
          Returns the editor associated with the specified tier, or null, if there is no editor.
 boolean isFooterEditable()
          Returns true elements residing in a footer tier are editable.
 boolean isHeaderEditable()
          Returns true elements residing in a header tier are editable.
 void reportChanged(ReportEvent event)
          Updates itself (if necessary) as a result of a report modification.
 void setFooterEditable(boolean editable)
          Specifies if elements residing in footer tiers are editable.
 void setHeaderEditable(boolean editable)
          Specifies if elements residing in header tiers are editable.
 void setTierEditor(int tierIndex, ElementEditor editor)
          Sets the editor to use for elements residing in the specified tier.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TierReportEditorModel

public TierReportEditorModel(int tierType)
Creates an instance of TierReportEditorModel for the specified tier type with headers and footers not editable.

Parameters:
tierType - the type of tiers whose cell contents are editable
Throws:
java.lang.IllegalArgumentException - if tierType is not TableElement.ROW or TableElement.COLUMN
See Also:
TierReportEditorModel(int,boolean,boolean)

TierReportEditorModel

public TierReportEditorModel(int tierType,
                             boolean headerEditable,
                             boolean footerEditable)
Creates an instance of TierReportEditorModel for the specified tier type where the editability of headers and footers are specified.

Parameters:
tierType - the type of tiers whose cell contents are editable
headerEditable - if header cells are editable
footerEditable - if footer cells are editable
Throws:
java.lang.IllegalArgumentException - if tierType is not TableElement.ROW or TableElement.COLUMN
Method Detail

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

getTierEditor

public ElementEditor getTierEditor(int tierIndex)
Returns the editor associated with the specified tier, or null, if there is no editor.

Parameters:
tierIndex - index of row or column for which to fetch the registered editor
Throws:
java.lang.IllegalArgumentException - if tierIndex < 0
See Also:
setTierEditor(int, sos.reports.ElementEditor)

isHeaderEditable

public boolean isHeaderEditable()
Returns true elements residing in a header tier are editable.

Returns:
true if elements in a header tier are editable
See Also:
setHeaderEditable(boolean)

isFooterEditable

public boolean isFooterEditable()
Returns true elements residing in a footer tier are editable.

Returns:
true if elements in a footer tier are editable
See Also:
setFooterEditable(boolean)

reportChanged

public void reportChanged(ReportEvent event)
Description copied from interface: ReportEditorModel
Updates itself (if necessary) as a result of a report modification.

Specified by:
reportChanged in interface ReportEditorModel
Parameters:
event - the event describing how the report has changed

setFooterEditable

public void setFooterEditable(boolean editable)
Specifies if elements residing in footer tiers are editable.

Parameters:
editable - true if elements in footer tiers can be edited
See Also:
isFooterEditable()

setHeaderEditable

public void setHeaderEditable(boolean editable)
Specifies if elements residing in header tiers are editable.

Parameters:
editable - true if elements in header tiers can be edited
See Also:
isHeaderEditable()

setTierEditor

public void setTierEditor(int tierIndex,
                          ElementEditor editor)
Sets the editor to use for elements residing in the specified tier. If editor is null, the editor is unset for the specified tier.

Parameters:
tierIndex - index of row or column for which to set the editor
editor - editor to use for elements residing in tier tierIndex
Throws:
java.lang.IllegalArgumentException - if tierIndex < 0
See Also:
getTierEditor(int)


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