com.sibvisions.rad.ui.swing.ext.celleditor
Class JVxTextCellEditor

java.lang.Object
  extended by com.sibvisions.rad.ui.swing.ext.celleditor.JVxStyledCellEditor
      extended by com.sibvisions.rad.ui.swing.ext.celleditor.JVxInplaceCellEditor
          extended by com.sibvisions.rad.ui.swing.ext.celleditor.JVxTextCellEditor
All Implemented Interfaces:
ICellEditor, ICellRenderer<JComponent>, IInplaceCellEditor, IStyledCellEditor, ITextCellEditor, IAlignmentConstants

public class JVxTextCellEditor
extends JVxInplaceCellEditor
implements ITextCellEditor, ICellRenderer<JComponent>

The JVxTextCellEditor provides the generation of the physical text editor component, handles correct all events, and gives standard access to edited values.


Nested Class Summary
static class JVxTextCellEditor.CellEditorHandler
          Sets the internal changed flag, and informs the CellEditorListener if editing is completed.
 
Field Summary
 
Fields inherited from interface javax.rad.ui.celleditor.ITextCellEditor
TEXT_PLAIN_MULTILINE, TEXT_PLAIN_PASSWORD, TEXT_PLAIN_SINGLELINE, TEXT_PLAIN_WRAPPEDMULTILINE
 
Fields inherited from interface javax.rad.ui.celleditor.IInplaceCellEditor
DOUBLE_CLICK, SINGLE_CLICK
 
Fields inherited from interface javax.rad.ui.IAlignmentConstants
ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT, ALIGN_STRETCH, ALIGN_TOP
 
Constructor Summary
JVxTextCellEditor()
          Constructs a new JVxTextCellEditor.
JVxTextCellEditor(String pContentType)
          Constructs a new JVxTextCellEditor with the given content type.
 
Method Summary
 ICellEditorHandler<JComponent> createCellEditorHandler(ICellEditorListener pCellEditorListener, IDataRow pDataRow, String pColumnName)
          creates an ICellEditorHandler library dependent component.
 JComponent getCellRendererComponent(JComponent pParentComponent, IDataPage pDataPage, int pRowNumber, IDataRow pDataRow, String pColumnName, boolean pIsSelected, boolean hasFocus)
          Configures a IComponent for rendering.
 String getContentType()
          Gets the content type used for editing the text.
 boolean isDirectCellEditor()
          Defines, if the editor should edit directly in complex controls.
 void setContentType(String pContentType)
          Sets the content type used for editing the text.
 
Methods inherited from class com.sibvisions.rad.ui.swing.ext.celleditor.JVxInplaceCellEditor
getPreferredEditorMode, setPreferredEditorMode
 
Methods inherited from class com.sibvisions.rad.ui.swing.ext.celleditor.JVxStyledCellEditor
getHorizontalAlignment, getVerticalAlignment, 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.ui.celleditor.IInplaceCellEditor
getPreferredEditorMode, setPreferredEditorMode
 
Methods inherited from interface javax.rad.ui.IAlignmentConstants
getHorizontalAlignment, getVerticalAlignment, setHorizontalAlignment, setVerticalAlignment
 

Constructor Detail

JVxTextCellEditor

public JVxTextCellEditor()
Constructs a new JVxTextCellEditor.


JVxTextCellEditor

public JVxTextCellEditor(String pContentType)
Constructs a new JVxTextCellEditor with the given content type.

Parameters:
pContentType - the content type.
Method Detail

createCellEditorHandler

public ICellEditorHandler<JComponent> 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.

getContentType

public String getContentType()
Gets the content type used for editing the text.

Specified by:
getContentType in interface ITextCellEditor
Returns:
the content type

setContentType

public void setContentType(String pContentType)
Sets the content type used for editing the text.

Specified by:
setContentType in interface ITextCellEditor
Parameters:
pContentType - the content type

getCellRendererComponent

public JComponent getCellRendererComponent(JComponent pParentComponent,
                                           IDataPage pDataPage,
                                           int pRowNumber,
                                           IDataRow pDataRow,
                                           String pColumnName,
                                           boolean pIsSelected,
                                           boolean hasFocus)
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<JComponent>
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).
hasFocus - 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.