com.sibvisions.rad.ui.celleditor
Class AbstractLinkedCellEditor

java.lang.Object
  extended by com.sibvisions.rad.ui.celleditor.AbstractStyledCellEditor
      extended by com.sibvisions.rad.ui.celleditor.AbstractInplaceCellEditor
          extended by com.sibvisions.rad.ui.celleditor.AbstractComboCellEditor
              extended by com.sibvisions.rad.ui.celleditor.AbstractLinkedCellEditor
All Implemented Interfaces:
ICellEditor, IComboCellEditor, IInplaceCellEditor, ILinkedCellEditor, IStyledCellEditor, IAlignmentConstants
Direct Known Subclasses:
JVxLinkedCellEditor

public abstract class AbstractLinkedCellEditor
extends AbstractComboCellEditor
implements ILinkedCellEditor

The AbstractLinkedCellEditor is an ILinkedCellEditor implementation, which provides a base implementation.


Field Summary
protected  ICondition additionalCondition
          The additional condition.
protected  boolean autoTableHeaderVisibility
          True, if header should be visible depending of column number.
protected  ColumnView columnView
          The ColumnView.
protected  String displayConcatMask
          The display concat mask.
protected  String displayReferencedColumnName
          The name of the display referenced column.
protected  ReferenceDefinition linkReference
          The link reference.
protected  IDimension popupSize
          The size used for the popup.
protected  ColumnMapping searchColumnMapping
          The ColumnMapping.
protected  boolean searchInAllTableColumns
          If the text should be searched in all visible table columns.
protected  boolean searchTextAnywhere
          If the text should be searched anywhere inside a column.
protected  boolean sortByColumnName
          If the values should be sorted by column name.
protected  boolean tableHeaderVisible
          If the table header should be visible.
protected  boolean tableReadOnly
          If the table should be read-only.
protected  boolean validationEnabled
          If only values from the table are allowed.
 
Fields inherited from class com.sibvisions.rad.ui.celleditor.AbstractComboCellEditor
autoOpenPopup
 
Fields inherited from class com.sibvisions.rad.ui.celleditor.AbstractInplaceCellEditor
preferredEditorMode
 
Fields inherited from class com.sibvisions.rad.ui.celleditor.AbstractStyledCellEditor
horizontalAlignment, verticalAlignment
 
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_DEFAULT, ALIGN_LEFT, ALIGN_RIGHT, ALIGN_STRETCH, ALIGN_TOP
 
Constructor Summary
protected AbstractLinkedCellEditor()
          Creates a new instance of AbstractLinkedCellEditor.
 
Method Summary
protected  String[] getAdditionalClearColumns(IDataRow pDataRow)
          Searches for additional columns to be cleared on save.
 ICondition getAdditionalCondition()
          Gets the additional condition, that is combined with And.
protected  String[] getAllSearchColumns(ColumnMapping pSearchColumnMapping, IDataRow pDataRow, ICondition pCondition)
          Gets all search columns using the given data row as filter.
protected  String[] getClearColunms(IDataRow pDataRow, String pColumnName)
          Searches for columns, that should not be cleared, if the value of this linked cell editor is cleared.
 ColumnView getColumnView()
          Returns the ColumnView displayed by this control.
 int getDefaultHorizontalAlignment(IDataRow pDataRow, String pColumnName)
          Gets the default horizontal alignment based on data type.
 String getDisplayConcatMask()
          Gets the concat mask that is used for displaying values.
 String getDisplayReferencedColumnName()
          Gets the name of the referenced column that is used for displaying values.
protected  String getDisplayValue(IDataRow pDataRow, String pColumnName)
          Gets the correct display value for the given row and column.
protected  String getDisplayValueFromRow(IDataRow pDataRow)
          Gets the display value depending on displayConcatMask or displayReferencedColumnName.
protected  ICondition getItemSearchCondition(boolean pSearchWildCard, String pRelevantSearchColumnName, Object pItem)
          Gets the search condition for the input item.
 ReferenceDefinition getLinkReference()
          Gets reference definition that defines the link.
 IDimension getPopupSize()
          Gets the size of the Popup window using a Dimension object.
 ColumnMapping getSearchColumnMapping()
          Gets search columns for which should be searched in the linked cell.
protected  ICondition getSearchCondition(IDataRow pDataRow, ICondition pCondition)
          Creates a Condition including the search columns.
protected  String getWildCardString(Object pItem)
          Creates a search string.
 boolean isDirectCellEditor()
          Defines, if the editor should edit directly in complex controls.
 boolean isSearchInAllTableColumns()
          True, if the text is searched in all visible table columns.
 boolean isSearchTextAnywhere()
          True, if the text is searched anywhere inside a column.
 boolean isSortByColumnName()
          True, if the linked cell editor should sort by the column name it is editing.
 boolean isTableHeaderVisible()
          The header of a table can't be hidden.
 boolean isTableReadonly()
          Gets whether the table in the popup readonly.
 boolean isValidationEnabled()
          Gets true, if only values from the table are allowed.
 void setAdditionalCondition(ICondition pCondition)
          Sets the additional condition, that is combined with And.
 void setColumnView(ColumnView pColumnView)
          Sets the ColumnView displayed by this control.
 void setDisplayConcatMask(String pDisplayConcatMask)
          Gets the concat mask that is used for displaying values.
 void setDisplayReferencedColumnName(String pDisplayReferencedColumnName)
          Sets the name of the referenced column that is used for displaying values.
 void setLinkReference(ReferenceDefinition pReferenceDefinition)
          Sets reference definition that defines the link.
 void setPopupSize(IDimension pPopupSize)
          Sets the size of the Popup window using a Dimension object.
 void setSearchColumnMapping(ColumnMapping pSearchColumnNames)
          Sets search columns for which should be searched in the linked cell.
 void setSearchInAllTableColumns(boolean pSearchInAllTableColumns)
          True, if the text is searched in all visible table columns.
 void setSearchTextAnywhere(boolean pSearchTextAnywhere)
          True, if the text is searched anywhere inside a column.
 void setSortByColumnName(boolean pSortByColumnName)
          True, if the linked cell editor should sort by the column name it is editing.
 void setTableHeaderVisible(boolean pTableHeaderVisible)
          Does nothing, the header of a table can't be hidden.
 void setTableReadonly(boolean pTableReadonly)
          Sets the table in the popup readonly.
 void setValidationEnabled(boolean pValidationEnabled)
          Sets true, if only values from the table are allowed.
 
Methods inherited from class com.sibvisions.rad.ui.celleditor.AbstractComboCellEditor
isAutoOpenPopup, setAutoOpenPopup
 
Methods inherited from class com.sibvisions.rad.ui.celleditor.AbstractInplaceCellEditor
getPreferredEditorMode, setPreferredEditorMode
 
Methods inherited from class com.sibvisions.rad.ui.celleditor.AbstractStyledCellEditor
getHorizontalAlignment, getPlaceholderText, 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.IComboCellEditor
isAutoOpenPopup, setAutoOpenPopup
 
Methods inherited from interface javax.rad.ui.celleditor.IInplaceCellEditor
getPreferredEditorMode, setPreferredEditorMode
 
Methods inherited from interface javax.rad.model.ui.ICellEditor
createCellEditorHandler
 
Methods inherited from interface javax.rad.ui.IAlignmentConstants
getHorizontalAlignment, getVerticalAlignment, setHorizontalAlignment, setVerticalAlignment
 

Field Detail

autoTableHeaderVisibility

protected boolean autoTableHeaderVisibility
True, if header should be visible depending of column number.


additionalCondition

protected ICondition additionalCondition
The additional condition.


columnView

protected ColumnView columnView
The ColumnView.


