Adempiere 3.5.2a

org.compiere.grid.ed
Class VCellEditor

java.lang.Object
  extended by javax.swing.AbstractCellEditor
      extended by org.compiere.grid.ed.VCellEditor
All Implemented Interfaces:
ActionListener, VetoableChangeListener, Serializable, EventListener, CellEditor, TableCellEditor

public final class VCellEditor
extends AbstractCellEditor
implements TableCellEditor, VetoableChangeListener, ActionListener

Cell Editor.

                Sequence of events:
                        isCellEditable
                        getTableCellEditor
                        shouldSelectCell
                        getCellEditorValue
  
A new Editor is created for editable columns.

Version:
$Id: VCellEditor.java,v 1.2 2006/07/30 00:51:28 jjanke Exp $
Author:
Jorg Janke
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.AbstractCellEditor
changeEvent, listenerList
 
Constructor Summary
VCellEditor(GridField mField)
          Constructor for Grid
 
Method Summary
 void actionPerformed(ActionEvent e)
          Action Editor - Stop Editor
 void cancelCellEditing()
           
 void dispose()
          Dispose
 Object getCellEditorValue()
          Returns the value contained in the editor
 VEditor getEditor()
          Get Actual Editor.
 Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int col)
          Sets an initial value for the editor.
 boolean isCellEditable(EventObject anEvent)
          Ask the editor if it can start editing using anEvent.
 void setActionListener(ActionListener listener)
           
 boolean shouldSelectCell(EventObject e)
          The editing cell should be selected or not
 boolean stopCellEditing()
           
 void vetoableChange(PropertyChangeEvent e)
          VEditor Change Listener (property name is columnName)
 
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

VCellEditor

public VCellEditor(GridField mField)
Constructor for Grid

Parameters:
mField -
Method Detail

isCellEditable

public boolean isCellEditable(EventObject anEvent)
Ask the editor if it can start editing using anEvent. If editing can be started this method returns true. Previously called: MTable.isCellEditable

Specified by:
isCellEditable in interface CellEditor
Overrides:
isCellEditable in class AbstractCellEditor
Parameters:
anEvent - event
Returns:
true if editable

getTableCellEditorComponent

public Component getTableCellEditorComponent(JTable table,
                                             Object value,
                                             boolean isSelected,
                                             int row,
                                             int col)
Sets an initial value for the editor. This will cause the editor to stopEditing and lose any partially edited value if the editor is editing when this method is called. Returns the component that should be added to the client's Component hierarchy. Once installed in the client's hierarchy this component will then be able to draw and receive user input.

Specified by:
getTableCellEditorComponent in interface TableCellEditor
Parameters:
table -
value -
isSelected -
row -
col -
Returns:
component

shouldSelectCell

public boolean shouldSelectCell(EventObject e)
The editing cell should be selected or not

Specified by:
shouldSelectCell in interface CellEditor
Overrides:
shouldSelectCell in class AbstractCellEditor
Parameters:
e - event
Returns:
true (constant)

getCellEditorValue

public Object getCellEditorValue()
Returns the value contained in the editor

Specified by:
getCellEditorValue in interface CellEditor
Returns:
value

vetoableChange

public void vetoableChange(PropertyChangeEvent e)
VEditor Change Listener (property name is columnName). - indicate change (for String/Text/..)
When editing is complete the value is retrieved via getCellEditorValue

Specified by:
vetoableChange in interface VetoableChangeListener
Parameters:
e - event

getEditor

public VEditor getEditor()
Get Actual Editor. Called from GridController to add ActionListener to Button

Returns:
VEditor

actionPerformed

public void actionPerformed(ActionEvent e)
Action Editor - Stop Editor

Specified by:
actionPerformed in interface ActionListener
Parameters:
e - event

dispose

public void dispose()
Dispose


stopCellEditing

public boolean stopCellEditing()
Specified by:
stopCellEditing in interface CellEditor
Overrides:
stopCellEditing in class AbstractCellEditor

cancelCellEditing

public void cancelCellEditing()
Specified by:
cancelCellEditing in interface CellEditor
Overrides:
cancelCellEditing in class AbstractCellEditor

setActionListener

public void setActionListener(ActionListener listener)

Adempiere 3.5.2a

Adempiere® is a registered trademark of ADempiere Business Inc. ©2004-2008 HumanFlash.com All rights reserved.