I'm not sure if this is the appropriate mailing list for this
question, but perhaps any lurking developers can set me straight if
necessary.
I've been using POI XWPF for a couple weeks now. Ultimately I'll be
using the POI libraries through jython, but I've been working with the
Java code as I learn my way around. My primary need for POI XWPF is
for creating fairly simple MS Word-compatible documents with somewhat
more complex tables. To do what I need to do, I've had to burrow deep
into the underlying ooxml-schema classes that are exposed by the XWPF
classes. I've mostly succeeded in creating the tables I want, but my
question is, to what extent is it appropriate for the XWPF classes to
provide higher-level support for lower-level actions?Consider this
example in my code to set the vertical alignment of a table cell:
// (assume appropriate initialization of XWPFTableCell cell)
XWPFTableCell cell = ... // get a table cell properties element
(tcPr) CTTcPr tcpr = cell.getCTTc().addNewTcPr(); // set
vertical alignment to "center" CTVerticalJc va =
tcpr.addNewVAlign(); va.setVal(STVerticalJc.CENTER);
Would it be considered appropriate for XWPFTableCell to support this
directly, with a method like this in XWPFTableCell itself?
public void setVerticalAlignment(STVerticalJc vAlign) {
CTTcPr tcpr = ctTc.addNewTcPr(); CTVerticalJc va =
tcpr.addNewVAlign(); va.setVal(vAlign); }
Note that access to the low-level STVerticalJc enum is still required.
I could create an XWPF-level enum that maps to the STVerticalJc enum,
but this goes back to my original question.
I think there are a few wrapper methods like this that would be
helpful to me, but I don't want to foist these upon the XWPF user base
if I'm going against the design philosophy. If these higher-level
wrapper methods are considered a Good Thing, I'd be happy to submit my
changes for consideration.
Thanks,Gregg
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]