displayReferencedColumnName

protected String displayReferencedColumnName
The name of the display referenced column.


displayConcatMask

protected String displayConcatMask
The display concat mask.


linkReference

protected ReferenceDefinition linkReference
The link reference.


popupSize

protected IDimension popupSize
The size used for the popup.


searchColumnMapping

protected ColumnMapping searchColumnMapping
The ColumnMapping.


searchTextAnywhere

protected boolean searchTextAnywhere
If the text should be searched anywhere inside a column.


searchInAllTableColumns

protected boolean searchInAllTableColumns
If the text should be searched in all visible table columns.


sortByColumnName

protected boolean sortByColumnName
If the values should be sorted by column name.


tableHeaderVisible

protected boolean tableHeaderVisible
If the table header should be visible.


tableReadOnly

protected boolean tableReadOnly
If the table should be read-only.


validationEnabled

protected boolean validationEnabled
If only values from the table are allowed.

Constructor Detail

AbstractLinkedCellEditor

protected AbstractLinkedCellEditor()
Creates a new instance of AbstractLinkedCellEditor.

Method Detail

getAdditionalCondition

public ICondition getAdditionalCondition()
Gets the additional condition, that is combined with And.

Specified by:
getAdditionalCondition in interface ILinkedCellEditor
Returns:
the additional condition.

getColumnView

public ColumnView getColumnView()
Returns the ColumnView displayed by this control. If null is set, the default ColumnView is shown.

Specified by:
getColumnView in interface ILinkedCellEditor
Returns:
the ColumnView.
See Also:
ILinkedCellEditor.setColumnView(javax.rad.model.ColumnView)

getDisplayReferencedColumnName

public String getDisplayReferencedColumnName()
Gets the name of the referenced column that is used for displaying values. These values will be displayed instead of the default-shown values. Will return null if no display referenced column name is set and the editors default behavior decides what is displayed.

Specified by:
getDisplayReferencedColumnName in interface ILinkedCellEditor
Returns:
the name of the display referenced column. null if not set.

getDisplayConcatMask

public String getDisplayConcatMask()
Gets the concat mask that is used for displaying values. All visible columns shown in the popup will be concatinated with the given mask. e.g. " “, " - “, ... will lead in “AT 1220 Vienna”, “AT - 1220 - Vienna”

Specified by:
getDisplayConcatMask in interface ILinkedCellEditor
Returns:
the concat mask that is used for displaying values. null if not set.

getLinkReference

public ReferenceDefinition getLinkReference()
Gets reference definition that defines the link.

Specified by:
getLinkReference in interface ILinkedCellEditor
Returns:
the link reference definition.

getPopupSize

public IDimension getPopupSize()
Gets the size of the Popup window using a Dimension object. Null means, that the Popup window opens with preferredSize.

Specified by:
getPopupSize in interface ILinkedCellEditor
Returns:
the Popup size of.

getSearchColumnMapping

public ColumnMapping getSearchColumnMapping()
Gets search columns for which should be searched in the linked cell.

Specified by:
getSearchColumnMapping in interface ILinkedCellEditor
Returns:
search columns for which should be searched in the linked cell.

isSearchTextAnywhere

public boolean isSearchTextAnywhere()
True, if the text is searched anywhere inside a column. Default is true.

Specified by:
isSearchTextAnywhere in interface ILinkedCellEditor
Returns:
True, if the text is searched anywhere inside a column.

isSearchInAllTableColumns

public boolean isSearchInAllTableColumns()
True, if the text is searched in all visible table columns. Default is false.

Specified by:
isSearchInAllTableColumns in interface ILinkedCellEditor
Returns:
True, if the text is searched in all visible table columns.

isSortByColumnName

public boolean isSortByColumnName()
True, if the linked cell editor should sort by the column name it is editing. Default is false.

Specified by:
isSortByColumnName in interface ILinkedCellEditor
Returns:
true, if the linked cell editor should sort by the column name it is editing.

