2012/3/31 Devin Han <[email protected]> > Please reference this demo: > http://incubator.apache.org/odftoolkit/simple/demo/demo4.html > and this description in cookbook: > > http://incubator.apache.org/odftoolkit/simple/document/cookbook/Text%20Document.html#List > > Now, List API support 3 types of lists, ListType.BULLET, ListType.NUMBER > and ListType.IMAGE. The default created list is ListType.BULLET, bullet > list. How to create a number list or a image list then? ListDecorator has > powerful functions that can help you. ListDecorator is an interface which > decides how to decorate a list and its list items. We supply 4 > implementations of this interface, BulletDecorator, NumberDecorator, > ImageDecorator and OutlineDecorator. > > // create a number list. > ListDecorator numberDecorator = new NumberDecorator(document1); > > List numberList1 = document1.addList(numberDecorator); > > List numberList2 = new List(document1, numberDecorator); > > > You can implement your own ListDecorator as need, or extend the default > four implementations. > You can remove a list from the document, the following two methods are > same. >
Thank you for your response. From this I deduce that I cannot use a list style from the document and just assign it to a paragraph or item... it would be useful. Anyway, thanks :) Grzegorz > > > 2012/3/31 Grzegorz Kaczor <[email protected]> > > > Hello, > > > > I defined some list styles in an ODT file and now I would like to > > programmatically create a list that uses one of them. > > > > I managed to access the created styles via > > TextDocument.getStylesDom().getOfficeStyles().getListStyle(styleName) but > > now I don't know how to apply it to a list or list item. Could you please > > help me? > > > > Thanks and best regards, > > GK > > > > > > -- > -Devin > -- Grzegorz Kaczor Architekt Systemów e-point SA + 48 512 173 837 [email protected] www.e-point.pl www.youtube.com/epointsa
