com.sibvisions.rad.ui.swing.ext
Class JVxEditor

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by com.sibvisions.rad.ui.swing.ext.JVxEditor
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Runnable, Accessible, ICellEditorListener, IControl

public class JVxEditor
extends JPanel
implements IControl, ICellEditorListener, Runnable

Editor that implements IControl interface.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.rad.model.ui.ICellEditorListener
ACTION_KEY, ENTER_KEY, ESCAPE_KEY, FOCUS_LOST, SHIFT_ENTER_KEY, SHIFT_TAB_KEY, TAB_KEY
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
JVxEditor()
          Constructs an editor.
 
Method Summary
 void cancelEditing()
          Informs the GUI control, that the last edit should be canceled(restored) the correct value is in the DataBook.
 void editingComplete(String pCompleteType)
          Informs the ICellEditorListener that the editing is completed.
 void editingStarted()
          Informs the ICellEditorListener that the editing has started.
 ICellEditor getCellEditor()
          Gets the CellEditor that edits the given column in the given DataRow.
 ICellEditorHandler<JComponent> getCellEditorHandler()
          The current used CellEditor for editing.
 ICellFormatter getCellFormatter()
          Gets the CellFormatter.
 String getColumnName()
          Gets the column name edited by this control.
 IDataRow getDataRow()
          Gets the DataRow edited by this control.
 TranslationMap getTranslation()
          Gets the translation mapping for this table.
 boolean isSavingImmediate()
          Tells whether the CellEditor should save immediate.
 void notifyRepaint()
          The control need to check if the part is visible and then repaint the part.
 void requestFocus()
          
 void run()
          The run method is invoked from AWT EventQueue.
 void saveEditing()
          Informs the GUI control, that the last edit should be set into the IDataBook or IDataRow.
 void setCellEditor(ICellEditor pCellEditor)
          Sets the CellEditor that edits the given column in the given DataRow.
 void setCellFormatter(ICellFormatter pCellFormatter)
          Sets the CellFormatter.
 void setColumnName(String pColumnName)
          Sets the column edited by this control.
 void setDataRow(IDataRow pDataRow)
          Sets the DataRow edited by this control.
 void setSavingImmediate(boolean pSavingImmediate)
          Sets whether the CellEditor should save immediate.
 void setTranslation(TranslationMap pTranslation)
          Sets the translation mapping for this table.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JVxEditor

public JVxEditor()
Constructs an editor.

Method Detail

run

public void run()
The run method is invoked from AWT EventQueue. It enables events from the model again. Due to performance reasons the events are disabled from the first call of notifyRepaint until the EventQueue calls the run method. This minimizes the repaints of the control.

Specified by:
run in interface Runnable

notifyRepaint

public void notifyRepaint()
The control need to check if the part is visible and then repaint the part.

Specified by:
notifyRepaint in interface IControl

cancelEditing

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

Specified by:
cancelEditing in interface IControl

saveEditing

public void saveEditing()
                 throws ModelException
Informs the GUI control, that the last edit should be set into the IDataBook or IDataRow.

Specified by:
saveEditing in interface IControl
Throws:
ModelException - if the value can not be stored.

getCellFormatter

public ICellFormatter getCellFormatter()
Gets the CellFormatter.

Returns:
the CellFormatter.
See Also:
setCellFormatter(com.sibvisions.rad.ui.swing.ext.format.ICellFormatter)

setCellFormatter

public void setCellFormatter(ICellFormatter pCellFormatter)
Sets the CellFormatter.

Parameters:
pCellFormatter - the CellFormatter
See Also:
getCellFormatter()

setTranslation

public void setTranslation(TranslationMap pTranslation)
Sets the translation mapping for this table.

Specified by:
setTranslation in interface IControl
Parameters:
pTranslation - the translation mapping

getTranslation

public TranslationMap getTranslation()
Gets the translation mapping for this table.

Specified by:
getTranslation in interface IControl
Returns:
the current translation mapping or null if there is no translation mapping

editingStarted

public void editingStarted()
Informs the ICellEditorListener that the editing has started. He has to Register the IControl on the IDataRow with registerEditingControl.

Specified by:
editingStarted in interface ICellEditorListener

editingComplete

public void editingComplete(String pCompleteType)
Informs the ICellEditorListener that the editing is completed. He has to Unregister the IControl on the IDataRow with unregisterEditingControl.

Specified by:
editingComplete in interface ICellEditorListener
Parameters:
pCompleteType - the type of completion.

isSavingImmediate

public boolean isSavingImmediate()
Tells whether the CellEditor should save immediate.

Specified by:
isSavingImmediate in interface ICellEditorListener
Returns:
whether the CellEditor should save immediate.

requestFocus

public void requestFocus()

Overrides:
requestFocus in class JComponent

getDataRow

public IDataRow getDataRow()
Gets the DataRow edited by this control.

Returns:
the DataRow.
See Also:
setDataRow(javax.rad.model.IDataRow)

setDataRow

public void setDataRow(IDataRow pDataRow)
                throws ModelException
Sets the DataRow edited by this control.

Parameters:
pDataRow - the DataRow.
Throws:
ModelException - if the column name for the row is invalid
See Also:
getDataRow(), setColumnName(String)

getColumnName

public String getColumnName()
Gets the column name edited by this control.

Returns:
the column name.
See Also:
setColumnName(java.lang.String)

setColumnName

public void setColumnName(String pColumnName)
                   throws ModelException
Sets the column edited by this control.

Parameters:
pColumnName - the column.
Throws:
ModelException - if the column name is invalid
See Also:
getColumnName()

setSavingImmediate

public void setSavingImmediate(boolean pSavingImmediate)
Sets whether the CellEditor should save immediate.

Parameters:
pSavingImmediate - true, if the CellEditor should save immediate.

getCellEditor

public ICellEditor getCellEditor()
Gets the CellEditor that edits the given column in the given DataRow. If the CellEditor is null, the editor from the columns DataType is used to edit.

Returns:
the CellEditor.
See Also:
setCellEditor(javax.rad.model.ui.ICellEditor)

setCellEditor

public void setCellEditor(ICellEditor pCellEditor)
                   throws ModelException
Sets the CellEditor that edits the given column in the given DataRow. If the CellEditor is null, the editor from the columns DataType is used to edit.

Parameters:
pCellEditor - the CellEditor.
Throws:
ModelException - if the column name of the editor is invalid
See Also:
getCellEditor()

getCellEditorHandler

public ICellEditorHandler<JComponent> getCellEditorHandler()
The current used CellEditor for editing.

Returns:
The current used CellEditor for editing.


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.