isTableHeaderVisible

public boolean isTableHeaderVisible()
The header of a table can't be hidden.

Specified by:
isTableHeaderVisible in interface ILinkedCellEditor
Returns:
always false.

isTableReadonly

public boolean isTableReadonly()
Gets whether the table in the popup readonly.

Specified by:
isTableReadonly in interface ILinkedCellEditor
Returns:
the table in the popup readonly.

isValidationEnabled

public boolean isValidationEnabled()
Gets true, if only values from the table are allowed.

Specified by:
isValidationEnabled in interface ILinkedCellEditor
Returns:
true, if only values from the table are allowed.

setAdditionalCondition

public void setAdditionalCondition(ICondition pCondition)
Sets the additional condition, that is combined with And.

Specified by:
setAdditionalCondition in interface ILinkedCellEditor
Parameters:
pCondition - the additional condition.

setColumnView

public void setColumnView(ColumnView pColumnView)
Sets the ColumnView displayed by this control. If null is set, the default ColumnView is shown.

Specified by:
setColumnView in interface ILinkedCellEditor
Parameters:
pColumnView - the ColumnView
See Also:
ILinkedCellEditor.getColumnView()

setDisplayReferencedColumnName

public void setDisplayReferencedColumnName(String pDisplayReferencedColumnName)
Sets the name of the referenced column that is used for displaying values. These values will be displayed instead of the default-shown values.

Specified by:
setDisplayReferencedColumnName in interface ILinkedCellEditor
Parameters:
pDisplayReferencedColumnName - the name of the display referenced column.

setDisplayConcatMask

public void setDisplayConcatMask(String pDisplayConcatMask)
Gets the concat mask that is used for displaying values. All visible columns shown in the popup will be concatinated with the given mask. e.g. " “, " - “, ... will lead in “AT 1220 Vienna”, “AT - 1220 - Vienna”

Specified by:
setDisplayConcatMask in interface ILinkedCellEditor
Parameters:
pDisplayConcatMask - the concat mask that is used for displaying values. null if not set.

setLinkReference

public void setLinkReference(ReferenceDefinition pReferenceDefinition)
Sets reference definition that defines the link.

Specified by:
setLinkReference in interface ILinkedCellEditor
Parameters:
pReferenceDefinition - the link reference definition.

setPopupSize

public void setPopupSize(IDimension pPopupSize)
Sets the size of the Popup window using a Dimension object. Null means, that the Popup window opens with preferredSize.

Specified by:
setPopupSize in interface ILinkedCellEditor
Parameters:
pPopupSize - the Popup size of.

setSearchColumnMapping

public void setSearchColumnMapping(ColumnMapping pSearchColumnNames)
Sets search columns for which should be searched in the linked cell.

Specified by:
setSearchColumnMapping in interface ILinkedCellEditor
Parameters:
pSearchColumnNames - search columns for which should be searched in the linked cell.

setSearchTextAnywhere

public void setSearchTextAnywhere(boolean pSearchTextAnywhere)
True, if the text is searched anywhere inside a column. Default is true.

Specified by:
setSearchTextAnywhere in interface ILinkedCellEditor
Parameters:
pSearchTextAnywhere - True, if the text is searched anywhere inside a column.

setSearchInAllTableColumns

public void setSearchInAllTableColumns(boolean pSearchInAllTableColumns)
True, if the text is searched in all visible table columns. Default is false.

Specified by:
setSearchInAllTableColumns in interface ILinkedCellEditor
Parameters:
pSearchInAllTableColumns - True, if the text is searched in all visible table columns.

setSortByColumnName

public void setSortByColumnName(boolean pSortByColumnName)
True, if the linked cell editor should sort by the column name it is editing. Default is false.

Specified by:
setSortByColumnName in interface ILinkedCellEditor
Parameters:
pSortByColumnName - true, if the linked cell editor should sort by the column name it is editing.

