|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.arsdigita.bebop.Completable
com.arsdigita.bebop.SimpleComponent
com.arsdigita.bebop.table.TableColumn
One column in a table. The TableColumn
stores important
display-related information about a table column, such as the column
header, the renderers for the column header and ordinary cells in this
column and from which column in the table model values should be taken
when rendering table cells. The set of table columns for a table is
maintained by a TableColumnModel
.
TableColumn
allows the column ordering to be different
between the underlying TableModel
and the view presented by the
Table
: each column contains a modelIndex
property. This is the column that is retrieved from the
TableModel
when the values are displayed, regardless of the
position of the TableColumn
in the
TableColumnModel
. This makes it possible to display the
same table model in several tables with reordered or omitted columns.
The TableColumn
stores also the value and key used for
the header of the column. These objects are passed to the header cell
renderer when the header of the table is rendered. The value is usually
used to generate the visible information for the table header, and is
often a string. The key is usually used to identify the underlying
object, or to just identify the column, and can be any object whose
toString()
method returns a representation that can be
included in a URL. In the simplest case, this may just be an
Integer
containing the index of the column in the column
model.
Table
,
TableColumnModel
Field Summary | |
static String |
versionId
|
Fields inherited from class com.arsdigita.bebop.SimpleComponent |
m_attr |
Fields inherited from interface com.arsdigita.bebop.Component |
BEBOP_XML_NS, CLASS, ID, ON_CLICK, STYLE |
Constructor Summary | |
TableColumn()
Creates a new table column with modelIndex 0 and header
value and key equal to null . |
|
TableColumn(int modelIndex)
Creates a new table column with the given modelIndex and
header value and key equal to null . |
|
TableColumn(int modelIndex,
Object value)
Creates a new table column with the given modelIndex and
header value. |
|
TableColumn(int modelIndex,
Object value,
Object key)
Creates a new table column with the given modelIndex and
header value and key. |
Method Summary | |
void |
exportCellAttributes(Element e)
Add all the XML attributes for this column. |
void |
generateXML(PageState s,
Element e)
Throw an UnsupportedOperationException . |
TableCellRenderer |
getCellRenderer()
Return the renderer used for the cells in this column. |
Object |
getHeaderKey()
Get the key used to identify the header of this column. |
TableCellRenderer |
getHeaderRenderer()
Return the renderer used for the column header. |
Object |
getHeaderValue()
Get the display value used for the header. |
int |
getModelIndex()
Get the index of the column from which values are taken in the TableModel . |
String |
getWidth()
Get the width for this column. |
void |
setAlign(String v)
Set the horizontal alignment this column. |
void |
setCellRenderer(TableCellRenderer v)
Set the renderer used for cells in this column. |
void |
setClassAttr(String c)
Sets the class attribute for the column's cells. |
void |
setHeadAlign(String v)
Set the horizontal alignment this column's header. |
void |
setHeadClassAttr(String c)
Sets the class attribute for the column's header cell. |
void |
setHeaderKey(Object key)
Set the key used to identify the header of this column. |
void |
setHeaderRenderer(TableCellRenderer v)
Set the renderer used for the column header. |
void |
setHeaderValue(Object value)
Set the display value for the header. |
void |
setHeadStyleAttr(String style)
Sets the style attribute for the column's header cell. |
void |
setHeadVAlign(String v)
Set the vertical alignment this column's header. |
void |
setModelIndex(int v)
Set the index of the column in the TableModel from which the
values are taken when this column is rendered. |
void |
setStyleAttr(String style)
Sets the style attribute for the column's cells. |
void |
setVAlign(String v)
Set the vertical alignment this column. |
void |
setWidth(String v)
Set the width of this column. |
Methods inherited from class com.arsdigita.bebop.SimpleComponent |
children, clone, exportAttributes, getAttribute, getClassAttr, getIdAttr, getKey, getMetaDataAttribute, getStyleAttr, hasAttributes, isLocked, isVisible, lock, register, register, respond, setAttribute, setIdAttr, setKey, setMetaDataAttribute, setVisible |
Methods inherited from class com.arsdigita.bebop.Completable |
addCompletionListener, fireCompletionEvent |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.arsdigita.util.Lockable |
isLocked, lock |
Field Detail |
public static final String versionId
Constructor Detail |
public TableColumn()
modelIndex
0 and header
value and key equal to null
.
public TableColumn(int modelIndex)
modelIndex
and
header value and key equal to null
.
modelIndex
- the index of the column in the table model from
which to retrieve valuespublic TableColumn(int modelIndex, Object value)
modelIndex
and
header value. The header key is equal to null
.
modelIndex
- the index of the column in the table model from
which to retrieve values.value
- the value for the column header.public TableColumn(int modelIndex, Object value, Object key)
modelIndex
and
header value and key.
modelIndex
- the index of the column in the table model from
which to retrieve values.value
- the value for the column header.key
- the key for the column header.Method Detail |
public final TableCellRenderer getHeaderRenderer()
null
by default, in which case the default renderer for
the TableHeader
of the table to which this column belongs is
used.
public void setHeaderRenderer(TableCellRenderer v)
v
- the new renderer for the column header.getHeaderRenderer()
,
getCellRenderer()
public final TableCellRenderer getCellRenderer()
null
by default, in which case the default renderer of
the table
to which this column
belongs is used.
public void setCellRenderer(TableCellRenderer v)
v
- the new renderer for the cells in this column.getCellRenderer()
,
getHeaderRenderer()
public final Object getHeaderValue()
public void setHeaderValue(Object value)
value
- the new display value for the header.getHeaderValue()
public final Object getHeaderKey()
Integer
containing the index of
the column.
public void setHeaderKey(Object key)
key
- the new key for identifying the header of this column.getHeaderKey()
public final int getModelIndex()
TableModel
.
setModelIndex
public void setModelIndex(int v)
TableModel
from which the
values are taken when this column is rendered.
v
- the new index of the column in the table model from which to
take values.public String getWidth()
setWidth
public void setWidth(String v)
v
is added as an
attribute to the XML element for this column in the table header.
v
- the width of this columnpublic void setAlign(String v)
v
is added as an attribute to the XML element for each cell in this column
v
- the width of this columnpublic void setHeadAlign(String v)
v
is added as an attribute to the XML element for
the column's header cell.
v
- the width of this columnpublic void setVAlign(String v)
v
is added as an attribute to the XML element for each cell in this column
v
- the width of this columnpublic void setHeadVAlign(String v)
v
is added as an attribute to the XML element for
this column's header cell.
v
- the width of this columnpublic void setStyleAttr(String style)
style
should be a valid CSS style, since
its value will be copied verbatim to the output and appear as a
style attribute in the top level XML or HTML output
element.
setStyleAttr
in interface Component
setStyleAttr
in class SimpleComponent
style
- a valid CSS style description for use in the
style attribute of an HTML tagpublic void setHeadStyleAttr(String style)
style
should be a valid CSS style, since its
value will be copied verbatim to the output and appear as a
style attribute in the top level XML or HTML output
element.
style
- a valid CSS style description for use in the
style attribute of an HTML tagpublic void setClassAttr(String c)
style
should be the name of a defined CSS
class, since its value will be copied verbatim to the output
and appear as a class attribute in the top level XML
or HTML output element.
setClassAttr
in interface Component
setClassAttr
in class SimpleComponent
c
- a valid XML namepublic void setHeadClassAttr(String c)
style
should be the name of a defined CSS
class, since its value will be copied verbatim to the output
and appear as a class attribute in the top level XML
or HTML output element.
public void exportCellAttributes(Element e)
e
- the XML element to which attributes will be added.public void generateXML(PageState s, Element e)
UnsupportedOperationException
. This method can
only be called if the table column is not properly contained in a
table.
generateXML
in interface Component
generateXML
in class SimpleComponent
s
- represents the current requeste
- the parent element
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |