javax.rad.genui.control
Class UIEditor

java.lang.Object
  extended by javax.rad.genui.UIResource<C>
      extended by javax.rad.genui.UIComponent<IEditor>
          extended by javax.rad.genui.control.UIEditor
All Implemented Interfaces:
IControl, IEditorControl, ITranslatable, ICellFormatable, IEditor, IComponent, IResource, INamedObject

public class UIEditor
extends UIComponent<IEditor>
implements IEditor

Platform and technology independent Editor. It is designed for use with AWT, Swing, SWT, JSP, JSF, ... .


Field Summary
 
Fields inherited from class javax.rad.genui.UIComponent
lLastTranslationModified, parent
 
Fields inherited from class javax.rad.genui.UIResource
uiResource
 
Constructor Summary
  UIEditor()
          Creates a new instance of UIEditor.
  UIEditor(IDataRow pDataRow, String pColumnName)
          Creates a new instance of UIEditor.
protected UIEditor(IEditor pEditor)
          Creates a new instance of UIEditor with the given editor.
 
Method Summary
 void cancelEditing()
          Informs the GUI control, that the last edit should be canceled(restored) the correct value is in the DataBook.
 ICellEditor getCellEditor()
          Gets the CellEditor that edits the given column in the given DataRow.
 ICellFormatter getCellFormatter()
          Gets the cell formatter.
 String getColumnName()
          Returns the column name displayed by this control.
 IDataRow getDataRow()
          Returns the DataRow displayed by this control.
 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 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 cell formatter.
 void setCellFormatter(Object pCellFormatter, String pMethodName)
          Sets the cell formatter.
 void setColumnName(String pColumnName)
          Sets the column name displayed by this control.
 void setDataRow(IDataRow pDataRow)
          Sets the DataRow displayed by this control.
 void setSavingImmediate(boolean pSavingImmediate)
          Sets whether the CellEditor should save immediate.
 void updateTranslation()
          Notification for updating the translation.
 
Methods inherited from class javax.rad.genui.UIComponent
addNotify, beforeAddNotify, capture, createCellFormatter, createNodeFormatter, debug, error, eventComponentMoved, eventComponentResized, eventKeyPressed, eventKeyReleased, eventKeyTyped, eventMouseClicked, eventMouseEntered, eventMouseExited, eventMousePressed, eventMouseReleased, getBackground, getBounds, getComponentUIResource, getCurrentTranslation, getCursor, getEventSource, getFactory, getFont, getForeground, getLocation, getLocationRelativeTo, getMaximumSize, getMinimumSize, getName, getParent, getPreferredSize, getResource, getSize, getToolTipText, getTranslation, info, invokeAndWait, invokeAndWait, invokeInThread, invokeInThread, invokeLater, invokeLater, isBackgroundSet, isBeforeNotified, isCursorSet, isEnabled, isFocusable, isFontSet, isForegroundSet, isMaximumSizeSet, isMinimumSizeSet, isNotified, isPreferredSizeSet, isTranslationChanged, isTranslationEnabled, isVisible, removeNotify, requestFocus, setBackground, setBounds, setBounds, setCursor, setEnabled, setEventSource, setFocusable, setFont, setForeground, setLocation, setLocation, setLocationRelativeTo, setMaximumSize, setMaximumSize, setMinimumSize, setMinimumSize, setName, setParent, setPreferredSize, setPreferredSize, setSize, setSize, setToolTipText, setTranslation, setTranslationEnabled, setVisible, translate
 
