Package org.compiere.grid.ed
Class VCellEditor
- java.lang.Object
-
- javax.swing.AbstractCellEditor
-
- 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
Constructors Constructor Description VCellEditor(GridField mField)
Constructor for Grid
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(ActionEvent e)
Action Editor - Stop Editorvoid
cancelCellEditing()
void
dispose()
DisposeObject
getCellEditorValue()
Returns the value contained in the editorVEditor
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 notboolean
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 interfaceCellEditor
- Overrides:
isCellEditable
in classAbstractCellEditor
- 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 interfaceTableCellEditor
- 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 interfaceCellEditor
- Overrides:
shouldSelectCell
in classAbstractCellEditor
- Parameters:
e
- event- Returns:
- true (constant)
-
getCellEditorValue
public Object getCellEditorValue()
Returns the value contained in the editor- Specified by:
getCellEditorValue
in interfaceCellEditor
- 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 interfaceVetoableChangeListener
- 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 interfaceActionListener
- Parameters:
e
- event
-
dispose
public void dispose()
Dispose
-
stopCellEditing
public boolean stopCellEditing()
- Specified by:
stopCellEditing
in interfaceCellEditor
- Overrides:
stopCellEditing
in classAbstractCellEditor
-
cancelCellEditing
public void cancelCellEditing()
- Specified by:
cancelCellEditing
in interfaceCellEditor
- Overrides:
cancelCellEditing
in classAbstractCellEditor
-
setActionListener
public void setActionListener(ActionListener listener)
-
-