Kejia Ye created ODFTOOLKIT-334:
-----------------------------------
Summary: Add new API to support table autoformat
Key: ODFTOOLKIT-334
URL: https://issues.apache.org/jira/browse/ODFTOOLKIT-334
Project: ODF Toolkit
Issue Type: New Feature
Components: simple api
Affects Versions: 0.7
Reporter: Kejia Ye
Fix For: 0.8
See previous discussion in the mailing list
http://markmail.org/thread/edmejexrfv3m6cdn
I'd like to propose a new Simple API which could provide a similar function in
OpenOffice as ' Table > AutoFormat'. This will allow users to define their own
table template once and apply them anywhere they need. Since the <table:table
template> doesn't have higher-level support yet, API has to define and extract
such template from existing table and serialize them into separated elements at
current stage.
Proposed Solution:
1. User need to define their own table, as a table template, in a document by
ODF editor.
2. Add two Simple APIs:
* Need new API to import table style from appointed table.
* Need new API to apply table style definition to table.
Since it's difficult to recognize all kinds of style combination, we could use
the definition of <table:table template> to define and copy table styles. It
means API can recognize and copy 6 types of cell styles from source table to
target table.
1. first column
2. last column
3. first row
4. last row
5. even rows, odd rows
6. even columns, odd rows
Considering performance and complexity, we'd better restrict the size of
imported table, basically a 5*5 table (A1:E5) would be enough. We can get each
type of style from an appointed cell.
1. first column ( A2)
2. last column (E2)
3. first row (B2)
4. last row (B5)
5. even rows (B3), odd rows (B2)
6. even columns: (C2), odd rows (B2)
For each type of style, API can copy two definitions <table: style-name> and
<table: paragraph-style-name>, which displayed as number format, font,
alignment, borders and background.
In ODF specs, there's some restriction on table template definition. If more
than one style reference is applied to a cell, it has to follow the order. It
means if a table has even/odd row style, it cannot apply even/odd column style
at the same time. Besides that, the four corner cell can only inherit the style
from the column or the row they exists, and cannot been appointed to other
values. Actually, user may need more complicated template than that, like some
complicated template pre-defined in OO. Maybe we could consider more
extensibility when defining table template in API according to real
requirements.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira