com.sapportals.htmlb.table

Class TableColumn

java.lang.Object
  extended bycom.sapportals.htmlb.table.TableColumn

public class TableColumn
extends Object

A TableColumn represents all the attributes of a column in a TableView, such as identifier, linkColumnKey, width. *

Copyright 2004 SAP AG


Constructor Summary
TableColumn(TableViewModel model, String title)
          constructs a TableColumn with the given title, identifier, type and the width
TableColumn(TableViewModel model, String title, String identifier)
          constructs a TableColumn with the given title, identifier, type and the width
TableColumn(TableViewModel model, String title, String identifier, TableColumnType type)
          constructs a TableColumn with the given title, identifier, type and the width
TableColumn(TableViewModel model, String title, String identifier, TableColumnType type, DataType dataType)
          constructs a TableColumn with the given title, identifier, type and the width
TableColumn(TableViewModel model, String title, String identifier, TableColumnType type, DataType dataType, String width)
          constructs a TableColumn with the given title, identifier, type and the width
TableColumn(TableViewModel model, String title, String identifier, TableColumnType type, DataType dataType, String width, String linkColumnKey)
          constructs a TableColumn with the given title, identifier, type, width and the key for link column
TableColumn(TableViewModel model, String title, String identifier, TableColumnType type, DataType dataType, String width, String linkColumnKey, boolean wrapping)
          constructs a TableColumn with the given title, identifier, type, width and the key for link column
TableColumn(TableViewModel model, String title, String identifier, TableColumnType type, DataType dataType, String width, String linkColumnKey, boolean wrapping, String onItemClick)
          constructs a TableColumn with the given title, identifier, type, width and the key for link column
 
Method Summary
 void addSourceFlavour(String flavour)
          adds a flavour to the dragSources of the column cells.
 void addTargetFlavour(String flavour)
          adds a flavour to the dropTargets of the column cells.
 CellHAlign getCellHAlignment(int rowIndex)
          returns the horizontal alignment for the cell at rowIndex and columnIndex
 TableColumnType getCellType(int rowIndex)
          returns the type for the cell at rowIndex
 CellVAlign getCellVAlignment(int rowIndex)
          returns the vertical alignment for the cell at rowIndex and columnIndex
 DataType getDataType()
          returns the data type of the column
 Scope getDragScope()
          the scope determines if drag-and-drop is possible only inside the current form or in the whole browser.
 DropTargetDesign getDropTargetDesign()
          gets the design of the dropTargets during a drag-and-drop operation.
 String getIdentifier()
          returns the identifier of the column
 int getIndex()
          returns the index of this column Returns -1 if the column cannot be found in the table model
 String getLinkClickTarget()
          returns the target for a link column
 String getLinkColumnKey()
          returns the key of the link column
 String getOnCellClick()
          gets the event handler for the cell click event
 String getOnClientCellClick()
          gets the event handler for the client cell click event
 String getOnDrop()
          retrieves the event handler for the DropEvent.
 String getOnHeaderSort()
          returns the method name of handling the sort event
 String getOnItemClick()
          returns the event handler for a button or link click event
 TableSortState getSortState()
          returns the sort state of the column
 ArrayList getSourceFlavours()
          retrieves the list of flavours from the dragSources of the column cells.
 ArrayList getTargetFlavours()
          retrieves the list of flavours from the dropTargets of the column cells.
 String getTitle()
          returns the title of the column
 String getTooltipColumnKey()
          returns the tooltip column for this column
 String getTooltipForColumnHeader()
          returns the user defined tooltip for column header
 TableColumnType getType()
          returns the column type
 String getUnitColumnKey()
          returns the unit column key
 AbstractDataType getValueAt(int row)
          returns the value at row
 String getWidth()
          returns the width of the column
 boolean isCellDisabled(int rowIndex)
          returns if the component in a cell should be disabled or not Note: currently supported component is: InputField
 boolean isCellInvalid(int rowIndex)
          returns if the component in a cell contains an invalid value or not Note: currently supported component is: InputField
 boolean isCellsDragable()
          identifies if the cells of a column are dragable
 boolean isEncode()
          returns if the content of the column should be rendered as normal text or rawtext
 boolean isEncodeHeaderCell()
          returns if the content of the column header should be rendered as normal text or rawtext
 boolean isMonospaced()
           
 boolean isWrapping()
          determines if wrapping is allowed for this column.
 void removeAllSourceFlavours()
          removes all flavours from the dragSources of the column cells.
 void removeAllTargetFlavours()
          removes all flavours from the dropTargets of the column cells.
 void removeSourceFlavour(String flavour)
          removes a flavour from the dragSources of the column cells.
 void removeTargetFlavour(String flavour)
          removes a flavour from the dropTargets of the column cells.
 void setAppendUnit(boolean useIt)
          sets if the content of the column should be concatenated with the content of the unit column
 void setCellDisabled(int rowIndex, boolean disabled)
          sets the component to disabled or enabled for the cell at rowIndex and columnIndex
 void setCellHAlignment(int rowIndex, CellHAlign hAlignment)
          sets the horizontal alignment for the cell at rowIndex and columnIndex
 void setCellInvalid(int rowIndex, boolean invalid)
          sets the component to invalid or not for the cell at rowIndex and columnIndex
 void setCellsDragable(boolean dragable)
          set dragable to true to allow dragging of objects inside a column cell
 void setCellType(int rowIndex, TableColumnType type)
          sets the style for the cell at rowIndex
 void setCellVAlignment(int rowIndex, CellVAlign vAlignment)
          sets the vertical alignment for the cell at rowIndex and columnIndex
 void setDataType(DataType dataType)
          sets the data type of the column
 void setDragScope(Scope scope)
          the scope determines if drag-and-drop is possible only inside the current form or in the whole browser.
 void setDropTargetDesign(DropTargetDesign dropTargetDesign)
          sets the design of the dropTargets during a drag-and-drop operation.
 void setEncode(boolean encode)
          determine if the content of the column should be rendered as normal text or rawtext
 void setEncodeHeaderCell(boolean encodeHeaderCell)
          determine if the content of the column header cell should be rendered as normal text or rawtext
 void setIdentifier(String identifier)
          sets the identifier of the column
 void setLinkClickTarget(String linkClickTarget)
          sets the target for a link column
 void setLinkColumnKey(String linkColumnKey)
          sets the link column key
 void setMonospaced(boolean monospaced)
           
 void setOnCellClick(String onCellClick)
          sets the event handler for the cell click event
 void setOnClientCellClick(String onClientCellClick)
          sets the event handler for the client cell click event
 void setOnDrop(String onDrop)
          sets the event handler for the DropEvent.
 void setOnHeaderSort(String onHeaderSort)
          sets the event handler for sort event
 void setOnItemClick(String onItemClick)
          sets the event handler for a button or link click event
 void setSortState(TableSortState sortState)
          sets the sprt state of the column.
 void setTitle(String title)
          sets the title for the column
 void setTooltipColumnKey(String tooltipColumnKey)
          sets a column as the tooltip column.
 void setTooltipForColumnHeader(String tooltipForColumnHeader)
          sets the tooltip for column header
 void setType(TableColumnType type)
          sets the column type Note: if the fields of the column should be displayed as input fields, the data in the input fields should be retrieved with the method com.sapportals.htmlb.rendering.PageContext#getDataForComponentId(String, String, int)
 void setUnitColumnKey(String unitColumnKey)
          sets the unit column key Note: to concatenate the content of the column with the content in the unit column and dispay them in one column, use the method #setAppendUnit(boolean) with the parameter value "true"
 void setWidth(String width)
          sets the width for the column
 void setWrapping(boolean wrapping)
          sets if wrapping is allowed for this column.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableColumn

public TableColumn(TableViewModel model,
                   String title)
constructs a TableColumn with the given title, identifier, type and the width

Parameters:
model - the TableViewModel to which this TableColumn belongs
title - the title for the column
See Also:
TableColumnType

TableColumn

public TableColumn(TableViewModel model,
                   String title,
                   String identifier)
constructs a TableColumn with the given title, identifier, type and the width

Parameters:
title -
identifier -
See Also:
TableColumnType

TableColumn

public TableColumn(TableViewModel model,
                   String title,
                   String identifier,
                   TableColumnType type)
constructs a TableColumn with the given title, identifier, type and the width

Parameters:
title -
identifier -
type -
See Also:
TableColumnType

TableColumn

public TableColumn(TableViewModel model,
                   String title,
                   String identifier,
                   TableColumnType type,
                   DataType dataType)
constructs a TableColumn with the given title, identifier, type and the width

Parameters:
title -
identifier -
type -
See Also:
TableColumnType

TableColumn

public TableColumn(TableViewModel model,
                   String title,
                   String identifier,
                   TableColumnType type,
                   DataType dataType,
                   String width)
constructs a TableColumn with the given title, identifier, type and the width

Parameters:
title -
identifier -
type -
width -
See Also:
TableColumnType

TableColumn

public TableColumn(TableViewModel model,
                   String title,
                   String identifier,
                   TableColumnType type,
                   DataType dataType,
                   String width,
                   String linkColumnKey)
constructs a TableColumn with the given title, identifier, type, width and the key for link column

Parameters:
title -
identifier -
type -
width -
linkColumnKey -
See Also:
TableColumnType

TableColumn

public TableColumn(TableViewModel model,
                   String title,
                   String identifier,
                   TableColumnType type,
                   DataType dataType,
                   String width,
                   String linkColumnKey,
                   boolean wrapping)
constructs a TableColumn with the given title, identifier, type, width and the key for link column

Parameters:
title -
identifier -
type -
width -
linkColumnKey -
wrapping -
See Also:
TableColumnType

TableColumn

public TableColumn(TableViewModel model,
                   String title,
                   String identifier,
                   TableColumnType type,
                   DataType dataType,
                   String width,
                   String linkColumnKey,
                   boolean wrapping,
                   String onItemClick)
constructs a TableColumn with the given title, identifier, type, width and the key for link column

Parameters:
title -
identifier -
type -
width -
linkColumnKey -
wrapping -
onItemClick -
See Also:
TableColumnType
Method Detail

getTitle

public String getTitle()
returns the title of the column

Returns:
the title of the column

setTitle

public void setTitle(String title)
sets the title for the column

Parameters:
title - the title of the column

getIdentifier

public String getIdentifier()
returns the identifier of the column

Returns:
the identifier of the column

setIdentifier

public void setIdentifier(String identifier)
sets the identifier of the column

Parameters:
identifier - the identifier(key) of the column

getType

public TableColumnType getType()
returns the column type

Returns:
the display type of the column
See Also:
TableColumnType

setType

public void setType(TableColumnType type)
sets the column type Note: if the fields of the column should be displayed as input fields, the data in the input fields should be retrieved with the method com.sapportals.htmlb.rendering.PageContext#getDataForComponentId(String, String, int)

Parameters:
type - the display type of the column
See Also:
TableColumnType

getDataType

public DataType getDataType()
returns the data type of the column

Returns:
the data type of the column
See Also:
DataType

setDataType

public void setDataType(DataType dataType)
sets the data type of the column

Parameters:
dataType - the data type of the column
See Also:
DataType

getWidth

public String getWidth()
returns the width of the column


setWidth

public void setWidth(String width)
sets the width for the column


getLinkColumnKey

public String getLinkColumnKey()
returns the key of the link column


setLinkColumnKey

public void setLinkColumnKey(String linkColumnKey)
sets the link column key


getTooltipColumnKey

public String getTooltipColumnKey()
returns the tooltip column for this column


setTooltipColumnKey

public void setTooltipColumnKey(String tooltipColumnKey)
sets a column as the tooltip column. If the current column should be displayed as a link column, the content in the column with name tooltipColumnKey will be displayed as the tooltip

Parameters:
tooltipColumnKey - the key of the column whose content should be displayed as tooltip

getUnitColumnKey

public String getUnitColumnKey()
returns the unit column key

Returns:
the name(key) of the column which should be used as the unit column for the current column

setUnitColumnKey

public void setUnitColumnKey(String unitColumnKey)
sets the unit column key Note: to concatenate the content of the column with the content in the unit column and dispay them in one column, use the method #setAppendUnit(boolean) with the parameter value "true"

Parameters:
unitColumnKey - the key(name) of the unit column

setAppendUnit

public void setAppendUnit(boolean useIt)
sets if the content of the column should be concatenated with the content of the unit column

Parameters:
useIt - when useIt=true, the content in the unit column will not be displayed seperately any more, instead they will be concatenated with the content in the current column

isEncode

public boolean isEncode()
returns if the content of the column should be rendered as normal text or rawtext


setEncode

public void setEncode(boolean encode)
determine if the content of the column should be rendered as normal text or rawtext


isEncodeHeaderCell

public boolean isEncodeHeaderCell()
returns if the content of the column header should be rendered as normal text or rawtext


setEncodeHeaderCell

public void setEncodeHeaderCell(boolean encodeHeaderCell)
determine if the content of the column header cell should be rendered as normal text or rawtext


getLinkClickTarget

public String getLinkClickTarget()
returns the target for a link column

Returns:
the target for the links in this column

setLinkClickTarget

public void setLinkClickTarget(String linkClickTarget)
sets the target for a link column

Parameters:
linkClickTarget - the target for the link in the current column

getOnCellClick

public String getOnCellClick()
gets the event handler for the cell click event

Returns:
the event action

setOnCellClick

public void setOnCellClick(String onCellClick)
sets the event handler for the cell click event

Parameters:
onCellClick - the event action

setOnClientCellClick

public void setOnClientCellClick(String onClientCellClick)
sets the event handler for the client cell click event

Parameters:
onClientCellClick - the event action

getOnClientCellClick

public String getOnClientCellClick()
gets the event handler for the client cell click event

Returns:
the event action

isWrapping

public boolean isWrapping()
determines if wrapping is allowed for this column. Default value is false.

Returns:
true is this column may wrap

setWrapping

public void setWrapping(boolean wrapping)
sets if wrapping is allowed for this column. Default value is false.

Parameters:
wrapping - true is this column may wrap

getOnItemClick

public String getOnItemClick()
returns the event handler for a button or link click event

Returns:
the event action

setOnItemClick

public void setOnItemClick(String onItemClick)
sets the event handler for a button or link click event


getValueAt

public AbstractDataType getValueAt(int row)
returns the value at row

Returns:
the value in the current column at row

getCellVAlignment

public CellVAlign getCellVAlignment(int rowIndex)
returns the vertical alignment for the cell at rowIndex and columnIndex

Parameters:
rowIndex - the index of the row
Returns:
the vertical alignment for the specified cell

setCellVAlignment

public void setCellVAlignment(int rowIndex,
                              CellVAlign vAlignment)
sets the vertical alignment for the cell at rowIndex and columnIndex

Parameters:
rowIndex - the index of the row
vAlignment - the vertical alignment of

getCellHAlignment

public CellHAlign getCellHAlignment(int rowIndex)
returns the horizontal alignment for the cell at rowIndex and columnIndex

Parameters:
rowIndex - the index of the row
Returns:
the horizontal alignment for the cell

setCellHAlignment

public void setCellHAlignment(int rowIndex,
                              CellHAlign hAlignment)
sets the horizontal alignment for the cell at rowIndex and columnIndex

Parameters:
rowIndex - the index of the row or -1 for setting the complete column

getCellType

public TableColumnType getCellType(int rowIndex)
returns the type for the cell at rowIndex

Parameters:
rowIndex - the index of the row
Returns:
the type of the specified cell in this collumn

setCellType

public void setCellType(int rowIndex,
                        TableColumnType type)
sets the style for the cell at rowIndex

Parameters:
rowIndex - the index of the row
type - the diyplay type for the specified cell in the column

isCellDisabled

public boolean isCellDisabled(int rowIndex)
returns if the component in a cell should be disabled or not Note: currently supported component is: InputField

Parameters:
rowIndex - the index of the row
Returns:
if the component in the specified cell should be disabled or not

setCellDisabled

public void setCellDisabled(int rowIndex,
                            boolean disabled)
sets the component to disabled or enabled for the cell at rowIndex and columnIndex

Parameters:
rowIndex - the index of the row

isCellInvalid

public boolean isCellInvalid(int rowIndex)
returns if the component in a cell contains an invalid value or not Note: currently supported component is: InputField

Parameters:
rowIndex - the index of the row
Returns:
if the component in the specified cell contains an invalid value

setCellInvalid

public void setCellInvalid(int rowIndex,
                           boolean invalid)
sets the component to invalid or not for the cell at rowIndex and columnIndex

Parameters:
rowIndex - the index of the row
invalid - true if the InputField contains an invalid value

getTooltipForColumnHeader

public String getTooltipForColumnHeader()
returns the user defined tooltip for column header


setTooltipForColumnHeader

public void setTooltipForColumnHeader(String tooltipForColumnHeader)
sets the tooltip for column header


getIndex

public int getIndex()
returns the index of this column Returns -1 if the column cannot be found in the table model


setCellsDragable

public void setCellsDragable(boolean dragable)
set dragable to true to allow dragging of objects inside a column cell

Parameters:
dragable - true or false

isCellsDragable

public boolean isCellsDragable()
identifies if the cells of a column are dragable


