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 getCellEditorValueA 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 voidactionPerformed(ActionEvent e)Action Editor - Stop EditorvoidcancelCellEditing()voiddispose()DisposeObjectgetCellEditorValue()Returns the value contained in the editorVEditorgetEditor()Get Actual Editor.ComponentgetTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int col)Sets an initial value for the editor.booleanisCellEditable(EventObject anEvent)Ask the editor if it can start editing using anEvent.voidsetActionListener(ActionListener listener)booleanshouldSelectCell(EventObject e)The editing cell should be selected or notbooleanstopCellEditing()voidvetoableChange(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:
isCellEditablein interfaceCellEditor- Overrides:
isCellEditablein 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:
getTableCellEditorComponentin 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:
shouldSelectCellin interfaceCellEditor- Overrides:
shouldSelectCellin classAbstractCellEditor- Parameters:
e- event- Returns:
- true (constant)
-
getCellEditorValue
public Object getCellEditorValue()
Returns the value contained in the editor- Specified by:
getCellEditorValuein 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:
vetoableChangein 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:
actionPerformedin interfaceActionListener- Parameters:
e- event
-
dispose
public void dispose()
Dispose
-
stopCellEditing
public boolean stopCellEditing()
- Specified by:
stopCellEditingin interfaceCellEditor- Overrides:
stopCellEditingin classAbstractCellEditor
-
cancelCellEditing
public void cancelCellEditing()
- Specified by:
cancelCellEditingin interfaceCellEditor- Overrides:
cancelCellEditingin classAbstractCellEditor
-
setActionListener
public void setActionListener(ActionListener listener)
-
-