javax.rad.genui.celleditor
Class UIChoiceCellEditor

java.lang.Object
  extended by javax.rad.genui.celleditor.UICellEditor<IChoiceCellEditor>
      extended by javax.rad.genui.celleditor.UIChoiceCellEditor
All Implemented Interfaces:
ICellEditor, ICellRenderer, IChoiceCellEditor, IStyledCellEditor, IAlignmentConstants, IResource

public class UIChoiceCellEditor
extends UICellEditor<IChoiceCellEditor>
implements IChoiceCellEditor

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


Field Summary
 
Fields inherited from class javax.rad.genui.celleditor.UICellEditor
ceResource
 
Fields inherited from interface javax.rad.ui.IAlignmentConstants
ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT, ALIGN_STRETCH, ALIGN_TOP
 
Constructor Summary
UIChoiceCellEditor()
          Creates a new instance of UIChoiceCellEditor.
UIChoiceCellEditor(Object[] pAllowedValues, String[] pImageNames)
          Creates a new instance of UIChoiceCellEditor with the given allowed values and image names.
UIChoiceCellEditor(Object[] pAllowedValues, String[] pImageNames, String pDefaultImage)
          Creates a new instance of UIChoiceCellEditor with the given allowed values and image names.
 
Method Summary
 Object[] getAllowedValues()
          Gets all allowed values.
 Object getCellRendererComponent(Object pParentComponent, IDataPage pDataPage, int pRowNumber, IDataRow pDataRow, String pColumnName, boolean pIsSelected, boolean pHasFocus)
          Configures a IComponent for rendering.
 String getDefaultImageName()
          Gets the default image that is shown if selectedIndex is -1.
 String[] getImageNames()
          Gets the image names that are used for displaying the corresponding values.
 void setAllowedValues(Object[] pAllowedValues)
          Sets all allowed values.
 void setDefaultImageName(String pDefaultImage)
          Sets the default image name that is shown if selectedIndex is -1.
 void setImageNames(String[] pImageNames)
          Sets the image names that are used for displaying the corresponding values.
 
Methods inherited from class javax.rad.genui.celleditor.UICellEditor
createCellEditorHandler, getDefaultCellEditor, getHorizontalAlignment, getResource, getVerticalAlignment, isDirectCellEditor, setDefaultCellEditor, setHorizontalAlignment, setVerticalAlignment
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.rad.model.ui.ICellEditor
createCellEditorHandler, isDirectCellEditor
 
Methods inherited from interface javax.rad.ui.IAlignmentConstants
getHorizontalAlignment, getVerticalAlignment, setHorizontalAlignment, setVerticalAlignment
 

Constructor Detail

UIChoiceCellEditor

public UIChoiceCellEditor()
Creates a new instance of UIChoiceCellEditor.

See Also:
IChoiceCellEditor

UIChoiceCellEditor

public UIChoiceCellEditor(Object[] pAllowedValues,
                          String[] pImageNames)
Creates a new instance of UIChoiceCellEditor with the given allowed values and image names.

Parameters:
pAllowedValues - the allowed values.
pImageNames - the image names.
See Also:
IChoiceCellEditor

UIChoiceCellEditor

public UIChoiceCellEditor(Object[] pAllowedValues,
                          String[] pImageNames,
                          String pDefaultImage)
Creates a new instance of UIChoiceCellEditor with the given allowed values and image names.

Parameters:
pAllowedValues - the allowed values.
pImageNames - the image names.
pDefaultImage - the default image name.
See Also:
IChoiceCellEditor
Method Detail

getAllowedValues

public Object[] getAllowedValues()
Gets all allowed values.

Specified by:
getAllowedValues in interface IChoiceCellEditor
Returns:
all allowed values.

setAllowedValues

public void setAllowedValues(Object[] pAllowedValues)
Sets all allowed values.

Specified by:
setAllowedValues in interface IChoiceCellEditor
Parameters:
pAllowedValues - all allowed values.

getImageNames

public String[] getImageNames()
Gets the image names that are used for displaying the corresponding values.

Specified by:
getImageNames in interface IChoiceCellEditor
Returns:
the image names.

setImageNames

public void setImageNames(String[] pImageNames)
Sets the image names that are used for displaying the corresponding values.

Specified by:
setImageNames in interface IChoiceCellEditor
Parameters:
pImageNames - the image names.

getDefaultImageName

public String getDefaultImageName()
Gets the default image that is shown if selectedIndex is -1.

Specified by:
getDefaultImageName in interface IChoiceCellEditor
Returns:
the default image.

setDefaultImageName

public void setDefaultImageName(String pDefaultImage)
Sets the default image name that is shown if selectedIndex is -1.

Specified by:
setDefaultImageName in interface IChoiceCellEditor
Parameters:
pDefaultImage - the default image name.

getCellRendererComponent

public Object getCellRendererComponent(Object pParentComponent,
                                       IDataPage pDataPage,
                                       int pRowNumber,
                                       IDataRow pDataRow,
                                       String pColumnName,
                                       boolean pIsSelected,
                                       boolean pHasFocus)
Configures a IComponent for rendering. The IComponent can be reused for performance reasons. After a new call of getCellRendererComponent, the previous IComponent can't be used for rendering anymore.

Specified by:
getCellRendererComponent in interface ICellRenderer
Parameters:
pParentComponent - the Parent Component from which.
pDataPage - the DataPage of the row to be rendered.
pRowNumber - the row number of the row to be rendered.
pDataRow - the row to be rendered (is the same as pDataPage.getRow(pRowNumber)).
pColumnName - the column name to be rendered.
pIsSelected - true, if the cell is selected (shown with selected background).
pHasFocus - true, if the cell has the focus (cell is the current editing cell).
Returns:
the renderer Component. It can only be used until the next call of this function.


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.