sos.reports
Interface ElementEditor

All Superinterfaces:
javax.swing.CellEditor
All Known Implementing Classes:
DefaultElementEditor

public interface ElementEditor
extends javax.swing.CellEditor

An object that controls the editing of a report element. It is essentially used the same way TableCellEditor is used with javax.swing.JTable; however, there are a few differences. First, unlike TableCellEditor, an ElementEditor has the ability to position the editor component in the report pane. To do this, it must use a JComponent, invoke setBounds on the component, and ensure that the client property POSITIONED is set to Boolean.TRUE. If the component is not positioned, the report pane will position it on top of the element being edited. Second, an ElementEditor can provide the report pane with an editing "hint," which appears when the mouse is over the element in the report pane. This mouse-over component is installed in the report pane and hence receives all events. An ElementEditor is not required to provide a mouse-over hint. If it does, it may position the component, as long as it sets the client property POSITIONED to Boolean.TRUE.

Since:
1.0
See Also:
ElementRenderer, JReportPane.getEditor(), ReportEditorModel.getEditor(sos.reports.Element), DefaultElementEditor

Field Summary
static java.lang.String POSITIONED
          A property key used to indicate that an editor component has been positioned by the editor and should not be positioned by the report pane.
 
Method Summary
 java.awt.Component getElementEditorComponent(JReportPane reportPane, Element element)
          Returns the component that should be added to the client's component hierarchy in order to edit the specified element in the specified report pane.
 java.awt.Component getMouseOverComponent(JReportPane reportPane, Element element)
          Returns a component (or null, if none) that provides a hint or shortcut to editing the specified element in the specified report pane.
 
Methods inherited from interface javax.swing.CellEditor
addCellEditorListener, cancelCellEditing, getCellEditorValue, isCellEditable, removeCellEditorListener, shouldSelectCell, stopCellEditing
 

Field Detail

POSITIONED

public static final java.lang.String POSITIONED
A property key used to indicate that an editor component has been positioned by the editor and should not be positioned by the report pane.

See Also:
Constant Field Values
Method Detail

getMouseOverComponent

public java.awt.Component getMouseOverComponent(JReportPane reportPane,
                                                Element element)
Returns a component (or null, if none) that provides a hint or shortcut to editing the specified element in the specified report pane. This component is installed in the report pane when the mouse is over the element.

Parameters:
reportPane - report pane that is rendering element
element - the element for which the mouse-over component is requested
Returns:
a component that provides a mouse-over hint or shortcut for element
Throws:
java.lang.NullPointerException - if reportPane or element is null

getElementEditorComponent

public java.awt.Component getElementEditorComponent(JReportPane reportPane,
                                                    Element element)
Returns the component that should be added to the client's component hierarchy in order to edit the specified element in the specified report pane.

Parameters:
reportPane - report pane that is rendering element
element - the element for which the editor component is requested
Returns:
the component for editing
Throws:
java.lang.NullPointerException - if reportPane or element is null


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