Example usage for com.lowagie.text ListItem ListItem

List of usage examples for com.lowagie.text ListItem ListItem

Introduction

In this page you can find the example usage for com.lowagie.text ListItem ListItem.

Prototype

public ListItem(Phrase phrase) 

Source Link

Document

Constructs a ListItem with a certain Phrase.

Usage

From source file:org.activityinfo.server.report.renderer.itext.ItextMapRenderer.java

License:Open Source License

private void addIndicatorList(MapReportElement element, MapLayer layer, Cell descriptionCell) {
    com.lowagie.text.List list = new List(List.UNORDERED);

    for (int indicatorId : layer.getIndicatorIds()) {
        IndicatorDTO indicator = element.getContent().getIndicatorById(indicatorId);
        list.add(new ListItem(indicator.getName()));
    }//from   ww w.  ja v  a  2 s  .  c o m

    descriptionCell.add(list);
}

From source file:org.drools.verifier.doc.DroolsDocsComponentFactory.java

License:Apache License

public static List createContents(java.util.List<DrlRuleParser> rules) {
    List index = new List(true);

    for (DrlRuleParser drlRuleData : rules) {
        Chunk chunk = new Chunk(drlRuleData.getName());
        // chunk.setLocalGoto( item.getName() );
        ListItem listItem = new ListItem(chunk);
        index.add(listItem);/*ww w  .j av a  2s. c om*/
    }

    return index;
}

From source file:org.pz.platypus.plugin.pdf.PdfOutfile.java

License:Open Source License

/**
 * Adds a paragraph to the currently active bullet list.
 *
 * @param para the paragraph to add/*from   www. j a v a 2  s .c om*/
 */
public void addParagraphToList(Paragraph para) {
    if (para == null) {
        return; // TODO: should add an error message
    }

    List currList;
    try {
        currList = (List) bulletLists.peek();
    } catch (EmptyStackException ese) {
        return; // TODO: should add an errro message
    }

    ListItem li = new ListItem(para);
    if (currList != null) {
        currList.add(li);
    }

    iTPara = null;

}

From source file:org.sonar.report.pdf.DefaultPDFReporter.java

License:Open Source License

private void printProjectInfo(Project project, Section section)
        throws DocumentException, org.dom4j.DocumentException {
    List data = new List();
    data.add(new ListItem(super.getTextProperty("general.name") + ": " + project.getName()));
    data.add(new ListItem(super.getTextProperty("general.description") + ": " + project.getDescription()));
    data.add(new ListItem(super.getTextProperty("general.modules") + ": "));

    List sublist = new List();
    if (project.getSubprojects().size() != 0) {
        Iterator<Project> it = project.getSubprojects().iterator();
        while (it.hasNext()) {
            sublist.add(new ListItem(it.next().getName()));
        }/*from w w  w .j  a  v a2s .c om*/
    } else {
        sublist.add(new ListItem(super.getTextProperty("general.no_modules")));
    }

    sublist.setIndentationLeft(indentation);
    data.add(sublist);
    section.add(data);
    printMeasures(project.getMeasures(), section);
}

From source file:org.tpspencer.tal.mvc.document.DocumentWriterImpl.java

License:Apache License

/**
 * Add a new list item to the current list.
 * /* www .  ja v a 2  s . co m*/
 * @param key The key in resources for the section title
 * @param substitutions The substitutions to use
 */
public void addListItem(String key, AppElement element) {
    if (list == null)
        throw new IllegalArgumentException("Cannot add a list item if there is no list");

    String text = getText(key, element);

    list.add(new ListItem(formatText(text)));
}

From source file:questions.objects.NestedList.java

public static void main(String[] args) {
    Document document = new Document();
    try {/* w ww.  j  av a2  s . c om*/
        PdfWriter.getInstance(document, new FileOutputStream(RESULT));
        document.open();
        List list;
        ListItem listItem;
        List sublist;
        list = new List(true);
        list.setPreSymbol("Chapter ");
        list.setPostSymbol(": ");
        listItem = new ListItem("Isaac Asimov");
        list.add(listItem);
        sublist = new List(true);
        sublist.setIndentationLeft(10);
        sublist.setPreSymbol("1.");
        sublist.add("The Foundation Trilogy");
        sublist.add("The Complete Robot");
        sublist.add("Caves of Steel");
        sublist.add("The Naked Sun");
        list.add(sublist);
        listItem = new ListItem("John Irving");
        list.add(listItem);
        sublist = new List(true);
        sublist.setIndentationLeft(10);
        sublist.setPreSymbol("Section 2.");
        sublist.add("The World according to Garp");
        sublist.add("Hotel New Hampshire");
        sublist.add("A prayer for Owen Meany");
        sublist.add("Widow for a year");
        list.add(sublist);
        listItem = new ListItem("Kurt Vonnegut");
        list.add(listItem);
        sublist = new List(true);
        sublist.setIndentationLeft(10);
        sublist.setPreSymbol("3.");
        sublist.setPostSymbol("# ");
        sublist.add("Slaughterhouse 5");
        sublist.add("Welcome to the Monkey House");
        sublist.add("The great pianola");
        sublist.add("Galapagos");
        list.add(sublist);
        document.add(list);
    } catch (DocumentException de) {
        System.err.println(de.getMessage());
    } catch (IOException ioe) {
        System.err.println(ioe.getMessage());
    }
    document.close();
}

From source file:questions.objects.NestingLists.java

public static void main(String[] args) throws IOException, DocumentException {
    Document document = new Document();
    PdfWriter.getInstance(document, new FileOutputStream(RESULT));
    document.open();//from  ww w  .j  ava 2  s. c o  m
    List list1 = new List(List.ORDERED, 20);
    list1.add(new ListItem(new Chunk("Level 1 - Item 1")));
    list1.add(new ListItem(new Chunk("Level 1 - Item 2")));
    list1.add(new ListItem(new Chunk("Level 1 - Item 3")));

    List list2 = new List(List.ORDERED, 20);
    list2.add(new ListItem(new Chunk("Level 2 - Item 1")));
    list2.add(new ListItem(new Chunk("Level 2 - Item 2")));

    List list3 = new List(List.ORDERED, 20);
    list3.add(new ListItem(new Chunk("Level 3 - Item 1")));
    list3.add(new ListItem(new Chunk("Level 3 - Item 2")));
    list3.add(new ListItem(new Chunk("Level 3 - Item 3")));
    list3.add(new ListItem(new Chunk("Level 3 - Item 4")));
    list2.add(list3);

    list1.add(list2);
    list1.add(new ListItem(new Chunk("Level 1 - Item 4")));

    document.add(list1);
    document.close();
}