Class CALSColSpec
java.lang.Object
ro.sync.ecss.extensions.commons.table.support.CALSColSpec
The column specification for a CALS table model
(e.g. DocBook or DITA tables).
-
Constructor Summary
ConstructorsConstructorDescriptionCALSColSpec
(int indexInDocument, int colNumber, boolean colNumberSpecified, String colName, String colWidth, Boolean colSep, Boolean rowSep) Constructor.CALSColSpec
(int indexInDocument, int colNumber, boolean colNumberSpecified, String colName, WidthRepresentation colWidth) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionCreates the XML fragment corresponding to the column specification obtained from thecolNumber
,colName
andcolWidth
fields.getAlign()
Get the align value specified on the colspec.Tests the presence of the column separator.int
int
Tests the presence of the row separator.boolean
void
Set the align value specified on the colspec.void
setColWidth
(WidthRepresentation colWidth) Set the newWidthRepresentation
corresponding to the column specification.toString()
Creates a String representation of the column specification.
-
Constructor Details
-
CALSColSpec
public CALSColSpec(int indexInDocument, int colNumber, boolean colNumberSpecified, String colName, String colWidth, Boolean colSep, Boolean rowSep) Constructor.- Parameters:
indexInDocument
- Index in colspec elements list.colNumber
- The number of the column. It is 1 based.colNumberSpecified
-true
if the column number was specified as an attributecolName
- The name of the column.colWidth
- The string representation of the column width as described in theWidthRepresentation
.colSep
-true
if the column separators are needed for that column,false
if not,null
if the framework default should apply. For instance Docbook has the colsep on true by default, while DITA on false.rowSep
-true
if the row separators are needed for that column,false
if not,null
if the framework default should apply. For instance Docbook has the rowsep on true by default, while DITA on false.
-
CALSColSpec
public CALSColSpec(int indexInDocument, int colNumber, boolean colNumberSpecified, String colName, WidthRepresentation colWidth) Constructor. The rowsep and colsep are set to null, i.e. the document type default.- Parameters:
indexInDocument
- Index in colspec elements list.colNumber
- The number of this column. It is 1 based.colNumberSpecified
-true
if the column number was specified as an attributecolName
- The name of this column.colWidth
- The column width representation.
-
-
Method Details
-
getColSep
Tests the presence of the column separator.- Returns:
true
if the separator should be painted at the right of the cell,false
if no separator is needed, ornull
if the default specified by the document type should be applied. For instance in Docbook, the default value istrue
while in DITA isfalse
. If the cell is the last in the row, this value is disregarded.
-
getRowSep
Tests the presence of the row separator.- Returns:
true
if the separator should be painted below the cell,false
if no separator is needed, ornull
if the default specified by the document type should be applied. For instance in Docbook, the default value istrue
while in DITA isfalse
. If the cell is the in the last row, this value is disregarded.
-
isColNumberSpecified
public boolean isColNumberSpecified()- Returns:
- Returns the colNumberSpecified.
-
getIndexInDocument
public int getIndexInDocument()- Returns:
- Returns the indexInDocument.
-
getColumnNumber
public int getColumnNumber()- Returns:
- The column number. It is 1 based.
-
getColumnName
- Returns:
- The name of the column.
-
getColWidth
- Returns:
- Returns the column width representation.
-
toString
Creates a String representation of the column specification. -
createXMLFragment
Creates the XML fragment corresponding to the column specification obtained from thecolNumber
,colName
andcolWidth
fields.
The general format of the generated fragment is:
<colspec colnum="integer_value" colname="string_value" colwidth="string_value" xmlns="URI"/>
- Parameters:
ns
- The namespace URI of the table element. It can benull
.- Returns:
- The XML fragment corresponding to the column specification.
-
setColWidth
Set the newWidthRepresentation
corresponding to the column specification.- Parameters:
colWidth
- The column width to be set.
-
getAlign
Get the align value specified on the colspec.- Returns:
- Returns the align value.
-
setAlign
Set the align value specified on the colspec.- Parameters:
align
- The textAlign to set.
-