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

java.lang.Object
  extended by javax.swing.AbstractListModel
      extended by com.sibvisions.rad.ui.swing.ext.celleditor.JVxLinkedCellEditor.CellEditorHandler
All Implemented Interfaces:
FocusListener, KeyListener, MouseListener, Serializable, Runnable, EventListener, ICellEditorHandler<JComponent>, ComboBoxModel, DocumentListener, PopupMenuListener, ListModel
Enclosing class:
JVxLinkedCellEditor

public static class JVxLinkedCellEditor.CellEditorHandler
extends AbstractListModel
implements ICellEditorHandler<JComponent>, ComboBoxModel, DocumentListener, KeyListener, PopupMenuListener, FocusListener, MouseListener, Runnable

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

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.AbstractListModel
listenerList
 
Constructor Summary
JVxLinkedCellEditor.CellEditorHandler(JVxLinkedCellEditor pCellEditor, ICellFormatterEditorListener pCellEditorListener, IDataRow pDataRow, String pColumnName, String pDisplayColumnName)
          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, boolean pClosePopup)
          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.
 Object getElementAt(int pIndex)
          
 Object getSelectedItem()
          
 int getSize()
          
 void insertUpdate(DocumentEvent pDocumentEvent)
          
 void keyPressed(KeyEvent pKeyEvent)
          
 void keyReleased(KeyEvent pKeyEvent)
          
 void keyTyped(KeyEvent pKeyEvent)
          
 void mouseClicked(MouseEvent pMouseEvent)
          
 void mouseEntered(MouseEvent pMouseEvent)
          
 void mouseExited(MouseEvent pMouseEvent)
          
 void mousePressed(MouseEvent pMouseEvent)
          
 void mouseReleased(MouseEvent pMouseEvent)
          
 void popupMenuCanceled(PopupMenuEvent pPopupMenuEvent)
          
 void popupMenuWillBecomeInvisible(PopupMenuEvent pPopupMenuEvent)
          
 void popupMenuWillBecomeVisible(PopupMenuEvent pPopupMenuEvent)
          
 void removeUpdate(DocumentEvent pDocumentEvent)
          
 void run()
          
 void saveEditing()
          Saves the changes made from the CellEditorComponent DataBook.
 void setSelectedItem(Object pItem)
          
 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 javax.swing.AbstractListModel
addListDataListener, fireContentsChanged, fireIntervalAdded, fireIntervalRemoved, getListDataListeners, getListeners, removeListDataListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.swing.ListModel
addListDataListener, removeListDataListener
 

Constructor Detail

JVxLinkedCellEditor.CellEditorHandler

public JVxLinkedCellEditor.CellEditorHandler(JVxLinkedCellEditor pCellEditor,
                                             ICellFormatterEditorListener pCellEditorListener,
                                             IDataRow pDataRow,
                                             String pColumnName,
                                             String pDisplayColumnName)
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.
pDisplayColumnName - the name of the displayed 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.

getSelectedItem

public Object getSelectedItem()

Specified by:
getSelectedItem in interface ComboBoxModel

setSelectedItem

public void setSelectedItem(Object pItem)

Specified by:
setSelectedItem in interface ComboBoxModel

getElementAt

public Object getElementAt(int pIndex)

Specified by:
getElementAt in interface ListModel

getSize

public int getSize()

Specified by:
getSize in interface ListModel

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

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

popupMenuCanceled

public void popupMenuCanceled(PopupMenuEvent pPopupMenuEvent)

Specified by:
popupMenuCanceled in interface PopupMenuListener

popupMenuWillBecomeInvisible

public void popupMenuWillBecomeInvisible(PopupMenuEvent pPopupMenuEvent)

Specified by:
popupMenuWillBecomeInvisible in interface PopupMenuListener

popupMenuWillBecomeVisible

public void popupMenuWillBecomeVisible(PopupMenuEvent pPopupMenuEvent)

Specified by:
popupMenuWillBecomeVisible in interface PopupMenuListener

run

public void run()

Specified by:
run in interface Runnable

focusGained

public void focusGained(FocusEvent pFocusEvent)

Specified by:
focusGained in interface FocusListener

focusLost

public void focusLost(FocusEvent pFocusEvent)

Specified by:
focusLost in interface FocusListener

mouseClicked

public void mouseClicked(MouseEvent pMouseEvent)

Specified by:
mouseClicked in interface MouseListener

mouseEntered

public void mouseEntered(MouseEvent pMouseEvent)

Specified by:
mouseEntered in interface MouseListener

mouseExited

public void mouseExited(MouseEvent pMouseEvent)

Specified by:
mouseExited in interface MouseListener

mousePressed

public void mousePressed(MouseEvent pMouseEvent)

Specified by:
mousePressed in interface MouseListener

mouseReleased

public void mouseReleased(MouseEvent pMouseEvent)

Specified by:
mouseReleased in interface MouseListener

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,
                                   boolean pClosePopup)
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.
pClosePopup - try closing the popup.


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.