setTableHeaderVisible

public void setTableHeaderVisible(boolean pTableHeaderVisible)
Does nothing, the header of a table can't be hidden.

Specified by:
setTableHeaderVisible in interface ILinkedCellEditor
Parameters:
pTableHeaderVisible - ignored.

setTableReadonly

public void setTableReadonly(boolean pTableReadonly)
Sets the table in the popup readonly.

Specified by:
setTableReadonly in interface ILinkedCellEditor
Parameters:
pTableReadonly - sets the table in the popup readonly.

setValidationEnabled

public void setValidationEnabled(boolean pValidationEnabled)
Sets true, if only values from the table are allowed.

Specified by:
setValidationEnabled in interface ILinkedCellEditor
Parameters:
pValidationEnabled - true, if only values from the table are allowed.

isDirectCellEditor

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

Specified by:
isDirectCellEditor in interface ICellEditor
Overrides:
isDirectCellEditor in class AbstractComboCellEditor
Returns:
the ICellEditorHandler.

getDefaultHorizontalAlignment

public int getDefaultHorizontalAlignment(IDataRow pDataRow,
                                         String pColumnName)
Gets the default horizontal alignment based on data type. If default alignment is unknown, ALIGN_LEFT is returned.

Parameters:
pDataRow - the data row
pColumnName - the column name
Returns:
the default horizontal alignment

getDisplayValue

protected String getDisplayValue(IDataRow pDataRow,
                                 String pColumnName)
                          throws ModelException
Gets the correct display value for the given row and column.

Parameters:
pDataRow - the data row
pColumnName - the column
Returns:
the display value.
Throws:
ModelException - if it fails.

getDisplayValueFromRow

protected String getDisplayValueFromRow(IDataRow pDataRow)
                                 throws ModelException
Gets the display value depending on displayConcatMask or displayReferencedColumnName.

Parameters:
pDataRow - the data row.
Returns:
the display value depending on displayConcatMask or displayReferencedColumnName.
Throws:
ModelException - the model Exception.

getClearColunms

protected String[] getClearColunms(IDataRow pDataRow,
                                   String pColumnName)
                            throws ModelException
Searches for columns, that should not be cleared, if the value of this linked cell editor is cleared.

Parameters:
pDataRow - the data row
pColumnName - the column name
Returns:
do not clear columns.
Throws:
ModelException - if it fails.

getAdditionalClearColumns

protected String[] getAdditionalClearColumns(IDataRow pDataRow)
                                      throws ModelException
Searches for additional columns to be cleared on save.

Parameters:
pDataRow - the data row.
Returns:
additional clear columns.
Throws:
ModelException - if it fails.

getAllSearchColumns

protected String[] getAllSearchColumns(ColumnMapping pSearchColumnMapping,
                                       IDataRow pDataRow,
                                       ICondition pCondition)
Gets all search columns using the given data row as filter.

Parameters:
pSearchColumnMapping - the columnMapping.
pDataRow - the data row.
pCondition - the additional condition.
Returns:
the list of all found condition columns.

getWildCardString

protected String getWildCardString(Object pItem)
Creates a search string.

Parameters:
pItem - item
Returns:
a search string.

getSearchCondition

protected ICondition getSearchCondition(IDataRow pDataRow,
                                        ICondition pCondition)
Creates a Condition including the search columns.

Parameters:
pDataRow - the base data row.
pCondition - the base condition.
Returns:
a Condition including the search columns.

getItemSearchCondition

protected ICondition getItemSearchCondition(boolean pSearchWildCard,
                                            String pRelevantSearchColumnName,
                                            Object pItem)
Gets the search condition for the input item.

Parameters:
pSearchWildCard - true, if wildcard search should be done.
pRelevantSearchColumnName - the relevant search column.
pItem - the item to search.
Returns:
the search condition for the input item.


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.