setDragScope

public void setDragScope(Scope scope)
the scope determines if drag-and-drop is possible only inside the current form or in the whole browser. For Netscape only the scope FORM is supported


getDragScope

public Scope getDragScope()
the scope determines if drag-and-drop is possible only inside the current form or in the whole browser. For Netscape only the scope FORM is supported


addSourceFlavour

public void addSourceFlavour(String flavour)
adds a flavour to the dragSources of the column cells. Flavours are used to identify possible dropTargets. Drag-and-Drop is only possible if the dragSource contains at least one flavour of the dropTarget. A flavour can be any string.

Parameters:
flavour - the flavour to add

removeSourceFlavour

public void removeSourceFlavour(String flavour)
removes a flavour from the dragSources of the column cells. Flavours are used to identify possible dropTargets. Drag-and-Drop is only possible if the dragSource contains at least one flavour of the dragTarget. A flavour can be any string.

Parameters:
flavour - the flavour to remove

removeAllSourceFlavours

public void removeAllSourceFlavours()
removes all flavours from the dragSources of the column cells. Flavours are used to identify possible dropTargets. Drag-and-Drop is only possible if the dragSource contains at least one flavour of the dropTarget. A flavour can be any string.


getSourceFlavours

public ArrayList getSourceFlavours()
retrieves the list of flavours from the dragSources of the column cells. Flavours are used to identify possible dropTargets. Drag-and-Drop is only possible if the dragSource contains at least one flavour of the dropTarget. A flavour can be any string.

Returns:
the list of flavours

addTargetFlavour

public void addTargetFlavour(String flavour)
adds a flavour to the dropTargets of the column cells. Flavours are used to identify possible dropTargets. Drag-and-Drop is only possible if the dragSource contains at least one flavour of the dropTarget. A flavour can be any string.

Parameters:
flavour - the flavour to add

removeTargetFlavour

public void removeTargetFlavour(String flavour)
removes a flavour from the dropTargets of the column cells. Flavours are used to identify possible dropTargets. Drag-and-Drop is only possible if the dragSource contains at least one flavour of the dropTarget. A flavour can be any string.

Parameters:
flavour - the flavour to remove

removeAllTargetFlavours

public void removeAllTargetFlavours()
removes all flavours from the dropTargets of the column cells. Flavours are used to identify possible dropTargets. Drag-and-Drop is only possible if the dragSource contains at least one flavour of the dropTarget. A flavour can be any string.


getTargetFlavours

public ArrayList getTargetFlavours()
retrieves the list of flavours from the dropTargets of the column cells. Flavours are used to identify possible dropTargets. Drag-and-Drop is only possible if the dragSource contains at least one flavour of the dragTarget. A flavour can be any string.

Returns:
the list of flavours

setDropTargetDesign

public void setDropTargetDesign(DropTargetDesign dropTargetDesign)
sets the design of the dropTargets during a drag-and-drop operation. if selectDropTargets is true, all possible dropTargets will be marked using the DropTargetDesign. Default is DropTargetDesign.BORDERED.

Parameters:
dropTargetDesign - design of the dropTargets during a drag-and-drop operation

getDropTargetDesign

public DropTargetDesign getDropTargetDesign()
gets the design of the dropTargets during a drag-and-drop operation. if selectDropTargets is true, all possible dropTargets will be marked using the DropTargetDesign. Default is DropTargetDesign.BORDERED.

Returns:
design of the dropTargets during a drag-and-drop operation

setOnDrop

public void setOnDrop(String onDrop)
sets the event handler for the DropEvent.

Parameters:
onDrop - event handler for the DropEvent.

getOnDrop

public String getOnDrop()
retrieves the event handler for the DropEvent.

Returns:
the event handler for the DropEvent.

isMonospaced

public boolean isMonospaced()

setMonospaced

public void setMonospaced(boolean monospaced)

getSortState

public TableSortState getSortState()
returns the sort state of the column

See Also:
TableSortState

setSortState

public void setSortState(TableSortState sortState)
sets the sprt state of the column. To get the sort icon and the sort event by clicking on this icon, pls use this method

See Also:
TableSortState

getOnHeaderSort

public String getOnHeaderSort()
returns the method name of handling the sort event


setOnHeaderSort

public void setOnHeaderSort(String onHeaderSort)
sets the event handler for sort event



Copyright 2006 SAP AG Complete Copyright Notice