public abstract class SpreadsheetCellEditor extends Object
SpreadsheetCellType and
SpreadsheetCell in order to control how each value will be entered. SpreadsheetCell.setEditable(boolean) ). SpreadsheetView.
It will just be given a value, and it will just give back another one after.
The policy regarding validation of a given value is defined in
SpreadsheetCellType.match(Object).
If the value doesn't meet the requirements when saving the cell, nothing
happens and the editor keeps editing. SpreadsheetCellEditor. Here are their properties: SpreadsheetCellEditor.StringEditor: Basic TextField, can accept all data and
save it as a string.SpreadsheetCellEditor.ListEditor: Display a ComboBox with the different values.
SpreadsheetCellEditor.DoubleEditor: Display a TextField which accepts only
double value. If the entered value is incorrect, the background will turn red
so that the user will know in advance if the data will be saved or not.SpreadsheetCellEditor.IntegerEditor: Display a TextField which accepts only
Integer value. If the entered value is incorrect, the background will turn red
so that the user will know in advance if the data will be saved or not.SpreadsheetCellEditor.DateEditor: Display a DatePicker.SpreadsheetCellEditor.ObjectEditor: Display a TextField , accept an Object.SpreadsheetCellEditor for displaying other controls.SpreadsheetView when needed.
startEdit(Object): You will configure your control with the
given value which is SpreadsheetCell.getItem() converted to an
object. You do not instantiate your control here, you do it in the
constructor.getEditor(): You will return which control you're using (for
display).getControlValue(): You will return the value inside your editor
in order to submit it for validation.end(): When editing is finished, you can properly close your own
control.endEdit(boolean) where
a true value means you want to commit, and a false means you
want to cancel. The SpreadsheetView will handle all the rest for you
and call your methods at the right moment. 
| String | ![]() |
| List | ![]() |
| Double | ![]() |
| Date | ![]() |
SpreadsheetView,
SpreadsheetCell,
SpreadsheetCellType| Modifier and Type | Class and Description |
|---|---|
static class |
SpreadsheetCellEditor.DateEditor
A
SpreadsheetCellEditor for SpreadsheetCellType.DateType
typed cells. |
static class |
SpreadsheetCellEditor.DoubleEditor
A
SpreadsheetCellEditor for
SpreadsheetCellType.DoubleType typed cells. |
static class |
SpreadsheetCellEditor.IntegerEditor
A
SpreadsheetCellEditor for
SpreadsheetCellType.DoubleType typed cells. |
static class |
SpreadsheetCellEditor.ListEditor<R>
A
SpreadsheetCellEditor for SpreadsheetCellType.ListType
typed cells. |
static class |
SpreadsheetCellEditor.ObjectEditor
A
SpreadsheetCellEditor for
SpreadsheetCellType.ObjectType typed cells. |
static class |
SpreadsheetCellEditor.StringEditor
A
SpreadsheetCellEditor for
SpreadsheetCellType.StringType typed cells. |
| Constructor and Description |
|---|
SpreadsheetCellEditor(SpreadsheetView view)
Construct the SpreadsheetCellEditor.
|
| Modifier and Type | Method and Description |
|---|---|
abstract void |
end()
This method will be called at the end of edition.
You will be offered the possibility to do the configuration post editing. |
void |
endEdit(boolean b)
Whenever you want to stop the edition, you call that method.
True means you're trying to commit the value, then SpreadsheetCellType.convertValue(Object) will be called in order
to verify that the value is correct.False means you're trying to cancel the value and it will be follow by end().See SpreadsheetCellEditor description |
abstract String |
getControlValue()
Return the value within your editor as a string.
|
abstract Control |
getEditor()
Return the control used for controlling the input.
|
abstract void |
startEdit(Object item)
This method will be called when edition start.
You will then do all the configuration of your editor. |
public SpreadsheetCellEditor(SpreadsheetView view)
view - public final void endEdit(boolean b)
SpreadsheetCellType.convertValue(Object) will be called in order
to verify that the value is correct.end().b - true means commit, false means cancelpublic abstract void startEdit(Object item)
item - public abstract Control getEditor()
public abstract String getControlValue()
SpreadsheetCellType.convertValue(Object) in order to compute
whether the value is valid regarding the SpreadsheetCellType
policy.public abstract void end()