javax.rad.genui.celleditor
Class UICheckBoxCellEditor

java.lang.Object
  extended by javax.rad.genui.AbstractUIFactoryResource<CE>
      extended by javax.rad.genui.celleditor.UICellEditor<ICheckBoxCellEditor>
          extended by javax.rad.genui.celleditor.UICheckBoxCellEditor
All Implemented Interfaces:
ICellEditor, ICellRenderer, ICheckBoxCellEditor, IStyledCellEditor, IAlignmentConstants, IResource

public class UICheckBoxCellEditor
extends UICellEditor<ICheckBoxCellEditor>
implements ICheckBoxCellEditor

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


Field Summary
 
Fields inherited from interface javax.rad.ui.IAlignmentConstants
ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_DEFAULT, ALIGN_LEFT, ALIGN_RIGHT, ALIGN_STRETCH, ALIGN_TOP
 
Constructor Summary
  UICheckBoxCellEditor()
          Creates a new instance of UICheckBoxCellEditor.
protected UICheckBoxCellEditor(ICheckBoxCellEditor pEditor)
          Creates a new instance of UICheckBoxCellEditor with the given choice cell editor.
  UICheckBoxCellEditor(java.lang.Object pSelectedValue, java.lang.Object pDeselectedValue)
          Creates a new instance of UICheckBoxCellEditor with the given selected and deselected values.
  UICheckBoxCellEditor(java.lang.Object pSelectedValue, java.lang.Object pDeselectedValue, java.lang.String pText)
          Creates a new instance of UICheckBoxCellEditor with the given selected and deselected values.
 
Method Summary
static void addDefaultCheckBoxCellEditor(ICheckBoxCellEditor pEditor)
          Adds a checkbox cell editor to the list of default checkbox cell editors.
 java.lang.Object getCellRendererComponent(java.lang.Object pParentComponent, IDataPage pDataPage, int pRowNumber, IDataRow pDataRow, java.lang.String pColumnName, boolean pIsSelected, boolean pHasFocus)
          Configures a IComponent for rendering.
static ICheckBoxCellEditor getDefaultCheckBoxCellEditor(java.lang.Object[] pValues)
          Gets a checkbox cell editor from the defaults list, if an editor is available for specific values.
static ICheckBoxCellEditor[] getDefaultCheckBoxCellEditors()
          Gets all currently available default checkbox cell editors as array.
 java.lang.Object getDeselectedValue()
          Gets the value for deselected state.
 java.lang.Object getSelectedValue()
          Gets the value for selected state.
 java.lang.String getText()
          Gets the text of the checkbox button.
static void removeAllDefaultCheckBoxCellEditors()
          Removes all default checkbox cell editors.
static void removeDefaultCheckBoxCellEditor(ICheckBoxCellEditor pEditor)
          Removes a checkbox cell editor from the list of default checkbox cell editors.
 void setDeselectedValue(java.lang.Object pDeselectedValue)
          Sets the value for deselected state.
 void setSelectedValue(java.lang.Object pSelectedValue)
          Sets the value for selected state.
 void setText(java.lang.String pText)
          Sets the text of the checkbox button.
 
Methods inherited from class javax.rad.genui.celleditor.UICellEditor
addDefaultCellEditor, createCacheKey, createCellEditorHandler, getDefaultCellEditor, getDefaultCellEditor, getDefaultCellEditors, getDefaultCellEditors, getHorizontalAlignment, getResource, getVerticalAlignment, isDirectCellEditor, removeAllDefaultCellEditors, removeAllDefaultCellEditors, removeDefaultCellEditor, setDefaultCellEditor, setHorizontalAlignment, setVerticalAlignment
 
Methods inherited from class javax.rad.genui.AbstractUIFactoryResource
getUIResource, setUIResource
 
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

UICheckBoxCellEditor

public UICheckBoxCellEditor()
Creates a new instance of UICheckBoxCellEditor.

See Also:
ICheckBoxCellEditor

UICheckBoxCellEditor

