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

java.lang.Object
  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:
UIChoiceCellEditor, UIImageViewer, UIInplaceCellEditor

public class UICellEditor<CE extends IStyledCellEditor>
extends Object
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_LEFT, ALIGN_RIGHT, ALIGN_STRETCH, ALIGN_TOP
 
Constructor Summary
protected UICellEditor(CE pCEResource)
          Constructs a new UICellEditor.
 
Method Summary
 ICellEditorHandler createCellEditorHandler(ICellEditorListener pCellEditorListener, IDataRow pDataRow, String pColumnName)
          creates an ICellEditorHandler library dependent component.
static ICellEditor getDefaultCellEditor(Class pClass)
          Gets the default ICellEditor for the given class.
 int getHorizontalAlignment()
          Returns the alignment along the x axis.
 CE 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 setDefaultCellEditor(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 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 CE 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,
                                                  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(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(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


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.