Page 1 of 1

Author mode: table columns (Table Cell Span Provider?)

Posted: Tue Oct 07, 2008 1:37 am
by kduncklee
I would like to organize a set of tags in a table in the author view. I am able to do so by following the simple tutorial (http://www.oxygenxml.com/doc/ug-oxygen/ ... e-css.html). The problem is that one of the tags is optional. This causes the columns to not line up.

Example:

Code: Select all


<fields>
<field>
<name>a</name>
<optional>o</optional>
<value>1</value>
</field>
<field>
<name>b</name>
<value>2</value>
</field>
</fields>
Will produce:

Code: Select all


a o 1
b 2
Is there a way I can get it to produce this?

Code: Select all


a o 1
b 2
Do I need to create a Table Cell Span Provider?

Thanks,
Kevin

Re: Author mode: table columns (Table Cell Span Provider?)

Posted: Tue Oct 07, 2008 9:59 am
by alex_jitianu
Hello,

In order to provide information about cell spanning you will have to create a Table Cell Span Provider.
In method AuthorTableCellSpanProvider.getColSpan(AuthorElement cellElement) you will have to check if the given cellElement is the optional element (you can use AuthorElement.getLocalName()). If that's the case, you must count the following rows that do not contain that optional element. This number represents the collspan for that cell.
In order to navigate through the node structure you can use the API from the AuthorElement class:
- AuthorNode getParent() to get to the row/table element
- List getContentNodes() to iterate through the children of the table/row


Best regards,
Alex