|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--javax.swing.AbstractCellEditor
|
+--sos.reports.DefaultElementEditor
An element editor that can adapt a JComboBox, JTextField,
or a JCheckBox to be an editor.
| Field Summary |
| Fields inherited from class javax.swing.AbstractCellEditor |
changeEvent, listenerList |
| Fields inherited from interface sos.reports.ElementEditor |
POSITIONED |
| Constructor Summary | |
DefaultElementEditor(javax.swing.JCheckBox checkBox)
Creates an instance of DefaultElementEditor
that uses the specified checkbox as the editor component. |
|
DefaultElementEditor(javax.swing.JComboBox comboBox)
Creates an instance of DefaultElementEditor
that uses the specified combobox as the editor component. |
|
DefaultElementEditor(javax.swing.JTextField textField)
Creates an instance of DefaultElementEditor
that uses the specified text field as the editor component. |
|
| Method Summary | |
void |
cancelCellEditing()
Tells this editor to cancel editing and not accept any partially edited value. |
java.lang.Object |
getCellEditorValue()
Returns the value contained in the editor. |
int |
getClickCountToStart()
Returns the number of clicks needed to start editing. |
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. |
boolean |
isCellEditable(java.util.EventObject anEvent)
Asks this editor if it can start editing using anEvent. |
boolean |
isMouseOverEnabled()
Returns true if this editor shows mouse-over hints. |
void |
setClickCountToStart(int count)
Specifies the number of clicks needed to start editing. |
void |
setMouseOverEnabled(boolean mouseOverEnabled)
Sets whether or not this editor shows mouse-over hints. |
boolean |
shouldSelectCell(java.util.EventObject anEvent)
Returns true if the editing cell should be selected,
false otherwise. |
boolean |
stopCellEditing()
Tells this editor to stop editing and accept any partially edited value as the value of the editor. |
| Methods inherited from class javax.swing.AbstractCellEditor |
addCellEditorListener, fireEditingCanceled, fireEditingStopped, getCellEditorListeners, removeCellEditorListener |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.swing.CellEditor |
addCellEditorListener, removeCellEditorListener |
| Constructor Detail |
public DefaultElementEditor(javax.swing.JComboBox comboBox)
DefaultElementEditor
that uses the specified combobox as the editor component.
comboBox - the editor componentpublic DefaultElementEditor(javax.swing.JTextField textField)
DefaultElementEditor
that uses the specified text field as the editor component.
textField - the editor componentpublic DefaultElementEditor(javax.swing.JCheckBox checkBox)
DefaultElementEditor
that uses the specified checkbox as the editor component.
checkBox - the editor component| Method Detail |
public void cancelCellEditing()
cancelCellEditing in interface javax.swing.CellEditorcancelCellEditing in class javax.swing.AbstractCellEditorpublic java.lang.Object getCellEditorValue()
getCellEditorValue in interface javax.swing.CellEditorpublic int getClickCountToStart()
setClickCountToStart(int)
public java.awt.Component getMouseOverComponent(JReportPane reportPane,
Element element)
ElementEditornull, 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.
getMouseOverComponent in interface ElementEditorreportPane - report pane that is rendering elementelement - the element for which the mouse-over component is requested
element
public java.awt.Component getElementEditorComponent(JReportPane reportPane,
Element element)
ElementEditor
getElementEditorComponent in interface ElementEditorreportPane - report pane that is rendering elementelement - the element for which the editor component is requested
public boolean isCellEditable(java.util.EventObject anEvent)
anEvent.
anEvent is in the invoking component coordinate system.
If editing can be started this method returns true.
isCellEditable in interface javax.swing.CellEditorisCellEditable in class javax.swing.AbstractCellEditoranEvent - the event the editor should use to consider
whether to begin editing or not
true if editing can be startedpublic boolean isMouseOverEnabled()
true if this editor shows mouse-over hints.
setMouseOverEnabled(boolean)public void setMouseOverEnabled(boolean mouseOverEnabled)
mouseOverEnabled - true if this editor should show
mouse-over hintsisMouseOverEnabled()public void setClickCountToStart(int count)
count - the number of clicks needed to start editinggetClickCountToStart()public boolean shouldSelectCell(java.util.EventObject anEvent)
true if the editing cell should be selected,
false otherwise.
Typically, the return value is true, because in most cases the editing
cell should be selected. However, it is useful to return false to
keep the selection from changing for some types of edits.
eg. In a report that contains a column of check boxes, the user might
want to be able to change those checkboxes without altering the
selection.
shouldSelectCell in interface javax.swing.CellEditorshouldSelectCell in class javax.swing.AbstractCellEditoranEvent - the event the editor should use to start
editing
true if the editor would like the editing cell to be selected;
otherwise returns falseisCellEditable(java.util.EventObject)public boolean stopCellEditing()
false if
editing was not stopped; this is useful for editors that validate
and cannot accept invalid entries.
stopCellEditing in interface javax.swing.CellEditorstopCellEditing in class javax.swing.AbstractCellEditortrue if editing was stopped; false otherwise
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||