: Download: FAQ: Licensing: Support: Contact ME
LwVCL Home
Introduction
Overview
Screen Shots
On-line Demos
Requirements
Further Plans
Docs
Tutorial
How-to (PDF)
API
FAQ
Download
Latest version

Home > J2SE > API

Overview  Package   Class  Tree  Deprecated  Index  Help 

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 you to customize grid cells editing process. A grid component uses the interface to organize editing cells data. Actually there are two actions:

  • Start editing process. For the purpose the grid component calls firstly the shouldStartEdit method to test if the specified event performs editing and after that the getEditor method is executed to build an editor component for the specified cell and the data model value.
  • Stop editing process. For the purpose the grid component calls the fetchEditedValue method to get an edited value from the editor component. The value is used to update appropriate data model value.


Method Summary
 java.lang.Object fetchEditedValue(int row, int col, java.lang.Object data, 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, LwVCLEvent 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,
                                         java.lang.Object data,
                                         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,
                               LwVCLEvent 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.


: up