|
Oxygen XML Editor 14.2 Author API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ro.sync.ecss.extensions.commons.table.support.CALSTableCellInfoProvider
@API(type=INTERNAL, src=PUBLIC) public class CALSTableCellInfoProvider
Provides informations about the cell spanning and column width for Docbook CALS tables.
Field Summary | |
---|---|
static WidthRepresentation |
DEFAULT_WIDTH_REPRESENTATION
The default width representation. |
protected java.util.List<CALSColSpanSpec> |
spanspecInfos
The list with the CALSColSpanSpec containing
information about the columns span specification for this table. |
Fields inherited from interface ro.sync.ecss.extensions.commons.table.operations.cals.CALSConstants |
---|
ATTRIBUTE_NAME_COLNAME, ATTRIBUTE_NAME_COLNUM, ATTRIBUTE_NAME_COLS, ATTRIBUTE_NAME_COLWIDTH, ATTRIBUTE_NAME_ID, ATTRIBUTE_NAME_MOREROWS, ATTRIBUTE_NAME_NAMEEND, ATTRIBUTE_NAME_NAMEST, ATTRIBUTE_NAME_SPANNAME, ATTRIBUTE_NAME_TABLE_WIDTH, ATTRIBUTE_NAME_XML_ID, ELEMENT_NAME_COLSPEC, ELEMENT_NAME_ENTRY, ELEMENT_NAME_INFORMALTABLE, ELEMENT_NAME_ROW, ELEMENT_NAME_SPANSPEC, ELEMENT_NAME_TABLE, ELEMENT_NAME_TGROUP |
Constructor Summary | |
---|---|
CALSTableCellInfoProvider()
|
Method Summary | |
---|---|
void |
commitColumnWidthModifications(AuthorDocumentController authorDocumentController,
WidthRepresentation[] colWidths,
java.lang.String tableCellsTagName)
Updates the columns width specifications in the source document by setting the colwidth attribute value of the
colspec elements and by adding new colspec
elements if needed. |
void |
commitTableWidthModification(AuthorDocumentController authorDocumentController,
int newTableWidth,
java.lang.String tableCellsTagName)
Sets the width attribute value of the table element. |
CALSColSpanSpec |
getCellSpanSpec(AuthorAccess authorAccess,
AuthorElement cellElement)
Find the column span specification for a table cell. |
java.util.List<WidthRepresentation> |
getCellWidth(AuthorElement cellElement,
int colNumberStart,
int colSpan)
The list with the width representations for the given cell is obtained by computing the column span and then determining the WidthRepresentation
for each column the cell spans across. |
java.lang.Integer |
getColSpan(AuthorElement cellElem)
Compute the number of columns the cell spans across by looking at the 'spanspec' attribute. |
CALSColSpec |
getColSpec(int columnNumber)
Find the column specification for the given column number. |
AuthorElement |
getColSpecElement(CALSColSpec colspec)
Find a column specification element. |
java.util.Set<CALSColSpec> |
getColSpecs()
Returns the column specification set corresponding to the CALS table. |
java.lang.String |
getDescription()
|
java.lang.Integer |
getRowSpan(AuthorElement cellElement)
Compute the number of rows the cells span across by looking at the morerows attribute. |
WidthRepresentation |
getTableWidth(java.lang.String tableCellsTagName)
Returns the WidthRepresentation obtained by analyzing the
width attribute value of the table element. |
boolean |
hasColumnSpecifications(AuthorElement tableElement)
This method tells if the table contains column specifications. |
void |
init(AuthorElement tableElement)
This method is called when starting to compute the layout for a table. |
boolean |
isAcceptingFixedColumnWidths(java.lang.String tableCellsTagName)
Check if the table column widths can be represented as fixed values. |
boolean |
isAcceptingPercentageColumnWidths(java.lang.String tableCellsTagName)
Check if the table column widths can be represented as percentage values. |
boolean |
isAcceptingProportionalColumnWidths(java.lang.String tableCellsTagName)
Check if the table column widths can be represented as proportional values. |
boolean |
isTableAcceptingWidth(java.lang.String tableCellsTagName)
The DocBook CALS tables do not accept width specification. |
boolean |
isTableAndColumnsResizable(java.lang.String tableCellsTagName)
It returns true only if the given table cells tag name is
equal to 'entry' . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static WidthRepresentation DEFAULT_WIDTH_REPRESENTATION
protected java.util.List<CALSColSpanSpec> spanspecInfos
CALSColSpanSpec
containing
information about the columns span specification for this table.
Constructor Detail |
---|
public CALSTableCellInfoProvider()
Method Detail |
---|
public java.lang.Integer getColSpan(AuthorElement cellElem)
getColSpan
in interface AuthorTableCellSpanProvider
cellElem
- The node that represents a table cell in CSS.
null
if not specified.AuthorTableCellSpanProvider.getColSpan(AuthorElement)
public java.lang.Integer getRowSpan(AuthorElement cellElement)
morerows
attribute.
getRowSpan
in interface AuthorTableCellSpanProvider
cellElement
- The AuthorElement
that represents a table cell in CSS.
null
if not specified.AuthorTableCellSpanProvider.getRowSpan(AuthorElement)
public void init(AuthorElement tableElement)
AuthorTableColumnWidthProvider
init
in interface AuthorTableCellSpanProvider
init
in interface AuthorTableColumnWidthProvider
tableElement
- The element representing a table (it has the CSS display property
set on 'table').AuthorTableColumnWidthProvider.init(ro.sync.ecss.extensions.api.node.AuthorElement)
public java.lang.String getDescription()
getDescription
in interface Extension
Extension.getDescription()
public CALSColSpanSpec getCellSpanSpec(AuthorAccess authorAccess, AuthorElement cellElement)
authorAccess
- The author access.cellElement
- The table cell element.
Null
when column specifications are
not defined.public CALSColSpec getColSpec(int columnNumber)
columnNumber
- The column number, one based.
null
if no column specification is defined for
the given column number.public AuthorElement getColSpecElement(CALSColSpec colspec)
colspec
- The column specification.
null
if no column
corresponds to the given specification.public java.util.Set<CALSColSpec> getColSpecs()
public boolean hasColumnSpecifications(AuthorElement tableElement)
AuthorTableCellSpanProvider
colspec
elements to be present.
hasColumnSpecifications
in interface AuthorTableCellSpanProvider
tableElement
- The AuthorElement
that is rendered as a table.
true
if some column specification info is present or if the table doesn't
require any column specification info.AuthorTableCellSpanProvider.hasColumnSpecifications(ro.sync.ecss.extensions.api.node.AuthorElement)
public java.util.List<WidthRepresentation> getCellWidth(AuthorElement cellElement, int colNumberStart, int colSpan)
WidthRepresentation
for each column the cell spans across.
getCellWidth
in interface AuthorTableColumnWidthProvider
cellElement
- The node that represents a table cell in CSS.colNumberStart
- The column number the cell starts at.colSpan
- The column span of the cell.
WidthRepresentation
of the specified cell element.
If the cell spans over multiple columns then the returned list will contain one WidthRepresentation
for each column the cell spans over.AuthorTableColumnWidthProvider.getCellWidth(ro.sync.ecss.extensions.api.node.AuthorElement, int, int)
public void commitColumnWidthModifications(AuthorDocumentController authorDocumentController, WidthRepresentation[] colWidths, java.lang.String tableCellsTagName) throws AuthorOperationException
colwidth
attribute value of the
colspec
elements and by adding new colspec
elements if needed.
commitColumnWidthModifications
in interface AuthorTableColumnWidthProvider
authorDocumentController
- The AuthorDocumentController
used to commit the table modifications
in the document.colWidths
- The new column WidthRepresentation
to set. The column widths must be ordered
according to the corresponding column numbers.tableCellsTagName
- The cells tag name. Used to identify the table type (e.g. 'entry' for CALS or 'td' for HTML).
AuthorOperationException
- If the operation fails.AuthorTableColumnWidthProvider.commitColumnWidthModifications(AuthorDocumentController, ro.sync.ecss.extensions.api.WidthRepresentation[], java.lang.String)
public void commitTableWidthModification(AuthorDocumentController authorDocumentController, int newTableWidth, java.lang.String tableCellsTagName) throws AuthorOperationException
width
attribute value of the table
element.
commitTableWidthModification
in interface AuthorTableColumnWidthProvider
authorDocumentController
- The AuthorDocumentController
used to commit the table width modifications
in the document.newTableWidth
- The new table WidthRepresentation
to set. The value is given in pixels.tableCellsTagName
- The cells tag name. Used to identify the table type (e.g. 'entry' for CALS or 'td' for HTML).
AuthorOperationException
- If the operation fails.AuthorTableColumnWidthProvider.commitTableWidthModification(AuthorDocumentController, int, java.lang.String)
public WidthRepresentation getTableWidth(java.lang.String tableCellsTagName)
WidthRepresentation
obtained by analyzing the
width
attribute value of the table
element.
getTableWidth
in interface AuthorTableColumnWidthProvider
tableCellsTagName
- The cells tag name. Used to identify the table type (e.g. 'entry' for CALS or 'td' for HTML).
null
value if the table width is specified. Otherwise null
.AuthorTableColumnWidthProvider.getTableWidth(java.lang.String)
public boolean isTableAcceptingWidth(java.lang.String tableCellsTagName)
isTableAcceptingWidth
in interface AuthorTableColumnWidthProvider
tableCellsTagName
- The cells tag name. Used to identify the table type (e.g. 'entry' for CALS or 'td' for HTML).
true
if the table type denoted by the tableCellsTagName
accepts width specification
of any kind.AuthorTableColumnWidthProvider.isTableAcceptingWidth(java.lang.String)
public boolean isTableAndColumnsResizable(java.lang.String tableCellsTagName)
true
only if the given table cells tag name is
equal to 'entry'
.
isTableAndColumnsResizable
in interface AuthorTableColumnWidthProvider
tableCellsTagName
- The cells tag name. Used to identify the table type (e.g. CALS or HTML).
true
if the size of the table or the table cells can be adjusted.AuthorTableColumnWidthProvider.isTableAndColumnsResizable(java.lang.String)
public boolean isAcceptingFixedColumnWidths(java.lang.String tableCellsTagName)
AuthorTableColumnWidthProvider
isAcceptingFixedColumnWidths
in interface AuthorTableColumnWidthProvider
tableCellsTagName
- The cells tag name. Used to identify the table type
(e.g. CALS or HTML).
true
if the table column widths can be represented in
fixed values.AuthorTableColumnWidthProvider.isAcceptingFixedColumnWidths(java.lang.String)
public boolean isAcceptingPercentageColumnWidths(java.lang.String tableCellsTagName)
AuthorTableColumnWidthProvider
isAcceptingPercentageColumnWidths
in interface AuthorTableColumnWidthProvider
tableCellsTagName
- The cells tag name. Used to identify the table type
(e.g. CALS or HTML).
true
if the table column widths can be represented in
percentage values.AuthorTableColumnWidthProvider.isAcceptingPercentageColumnWidths(java.lang.String)
public boolean isAcceptingProportionalColumnWidths(java.lang.String tableCellsTagName)
AuthorTableColumnWidthProvider
isAcceptingProportionalColumnWidths
in interface AuthorTableColumnWidthProvider
tableCellsTagName
- The cells tag name. Used to identify the table type
(e.g. CALS or HTML).
true
if the table column widths can be represented in
proportional values.AuthorTableColumnWidthProvider.isAcceptingProportionalColumnWidths(java.lang.String)
|
Oxygen XML Editor 14.2 Author API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |