com.sibvisions.rad.ui.swing.impl.control
Class SwingEditor

java.lang.Object
  extended by com.sibvisions.rad.ui.awt.impl.AwtResource<C>
      extended by com.sibvisions.rad.ui.awt.impl.AwtComponent<C>
          extended by com.sibvisions.rad.ui.awt.impl.AwtContainer<C>
              extended by com.sibvisions.rad.ui.swing.impl.SwingComponent<JVxEditor>
                  extended by com.sibvisions.rad.ui.swing.impl.control.SwingEditor
All Implemented Interfaces:
ICellFormatter, ComponentListener, KeyListener, MouseListener, EventListener, IControl, IEditorControl, ITranslatable, ICellFormatable, IEditor, IAlignmentConstants, IComponent, IContainer, IResource, INamedObject

public class SwingEditor
extends SwingComponent<JVxEditor>
implements IEditor, ICellFormatter

The SwingEditor is the IEditor implementation for swing.

See Also:
JVxEditor

Field Summary
 
Fields inherited from class com.sibvisions.rad.ui.awt.impl.AwtComponent
eventComponentMoved, eventComponentResized, eventSource, factory, parent
 
Fields inherited from class com.sibvisions.rad.ui.awt.impl.AwtResource
resource
 
Fields inherited from interface javax.rad.ui.IAlignmentConstants
ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT, ALIGN_STRETCH, ALIGN_TOP
 
Constructor Summary
SwingEditor()
          Creates a new instance of SwingEditor.
 
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.
 CellFormat getCellFormat(IDataBook pDataBook, IDataPage pDataPage, IDataRow pDataRow, String pColumnName, int pRow, int pColumn)
          Gets the format for the given cell.
 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.
 TranslationMap getTranslation()
          Gets the possible translation mapping for this UIComponent.
 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 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 setTranslation(TranslationMap pTranslation)
          Sets the possible translations for this UIComponent.
 
Methods inherited from class com.sibvisions.rad.ui.swing.impl.SwingComponent
capture, getToolTipText, setBackground, setToolTipText
 
Methods inherited from class com.sibvisions.rad.ui.awt.impl.AwtContainer
add, add, add, add, addIntern, checkAdd, getComponent, getComponentCount, getLayout, indexOf, remove, remove, removeAll, removeIntern, setLayout, setLayoutIntern
 
Methods inherited from class com.sibvisions.rad.ui.awt.impl.AwtComponent
componentHidden, componentMoved, componentResized, componentShown, createImage, eventComponentMoved, eventComponentResized, eventKeyPressed, eventKeyReleased, eventKeyTyped, eventMouseClicked, eventMouseEntered, eventMouseExited, eventMousePressed, eventMouseReleased, getBackground, getBounds, getCursor, getEventSource, getFactory, getFont, getForeground, getHorizontalAlignment, getLocation, getLocationRelativeTo, getMaximumSize, getMinimumSize, getName, getParent, getPreferredSize, getSize, getVerticalAlignment, isBackgroundSet, isCursorSet, isEnabled, isFocusable, isFontSet, isForegroundSet, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isVisible, keyPressed, keyReleased, keyTyped, mouseClicked, mouseEntered, mouseExited, mousePressed, mouseReleased, requestFocus, setBounds, setCursor, setEnabled, setEventSource, setFactory, setFocusable, setFont, setForeground, setHorizontalAlignment, setLocation, setLocationRelativeTo, setMaximumSize, setMinimumSize, setName, setParent, setPreferredSize, setSize, setVerticalAlignment, setVisible, validate
 
Methods inherited from class com.sibvisions.rad.ui.awt.impl.AwtResource
equals, getResource, 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
 

Constructor Detail

SwingEditor

public SwingEditor()
Creates a new instance of SwingEditor.

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.

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

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.

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.

getCellFormat

public CellFormat getCellFormat(IDataBook pDataBook,
                                IDataPage pDataPage,
                                IDataRow pDataRow,
                                String pColumnName,
                                int pRow,
                                int pColumn)
Gets the format for the given cell.

Specified by:
getCellFormat in interface ICellFormatter
Parameters:
pDataBook - the DataBook
pDataPage - the DataPage
pDataRow - the DataRow
pColumnName - the column name
pRow - the Row number
pColumn - the Column number
Returns:
the format for the given cell.

setTranslation

public void setTranslation(TranslationMap pTranslation)
Sets the possible translations for this UIComponent.

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

getTranslation

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

Specified by:
getTranslation in interface ITranslatable
Returns:
the translation mappint


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.