protected UICheckBoxCellEditor(ICheckBoxCellEditor pEditor)
Creates a new instance of UICheckBoxCellEditor with the given choice cell editor.

Parameters:
pEditor - the choice cell editor
See Also:
ICheckBoxCellEditor

UICheckBoxCellEditor

public UICheckBoxCellEditor(java.lang.Object pSelectedValue,
                            java.lang.Object pDeselectedValue)
Creates a new instance of UICheckBoxCellEditor with the given selected and deselected values.

Parameters:
pSelectedValue - the selected value.
pDeselectedValue - the deselected value.

UICheckBoxCellEditor

public UICheckBoxCellEditor(java.lang.Object pSelectedValue,
                            java.lang.Object pDeselectedValue,
                            java.lang.String pText)
Creates a new instance of UICheckBoxCellEditor with the given selected and deselected values.

Parameters:
pSelectedValue - the selected value.
pDeselectedValue - the deselected value.
pText - the text.
Method Detail

getSelectedValue

public java.lang.Object getSelectedValue()
Gets the value for selected state.

Specified by:
getSelectedValue in interface ICheckBoxCellEditor
Returns:
all allowed values.

setSelectedValue

public void setSelectedValue(java.lang.Object pSelectedValue)
Sets the value for selected state.

Specified by:
setSelectedValue in interface ICheckBoxCellEditor
Parameters:
pSelectedValue - the value for selected state.

getDeselectedValue

public java.lang.Object getDeselectedValue()
Gets the value for deselected state.

Specified by:
getDeselectedValue in interface ICheckBoxCellEditor
Returns:
the value for deselected state.

setDeselectedValue

public void setDeselectedValue(java.lang.Object pDeselectedValue)
Sets the value for deselected state.

Specified by:
setDeselectedValue in interface ICheckBoxCellEditor
Parameters:
pDeselectedValue - the value for deselected state.

getText

public java.lang.String getText()
Gets the text of the checkbox button. If no text is set, the column label is used.

Specified by:
getText in interface ICheckBoxCellEditor
Returns:
the text of the checkbox button.

setText

public void setText(java.lang.String pText)
Sets the text of the checkbox button. If no text is set, the column label is used.

Specified by:
setText in interface ICheckBoxCellEditor
Parameters:
pText - the text of the checkbox button.

getCellRendererComponent

public java.lang.Object getCellRendererComponent(java.lang.Object pParentComponent,
                                                 IDataPage pDataPage,
                                                 int pRowNumber,
                                                 IDataRow pDataRow,
                                                 java.lang.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.

getDefaultCheckBoxCellEditor

public static ICheckBoxCellEditor getDefaultCheckBoxCellEditor(java.lang.Object[] pValues)
Gets a checkbox cell editor from the defaults list, if an editor is available for specific values.

Parameters:
pValues - a list of values for which a checkbox cell editor should be found. All values must match to the allowed values of a registered editor.
Returns:
a checkbox cell editor for pValue or null if no matching editor was found.

getDefaultCheckBoxCellEditors

public static ICheckBoxCellEditor[] getDefaultCheckBoxCellEditors()
Gets all currently available default checkbox cell editors as array.

Returns:
an array with default checkbox cell editors always != null

addDefaultCheckBoxCellEditor

public static void addDefaultCheckBoxCellEditor(ICheckBoxCellEditor pEditor)
Adds a checkbox cell editor to the list of default checkbox cell editors. The allowed values of the cell editor will be used to checkbox if there is already a checkbox cell editor present and if yes the already existing checkbox cell editor will be replaced.

Parameters:
pEditor - the checkbox cell editor

removeDefaultCheckBoxCellEditor

public static void removeDefaultCheckBoxCellEditor(ICheckBoxCellEditor pEditor)
Removes a checkbox cell editor from the list of default checkbox cell editors.

Parameters:
pEditor - the checkbox cell editor

removeAllDefaultCheckBoxCellEditors

public static void removeAllDefaultCheckBoxCellEditors()
Removes all default checkbox cell editors.



Copyright © 2009 SIB Visions GmbH. All Rights Reserved.