Back to index

wims  3.65+svn20090927
Public Member Functions | Private Attributes
SharpTools.SharpCellEditor Class Reference

This is the only editor for the SharpTableModel because it is the only cell object editor. More...

Collaboration diagram for SharpTools.SharpCellEditor:
Collaboration graph

List of all members.

Public Member Functions

 SharpCellEditor (final JTextField textField)
 Creates new SharpCellEditor.
JTextField getTextField ()
 get the component used by this editor

Private Attributes

JTextField textField
 the JTextField object this editor uses

Detailed Description

This is the only editor for the SharpTableModel because it is the only cell object editor.

The only special feature is that it displays the formula string of a formula cell when cell is being edited. It inherits all methods of the DefaultCellEditor.

Ricky Chin

Definition at line 19 of file

Constructor & Destructor Documentation

SharpTools.SharpCellEditor.SharpCellEditor ( final JTextField  textField) [inline]

Creates new SharpCellEditor.

textFielda JtextField object

Definition at line 30 of file

       this.textField = textField;

        /* To account for formula feature only need
         * to override the setValue method in EditorDelegate inner
         * class.
        delegate = new EditorDelegate() {
            public void setValue(Object value) {
              if (value instanceof Cell) {
                    Cell temp = (Cell)value;
                    /* when editing formula cell
                     * a string representation is displayed
                    if (temp.isFormula()) {
                        textField.setText("=" + temp.getFormula().toString());
                    else {
                        //otherwise it is just the normal string conversion
                else {
                    //empty cells display nothing
                    textField.setText((value == null) ? "" : value.toString());


           public Object getCellEditorValue() {
              return textField.getText();

Here is the call graph for this function:

Member Function Documentation

JTextField SharpTools.SharpCellEditor.getTextField ( ) [inline]

get the component used by this editor

the JTextField used by this editor

Definition at line 73 of file

{ return textField; }

Member Data Documentation

the JTextField object this editor uses

Definition at line 23 of file

The documentation for this class was generated from the following file: