On 03.04.2012 18:29, Grzegorz Kaczor wrote: > 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. > > I agree that it would be useful and in the end is what all user expects. For instance there might be a default decorator behind the scenes dependent of the list type (bullet, number or image) or heading (outline) the style is using. Guess there was just time to implement it. I personally will not invest time atm, as I think it is more important to improvement the lower levels (DOM - as source code generation) - to ease problem solution in the higher level (e.g. simple API), like the following feature - https://issues.apache.org/jira/browse/ODFTOOLKIT-182
Happy Easter, Svante
