org.zaval.lw.grid
Interface LwEditorProvider

All Known Implementing Classes:
LwDefEditors

public interface LwEditorProvider

This interface is used to provide an editor component for the specified grid cell, it allows to customize grid cells editing process. A grid component uses the interface to organize editing cells data. Actually there are two actions:


Method Summary
 java.lang.Object fetchEditedValue(int row, int col, LwComponent c)
          Fetches the value from the editor component of the specified cell.
 LwComponent getEditor(int row, int col, java.lang.Object o)
          Gets the editor component for the specified cell and the given data model value.
 boolean shouldStartEdit(int row, int col, LwAWTEvent e)
          Tests if the specified event should perform editing process for the specified cell.
 

Method Detail

getEditor

public LwComponent getEditor(int row,
                             int col,
                             java.lang.Object o)
Gets the editor component for the specified cell and the given data model value. The method can return null if the cell has not an appropriate editor component. In this case the editing process will not be initiated.
Parameters:
row - the specified cell row.
col - the specified cell column.
o - the specified data model value for the grid cell.
Returns:
an editor component.

fetchEditedValue

public java.lang.Object fetchEditedValue(int row,
                                         int col,
                                         LwComponent c)
Fetches the value from the editor component of the specified cell. The returned value will be used to update appropriate grid data model value.
Parameters:
row - the specified cell row.
col - the specified cell column.
c - the specified component editor that has been used to edit the cell value.
Returns:
a value to update the grid data model.

shouldStartEdit

public boolean shouldStartEdit(int row,
                               int col,
                               LwAWTEvent e)
Tests if the specified event should perform editing process for the specified cell.
Parameters:
row - the specified cell row.
col - the specified cell column.
e - the specified event.
Returns:
true if the editing process should be performed; otherwise false.


Copyright © Zaval Creative Engineering Group, 2000-2005.
http://www.zaval.org