From odf-users-return-114-apmail-incubator-odf-users-archive=incubator.apache.org@incubator.apache.org Tue Apr 3 16:30:17 2012 Return-Path: X-Original-To: apmail-incubator-odf-users-archive@minotaur.apache.org Delivered-To: apmail-incubator-odf-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1E0F89DFB for ; Tue, 3 Apr 2012 16:30:17 +0000 (UTC) Received: (qmail 94509 invoked by uid 500); 3 Apr 2012 16:30:17 -0000 Delivered-To: apmail-incubator-odf-users-archive@incubator.apache.org Received: (qmail 94432 invoked by uid 500); 3 Apr 2012 16:30:16 -0000 Mailing-List: contact odf-users-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: odf-users@incubator.apache.org Delivered-To: mailing list odf-users@incubator.apache.org Received: (qmail 94421 invoked by uid 99); 3 Apr 2012 16:30:16 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Apr 2012 16:30:16 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.85.220.175] (HELO mail-vx0-f175.google.com) (209.85.220.175) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Apr 2012 16:30:09 +0000 Received: by vcbfl13 with SMTP id fl13so2782325vcb.6 for ; Tue, 03 Apr 2012 09:29:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:x-gm-message-state; bh=7RqXyaBC17BqwuCxqXQbQOuMwYlZr6DghkRs5F6cm1c=; b=PzE4vWkhrCcIvIViw1eSmUbSroMyF5v0EANHuq0BABQkECX+EMXQwzkPjvwK0qu1F1 VLX5dkK4hb/NmGY46976r6xmq1BoNO1NGx3l2nLImJPDH3lv0rkvxfVCFHp8AKQnmWFr qFQhLOkyAvgbT6ZngRj2EINGFE0Yyyqgd7FTs+aam/fP4fQk0CfUGBRj7MELAyGbSRpU 7H4rPtc8i26eK1cVq8fIUCRN2NXZfO2EDX16VfWNeRcKfaKohrEVWQwBfW08Bmq5RidV cdQTYIbXqSzAqYK4xWcMpP8h8YFkrbqKMEAkSFmt0KEb4/ri8k8MqaZzgvve0NSIUo8g +HRw== Received: by 10.52.180.38 with SMTP id dl6mr5164367vdc.105.1333470588554; Tue, 03 Apr 2012 09:29:48 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.117.81 with HTTP; Tue, 3 Apr 2012 09:29:28 -0700 (PDT) In-Reply-To: References: From: Grzegorz Kaczor Date: Tue, 3 Apr 2012 18:29:28 +0200 Message-ID: Subject: Re: how can I style a list using OdfTextListStyle? To: odf-users@incubator.apache.org Content-Type: multipart/alternative; boundary=bcaec51a7d5ebfce3604bcc8d0bb X-Gm-Message-State: ALoCoQlEi0n6dnZvO2ulWHgF69ymLmC4n4tWv1gOhZykLB3iWW+1rm+ZmOTyVozXjkXfRjXz6a/A --bcaec51a7d5ebfce3604bcc8d0bb Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 2012/3/31 Devin Han > 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%20Do= cument.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 =3D new NumberDecorator(document1); > > List numberList1 =3D document1.addList(numberDecorator); > > List numberList2 =3D 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 > > > 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) b= ut > > now I don't know how to apply it to a list or list item. Could you plea= se > > help me? > > > > Thanks and best regards, > > GK > > > > > > -- > -Devin > --=20 Grzegorz Kaczor Architekt System=C3=B3w e-point SA + 48 512 173 837 grzegorz.kaczor@e-point.pl www.e-point.pl www.youtube.com/epointsa --bcaec51a7d5ebfce3604bcc8d0bb--