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,colNameandcolWidthfields.getAlign()Get the align value specified on the colspec.Tests the presence of the column separator.intintTests the presence of the row separator.booleanvoidSet the align value specified on the colspec.voidsetColWidth(WidthRepresentation colWidth) Set the newWidthRepresentationcorresponding 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-trueif 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-trueif the column separators are needed for that column,falseif not,nullif the framework default should apply. For instance Docbook has the colsep on true by default, while DITA on false.rowSep-trueif the row separators are needed for that column,falseif not,nullif 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-trueif 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:
trueif the separator should be painted at the right of the cell,falseif no separator is needed, ornullif the default specified by the document type should be applied. For instance in Docbook, the default value istruewhile 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:
trueif the separator should be painted below the cell,falseif no separator is needed, ornullif the default specified by the document type should be applied. For instance in Docbook, the default value istruewhile 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,colNameandcolWidthfields.
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 newWidthRepresentationcorresponding 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.
-