Bear in mind that I have never used XWPF in anger when you read the
following; I really think that with inserting bulleted lists you are trying
to accomplish a task that the API is not really rich enough to support at
this stage and that some 'trickery' may be required.
Now, with respect to bulleted lists, you may wish to try the following trick
that we found worked when inserting bulleted lists in Excel worksheet cells
though I can offer no guarantees it will work here.
The first thing to do is to define a bullet character something like this;
char bulletChar = '\u2022';
You could prefix this to any String that you are creating to serve as an
entry in the list; for example
StringBuilder builder = new StringBuilder();
builder.append(bulletChar);
builder.append(" ");
builder.append("List Item One.");
String listItemOne = builder.toString();
and then use this as the first item in the list by adding a paragraph to the
document, a run to the paragraph and setting the text of the run to the
listItemOne String(s) value.
The answer to your second question depends upon what you are creating and
how. I think that using XWPF, you create a document and then add
XWPFParagraphs to that document and one or more XWPFRuns to the
XWPFParagraph. If you take a look at the XWPFParagraph class there are
methods to allow you to set the set the left and right indentations and it
is likely that this will serve to accomplish what you are after even though
the indentation may not be exactly one tab character in width - I could very
well be wrong however. Also, it does mean that each list item will be a
separate paragarph in the document.
Yours
Mark B
cfowler-3 wrote:
>
> Beyond my problem with finding bullets, there seems to be some type of
> trim on the run.setText() method so that I can't add leading tabs or
> whitespace. Is there a reason for this and how would I accomplish the same
> thing?
>
> I'm trying accomplish something like this:
>
> Item # 1
> Item # 2
> Item # 3
>
>
> I can't figure this out, please help I'm desperate.
>
> Thanks,
>
>
> Chris Fowler
> Manager, Strategic Software Development
> J.W. Pepper & Son, Inc.
> 2480 Industrial Blvd.
> Paoli, PA 19301
> 610-648-0500 ext. 2314
> [email protected]
> www.jwpepper.com | www.pianoatpepper.com
>
>
--
View this message in context:
http://www.nabble.com/Space-trouble-tp25927706p25928545.html
Sent from the POI - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]