javax.rad.genui.celleditor
Class UICellEditor<CE extends IStyledCellEditor>

java.lang.Object
  extended by javax.rad.genui.AbstractUIFactoryResource<CE>
      extended by javax.rad.genui.celleditor.UICellEditor<CE>
Type Parameters:
CE - an instance of ICellEditor.
All Implemented Interfaces:
ICellEditor, IStyledCellEditor, IAlignmentConstants, IResource
Direct Known Subclasses:
UICheckBoxCellEditor, UIChoiceCellEditor, UIImageViewer, UIInplaceCellEditor

public class UICellEditor<CE extends IStyledCellEditor>
extends AbstractUIFactoryResource<CE>
implements IResource, IStyledCellEditor

Platform and technology independent 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
protected UICellEditor(CE pCEResource)
          Constructs a new UICellEditor.
 
Method Summary
static void addDefaultCellEditor(java.lang.Object[] pAllowedValues, ICellEditor pEditor)
          Adds a cell editor to the list of default cell editors.
protected  java.lang.Object createCacheKey()
          Creates the cache key.
 ICellEditorHandler createCellEditorHandler(ICellEditorListener pCellEditorListener, IDataRow pDataRow, java.lang.String pColumnName)
          creates an ICellEditorHandler library dependent component.
static ICellEditor getDefaultCellEditor(java.lang.Class pClass)
          Gets the default ICellEditor for the given class.
static ICellEditor getDefaultCellEditor(java.lang.Object[] pValues)
          Gets a cell editor from the defaults list, if an editor is available for specific values.
static ICellEditor[] getDefaultCellEditors()
          Gets all currently available default cell editors as array.
static ICellEditor[] getDefaultCellEditors(java.lang.Class pClass)
          Gets all currently available default cell editors of the given class.
 int getHorizontalAlignment()
          Returns the alignment along the x axis.
 java.lang.Object getResource()
          Gets the original resource corresponding with this wrapper object.
 int getVerticalAlignment()
          Returns the alignment along the y axis.
 boolean isDirectCellEditor()
          Defines, if the editor should edit directly in complex controls.
static void removeAllDefaultCellEditors()
          Removes all default cell editors.
static void removeAllDefaultCellEditors(java.lang.Class pClass)
          Removes all default cell editors which are of the given class.
static void removeDefaultCellEditor(java.lang.Object[] pAllowedValues)
          Removes a cell editor from the list of default cell editors.
static void setDefaultCellEditor(java.lang.Class pClass, ICellEditor pCellEditor)
          Sets the default ICellEditor for the given class.
 void setHorizontalAlignment(int pHorizontalAlignment)
          Sets the horizontal alignment.
 void setVerticalAlignment(int pVerticalAlignment)
          Sets the vertical alignment.
 
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
 

Constructor Detail

UICellEditor

protected UICellEditor(CE pCEResource)
Constructs a new UICellEditor.

Parameters:
pCEResource - the CellEditor resource.
See Also:
ICellEditor
Method Detail

getResource

public final java.lang.Object getResource()
Gets the original resource corresponding with this wrapper object.

Specified by:
getResource in interface IResource
Returns:
the original resource

getHorizontalAlignment

public int getHorizontalAlignment()
Returns the alignment along the x axis. This specifies how the component would like to be aligned relative to other components. Possible values are defined in AlignmentConstants.

Specified by:
getHorizontalAlignment in interface IAlignmentConstants
Returns:
the horizontal alignment

setHorizontalAlignment

public void setHorizontalAlignment(int pHorizontalAlignment)
Sets the horizontal alignment. Possible values are defined in AlignmentConstants.

Specified by:
setHorizontalAlignment in interface IAlignmentConstants
Parameters:
pHorizontalAlignment - the new vertical alignment

getVerticalAlignment

public int getVerticalAlignment()
Returns the alignment along the y axis. This specifies how the component would like to be aligned relative to other components. Possible values are defined in AlignmentConstants.

Specified by:
getVerticalAlignment in interface IAlignmentConstants
Returns:
the vertical alignment

setVerticalAlignment

public void setVerticalAlignment(int pVerticalAlignment)
Sets the vertical alignment. Possible values are defined in AlignmentConstants.

Specified by:
setVerticalAlignment in interface IAlignmentConstants
Parameters:
pVerticalAlignment - the new vertical alignment

createCellEditorHandler

public ICellEditorHandler createCellEditorHandler(ICellEditorListener pCellEditorListener,
                                                  IDataRow pDataRow,
                                                  java.lang.String pColumnName)
creates an ICellEditorHandler library dependent component.

Specified by:
createCellEditorHandler in interface ICellEditor
Parameters:
pCellEditorListener - the ICellEditorListener
pDataRow - the IDataRow
pColumnName - the column name
Returns:
the ICellEditorHandler.

isDirectCellEditor

public boolean isDirectCellEditor()
Defines, if the editor should edit directly in complex controls.

Specified by:
isDirectCellEditor in interface ICellEditor
Returns:
the ICellEditorHandler.

getDefaultCellEditor

public static ICellEditor getDefaultCellEditor(java.lang.Class pClass)
Gets the default ICellEditor for the given class. This function should always return an editor. It should look for best matching editor with Class.isAssignableFrom.

Parameters:
pClass - the class type to be edited.
Returns:
the ICellEditor
See Also:
ICellEditor

setDefaultCellEditor

public static void setDefaultCellEditor(java.lang.Class pClass,
                                        ICellEditor pCellEditor)
Sets the default ICellEditor for the given class. This function should always return an editor. It should look for best matching editor with Class.isAssignableFrom. If the given ICellEditor is null, it is removed as editor for the given class.

Parameters:
pClass - the class type to be edited.
pCellEditor - the ICellEditor
See Also:
ICellEditor

createCacheKey

protected java.lang.Object createCacheKey()
Creates the cache key.

Overrides:
createCacheKey in class AbstractUIFactoryResource<CE extends IStyledCellEditor>
Returns:
the cache key

getDefaultCellEditor

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

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

getDefaultCellEditors

public static ICellEditor[] getDefaultCellEditors()
Gets all currently available default cell editors as array.

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

getDefaultCellEditors

public static ICellEditor[] getDefaultCellEditors(java.lang.Class pClass)
Gets all currently available default cell editors of the given class.

Parameters:
pClass - the class of editors to be returned
Returns:
an array with the default cell editors of the given class, always != null

addDefaultCellEditor

public static void addDefaultCellEditor(java.lang.Object[] pAllowedValues,
                                        ICellEditor pEditor)
Adds a cell editor to the list of default cell editors. The allowed values of the cell editor will be used to check if there is already a cell editor present and if yes the already existing cell editor will be replaced.

Parameters:
pAllowedValues - the allowed values.
pEditor - the editor.

removeDefaultCellEditor

public static void removeDefaultCellEditor(java.lang.Object[] pAllowedValues)
Removes a cell editor from the list of default cell editors.

Parameters:
pAllowedValues - the allowed values.

removeAllDefaultCellEditors

public static void removeAllDefaultCellEditors()
Removes all default cell editors.


removeAllDefaultCellEditors

public static void removeAllDefaultCellEditors(java.lang.Class pClass)
Removes all default cell editors which are of the given class.

Parameters:
pClass - the class of editors to be removed


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.