com.sibvisions.rad.ui.swing.ext.celleditor
Class JVxTextCellEditor.CellEditorHandler

java.lang.Object
  extended by com.sibvisions.rad.ui.swing.ext.celleditor.JVxTextCellEditor.CellEditorHandler
All Implemented Interfaces:
FocusListener, KeyListener, Runnable, EventListener, ICellEditorHandler<JComponent>, DocumentListener
Enclosing class:
JVxTextCellEditor

public static class JVxTextCellEditor.CellEditorHandler
extends Object
implements ICellEditorHandler<JComponent>, DocumentListener, FocusListener, KeyListener, Runnable

Sets the internal changed flag, and informs the CellEditorListener if editing is completed.


Constructor Summary
JVxTextCellEditor.CellEditorHandler(JVxTextCellEditor pCellEditor, ICellFormatterEditorListener pCellEditorListener, IDataRow pDataRow, String pColumnName)
          Constructs a new CellEditorHandler.
 
Method Summary
 void cancelEditing()
          Informs the GUI control, that the last edit should be canceled(restored) the correct value is in the DataBook.
 void changedUpdate(DocumentEvent pDocumentEvent)
          
protected  void fireEditingComplete(String pCompleteType)
          Delegates the event to the ICellEditorListener.
protected  void fireEditingStarted()
          Delegates the event to the ICellEditorListener.
 void focusGained(FocusEvent pFocusEvent)
          
 void focusLost(FocusEvent pFocusEvent)
          
 ICellEditor getCellEditor()
          Returns the ICellEditor that created this handler.
 JComponent getCellEditorComponent()
          Returns the library dependent CellEditorComponent.
 ICellEditorListener getCellEditorListener()
          Returns the CellEditorListener.
 String getColumnName()
          Returns the column name that is edited in the IDataRow.
 IDataRow getDataRow()
          Returns the IDataRow that is edited.
 void insertUpdate(DocumentEvent pDocumentEvent)
          
 void keyPressed(KeyEvent pKeyEvent)
          
 void keyReleased(KeyEvent pKeyEvent)
          
 void keyTyped(KeyEvent pKeyEvent)
          
 void removeUpdate(DocumentEvent pDocumentEvent)
          
 void run()
          
 void saveEditing()
          Saves the changes made from the CellEditorComponent DataBook.
 void uninstallEditor()
          Informs the handler, that the editor is or will be discarded.
 void updateEditor()
          Informs the handler, that it should possibly get new information from the ICellEditorListener (for e.g. a new TranslationMap).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JVxTextCellEditor.CellEditorHandler

public JVxTextCellEditor.CellEditorHandler(JVxTextCellEditor pCellEditor,
                                           ICellFormatterEditorListener pCellEditorListener,
                                           IDataRow pDataRow,
                                           String pColumnName)
Constructs a new CellEditorHandler.

Parameters:
pCellEditor - the CellEditor that created this handler.
pCellEditorListener - CellEditorListener to inform, if editing is started or completed.
pDataRow - the data row that is edited.
pColumnName - the column name of the edited column.
Method Detail

uninstallEditor

public void uninstallEditor()
Informs the handler, that the editor is or will be discarded. This is the place for removing all listeners and disabling events coming after this call (Focus Event is a funny example...).

Specified by:
uninstallEditor in interface ICellEditorHandler<JComponent>

updateEditor

public void updateEditor()
Informs the handler, that it should possibly get new information from the ICellEditorListener (for e.g. a new TranslationMap).

Specified by:
updateEditor in interface ICellEditorHandler<JComponent>

getCellEditor

public ICellEditor getCellEditor()
Returns the ICellEditor that created this handler.

Specified by:
getCellEditor in interface ICellEditorHandler<JComponent>
Returns:
the ICellEditor that created this handler.

getCellEditorListener

public ICellEditorListener getCellEditorListener()
Returns the CellEditorListener.

Specified by:
getCellEditorListener in interface ICellEditorHandler<JComponent>
Returns:
the CellEditorListener.

getDataRow

public IDataRow getDataRow()
Returns the IDataRow that is edited.

Specified by:
getDataRow in interface ICellEditorHandler<JComponent>
Returns:
the IDataRow that is edited.

getColumnName

public String getColumnName()
Returns the column name that is edited in the IDataRow.

Specified by:
getColumnName in interface ICellEditorHandler<JComponent>
Returns:
the column name that is edited in the IDataRow.

getCellEditorComponent

public JComponent getCellEditorComponent()
Returns the library dependent CellEditorComponent.

Specified by:
getCellEditorComponent in interface ICellEditorHandler<JComponent>
Returns:
the library dependent CellEditorComponent.

saveEditing

public void saveEditing()
                 throws ModelException
Saves the changes made from the CellEditorComponent DataBook.

Specified by:
saveEditing in interface ICellEditorHandler<JComponent>
Throws:
ModelException - if the value can not be stored.

cancelEditing

public void cancelEditing()
                   throws ModelException
Informs the GUI control, that the last edit should be canceled(restored) the correct value is in the DataBook.

Specified by:
cancelEditing in interface ICellEditorHandler<JComponent>
Throws:
ModelException - if the value can not be restored.

run

public void run()

Specified by:
run in interface Runnable

insertUpdate

public void insertUpdate(DocumentEvent pDocumentEvent)

Specified by:
insertUpdate in interface DocumentListener

removeUpdate

public void removeUpdate(DocumentEvent pDocumentEvent)

Specified by:
removeUpdate in interface DocumentListener

changedUpdate

public void changedUpdate(DocumentEvent pDocumentEvent)

Specified by:
changedUpdate in interface DocumentListener

focusGained

public void focusGained(FocusEvent pFocusEvent)

Specified by:
focusGained in interface FocusListener

focusLost

public void focusLost(FocusEvent pFocusEvent)

Specified by:
focusLost in interface FocusListener

keyPressed

public void keyPressed(KeyEvent pKeyEvent)

Specified by:
keyPressed in interface KeyListener

keyReleased

public void keyReleased(KeyEvent pKeyEvent)

Specified by:
keyReleased in interface KeyListener

keyTyped

public void keyTyped(KeyEvent pKeyEvent)

Specified by:
keyTyped in interface KeyListener

fireEditingStarted

protected void fireEditingStarted()
Delegates the event to the ICellEditorListener. It takes care, that the event occurs only one time.


fireEditingComplete

protected void fireEditingComplete(String pCompleteType)
Delegates the event to the ICellEditorListener. It takes care, that editing started will be called before, if it is not called until jet.

Parameters:
pCompleteType - the editing complete type.


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.