Methods inherited from class javax.rad.genui.UIResource
equals, getUIResource, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.rad.ui.IComponent
capture, eventComponentMoved, eventComponentResized, eventKeyPressed, eventKeyReleased, eventKeyTyped, eventMouseClicked, eventMouseEntered, eventMouseExited, eventMousePressed, eventMouseReleased, getBackground, getBounds, getCursor, getEventSource, getFactory, getFont, getForeground, getLocation, getLocationRelativeTo, getMaximumSize, getMinimumSize, getName, getParent, getPreferredSize, getSize, getToolTipText, isBackgroundSet, isCursorSet, isEnabled, isFocusable, isFontSet, isForegroundSet, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isVisible, requestFocus, setBackground, setBounds, setCursor, setEnabled, setEventSource, setFocusable, setFont, setForeground, setLocation, setLocationRelativeTo, setMaximumSize, setMinimumSize, setName, setParent, setPreferredSize, setSize, setToolTipText, setVisible
 
Methods inherited from interface javax.rad.ui.IResource
getResource
 
Methods inherited from interface javax.rad.model.ui.ITranslatable
getTranslation, setTranslation
 

Constructor Detail

UIEditor

public UIEditor()
Creates a new instance of UIEditor.

See Also:
IEditor

UIEditor

protected UIEditor(IEditor pEditor)
Creates a new instance of UIEditor with the given editor.

Parameters:
pEditor - the editor
See Also:
IEditor

UIEditor

public UIEditor(IDataRow pDataRow,
                String pColumnName)
         throws ModelException
Creates a new instance of UIEditor.

Parameters:
pDataRow - the IDataRow.
pColumnName - the column name.
Throws:
ModelException - if the editor can't be initialized.
See Also:
IEditor
Method Detail

getDataRow

public IDataRow getDataRow()
Returns the DataRow displayed by this control.

Specified by:
getDataRow in interface IEditorControl
Returns:
the DataRow.
See Also:
IEditorControl.setDataRow(javax.rad.model.IDataRow)

setDataRow

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

Specified by:
setDataRow in interface IEditorControl
Parameters:
pDataRow - the DataRow
Throws:
ModelException - if the column name is invalid
See Also:
IEditorControl.getDataRow(), IEditorControl.setColumnName(String)

getColumnName

public String getColumnName()
Returns the column name displayed by this control.

Specified by:
getColumnName in interface IEditorControl
Returns:
the column name.
See Also:
IEditorControl.setColumnName(java.lang.String)

setColumnName

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

Specified by:
setColumnName in interface IEditorControl
Parameters:
pColumnName - the column name.
Throws:
ModelException - if the column name is invalid
See Also:
IEditorControl.getColumnName()

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.

Specified by:
getCellEditor in interface IEditorControl
Specified by:
getCellEditor in interface IEditor
Returns:
the CellEditor.
See Also:
IEditor.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.

Specified by:
setCellEditor in interface IEditorControl
Specified by:
setCellEditor in interface IEditor
Parameters:
pCellEditor - the CellEditor.
Throws:
ModelException - if the cell editor can not be set
See Also:
IEditor.getCellEditor()

isSavingImmediate

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

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

setSavingImmediate

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

Specified by:
setSavingImmediate in interface IEditor
Parameters:
pSavingImmediate - true, if the CellEditor should save immediate.

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

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.

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

getCellFormatter

public ICellFormatter getCellFormatter()
Gets the cell formatter.

Specified by:
getCellFormatter in interface ICellFormatable
Returns:
the cell formatter.

setCellFormatter

public void setCellFormatter(ICellFormatter pCellFormatter)
Sets the cell formatter.

Specified by:
setCellFormatter in interface ICellFormatable
Parameters:
pCellFormatter - the cell formatter.

setCellFormatter

public void setCellFormatter(Object pCellFormatter,
                             String pMethodName)
Sets the cell formatter.

Parameters:
pCellFormatter - the cell formatter.
pMethodName - the method name.

updateTranslation

public void updateTranslation()
Notification for updating the translation. This method will be called when the UIComponent will be added to a displayable containment hierarchy, when its containment hierarchy is made displayable or the translation table will be changed.

Overrides:
updateTranslation in class UIComponent<IEditor>
See Also:
UIComponent.setTranslation(TranslationMap), UIComponent.addNotify()


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.