Package nl.gx.webmanager.cms.element
Interface TableElement
-
- All Superinterfaces:
DelegatedControllerAware
,Element
,Presentable
,Wrapper
@Indexable public interface TableElement extends Element
Representation of table element.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
TableElement.Alignment
Alignment definition for the table as a whole.
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
addColumn()
Adds a column for every existing row.void
addRow()
Adds a row for every existing column.String
getAlign()
Deprecated.TableElement.Alignment
getAlignment()
Gets the alignment for the table.String[]
getColumnWidths()
Returns an array container all column widths in the order of existence.String
getLinkCode()
Returns the code of the related link assigned to the table as a whole.TableRow[]
getTableRows()
Returns all the rows of the table.String[]
getTableWidths()
Deprecated.String
getWidth()
Returns the width.boolean
isFirstColumnHeader()
Returns whether the first column is defined as a header.boolean
isFirstRowHeader()
Returns whether the first row is defined as a header.void
removeColumn(int index)
Removes the column with indicated index.void
removeRow(int index)
Removes the row with indicated index.void
setAlignment(TableElement.Alignment alignment)
Sets the alignment for the table.void
setCellContent(int columnIndex, int rowIndex, String content)
Sets the indicated cell by row and column index with content.void
setColumnWidths(String[] columnWidths)
Sets the widths for each column defined.void
setFirstColumnIsHeader(boolean isFirstColumnHeader)
Sets a prarameter to indicate wether the first column is to be shown as header.void
setFirstRowIsHeader(boolean isFirstRowHeader)
Sets a prarameter to indicate wether the first row is to be shown as header.void
setLinkCode(String code)
Sets the internal link code needed to place an internal link tag around the table.void
setWidth(String width)
Sets the width for the table either in percentages of pixels.-
Methods inherited from interface nl.gx.webmanager.springmvc.DelegatedControllerAware
getDelegatedController, setDelegatedController
-
Methods inherited from interface nl.gx.webmanager.cms.element.Element
cleanup, copy, getAnchorElement, getEditElementHeader, getElementHolder, getHeader, getIcon, getId, getIdentity, getLastModifiedDate, getMediaItemVersion, getPageModel, getPageModelElement, getPageVersion, getPersonalizationAttributes, getPersonalizationItems, getPersonalizationOperator, getReferencedContentItems, getTitle, getTypeIdentifier, getWebsite, isAuthorized, setAuthorized, setDefaultPresentation, setEditElementHeader, setHeader, setIcon, setIdentity, setLastModifiedDate, setPersonalizationAttributes, setPersonalizationItems, setPersonalizationOperator, setTitle
-
Methods inherited from interface nl.gx.webmanager.cms.core.Presentable
getPresentation, getPresentationVariant, render, render, setPresentation, setPresentationVariant
-
-
-
-
Method Detail
-
addColumn
void addColumn()
Adds a column for every existing row. If not the first this column will be added at the end.
-
removeColumn
void removeColumn(int index)
Removes the column with indicated index. The index is zero bound.- Parameters:
index
- the zero bound index of the column to be removed
-
addRow
void addRow()
Adds a row for every existing column. If not the first this row will be added at the end .
-
removeRow
void removeRow(int index)
Removes the row with indicated index. The index is zero bound.- Parameters:
index
- the zero bound index of the row to be removed
-
setCellContent
void setCellContent(int columnIndex, int rowIndex, String content)
Sets the indicated cell by row and column index with content. Existing content is replaced.- Parameters:
columnIndex
- the zero bound index of the columnrowIndex
- the zero bound index of the rowcontent
- The content
-
getTableRows
@ReferDocument(inheritLanguage=true) TableRow[] getTableRows()
Returns all the rows of the table.- Returns:
- All rows of the table.
-
isFirstRowHeader
boolean isFirstRowHeader()
Returns whether the first row is defined as a header. Returns true if the horizontal headers checkbox of the element is checked, false otherwise. If the first row is a header, then the presentation for the tableElement should generate every column of the first row with a th tag and scope="col" attribute.- Returns:
- whether the first row is defined as a header
-
setFirstRowIsHeader
void setFirstRowIsHeader(boolean isFirstRowHeader)
Sets a prarameter to indicate wether the first row is to be shown as header.- Parameters:
isFirstRowHeader
- is the first row a header
-
isFirstColumnHeader
boolean isFirstColumnHeader()
Returns whether the first column is defined as a header. Returns true if the vertical headers checkbox of the element is checked, false otherwise. If the first column is a header, then the presentation for the tableElement should generate the first column of every row with the scope="row" attribute.- Returns:
- whether the first column is defined as a header
-
setFirstColumnIsHeader
void setFirstColumnIsHeader(boolean isFirstColumnHeader)
Sets a prarameter to indicate wether the first column is to be shown as header.- Parameters:
isFirstColumnHeader
- is the first columns a header
-
getWidth
String getWidth()
Returns the width.- Returns:
- The width for the table in "30%" or "250" format; empty if no width was specified.
-
setWidth
void setWidth(String width)
Sets the width for the table either in percentages of pixels. Percentages are to be entered as 'xx%' like '30%'. If the percent sign is omitted, the assumption is made that the column width is expressed in pixels.- Parameters:
width
- The width to be set
-
getAlign
@Deprecated String getAlign()
Deprecated.Returns the alignment string.- Returns:
- The alignment string for the table.
-
getAlignment
TableElement.Alignment getAlignment()
Gets the alignment for the table.- Returns:
- the alignment for the table.
-
setAlignment
void setAlignment(TableElement.Alignment alignment)
Sets the alignment for the table.- Parameters:
alignment
- the alignment for the image.
-
getTableWidths
@Deprecated String[] getTableWidths()
Deprecated.Returns the array containing all defined widths for columns.- Returns:
- An array containing all defined widths for columns.
-
getColumnWidths
String[] getColumnWidths()
Returns an array container all column widths in the order of existence.- Returns:
- An array containing all defined widths for columns.
-
setColumnWidths
void setColumnWidths(String[] columnWidths)
Sets the widths for each column defined. The number of widths should match the number of columns. Percentages should be entered following a % sign ie '20%'. If the percent sign is omitted, the assumption is made that the column width is expressed in pixels.- Parameters:
columnWidths
- The widths of each column
-
getLinkCode
String getLinkCode()
Returns the code of the related link assigned to the table as a whole.- Returns:
- The code which is assigned to the related link.
-
setLinkCode
void setLinkCode(String code)
Sets the internal link code needed to place an internal link tag around the table.- Parameters:
code
- the internal link code needed to place an internal link tag around the table.
-
-