public void write(PDFDocument document, PdfPTable tabla) throws DocumentException { com.lowagie.text.List list = new com.lowagie.text.List(false,10f); list.setListSymbol(new Chunk("\u2022")); PdfPCell cell = new PdfPCell(); if(!titulo.equals("")) { cell.addElement(new Phrase(titulo,document.getContext().getDefaultFont())); } for(int i=0; i<campos.size(); i++) { list.add(new ListItem((String)campos.get(i),document.getContext().getDefaultFont())); } cell.addElement(list); cell.setPaddingLeft(30f); cell.setBorder(Rectangle.LEFT | Rectangle.RIGHT); cell.setColspan(2); tabla.addCell(cell); }
/** * creates the intentional elements in the report * * @param document * the document in which the report is created * @param grlspec * the grl specification used to retrieve elements */ public void writeIntElements(Document document, GRLspec grlspec) { try { document.add(new Paragraph(Messages.getString("ReportDataDictionary.IntentionalElements"), header1Font)); //$NON-NLS-1$ List list1 = new List(List.ORDERED); list1.setIndentationLeft(10); for (Iterator iter = grlspec.getIntElements().iterator(); iter.hasNext();) { // generate report documentation for intentional elements (name, description, criticality, priority) IntentionalElement intElement = (IntentionalElement) iter.next(); list1.add(new ListItem(ReportUtils .getParagraphWithSeparator(document, intElement.getName(), ": ", intElement.getDescription(), descriptionFont))); //$NON-NLS-1$ } document.add(list1); } catch (Exception e) { jUCMNavErrorDialog error = new jUCMNavErrorDialog(e.getMessage()); e.printStackTrace(); } }
/** * creates the actors in the report * * @param document * the document in which the report is created * @param grlspec * the grl specification used to retrieve elements */ public void writeActors(Document document, GRLspec grlspec) { try { document.add(new Paragraph(Messages.getString("ReportDataDictionary.Actors"), header1Font)); //$NON-NLS-1$ List list1 = new List(List.ORDERED); list1.setIndentationLeft(10); for (Iterator iter = grlspec.getActors().iterator(); iter.hasNext();) { // generate report documentation for actors(name, description) Actor actor = (Actor) iter.next(); list1.add(new ListItem(ReportUtils.getParagraphWithSeparator(document, actor.getName(), ": ", actor.getDescription(), descriptionFont))); //$NON-NLS-1$ } document.add(list1); } catch (Exception e) { jUCMNavErrorDialog error = new jUCMNavErrorDialog(e.getMessage()); e.printStackTrace(); } }
/** * creates the responsibilities in the report * * @param document * the document in which the report is created * @param urndef * the urn definition used to retrieve elements */ public void writeResponsibilities(Document document, URNdefinition urndef) { try { document.add(new Paragraph(Messages.getString("ReportDataDictionary.Responsibilities"), header1Font)); //$NON-NLS-1$ List list1 = new List(List.ORDERED); list1.setIndentationLeft(10); for (Iterator iter = urndef.getResponsibilities().iterator(); iter.hasNext();) { Responsibility responsibility = (Responsibility) iter.next(); list1.add(new ListItem(ReportUtils.getParagraphWithSeparator(document, responsibility.getName(), ": ", responsibility.getDescription(), //$NON-NLS-1$ descriptionFont))); } document.add(list1); } catch (Exception e) { jUCMNavErrorDialog error = new jUCMNavErrorDialog(e.getMessage()); e.printStackTrace(); } }
/** * creates the responsibilities in the report * * @param document * the document in which the report is created * @param urndef * the urn definition used to retrieve elements */ public void writeComponents(Document document, URNdefinition urndef) { try { document.add(new Paragraph(Messages.getString("ReportDataDictionary.Components"), header1Font)); //$NON-NLS-1$ List list1 = new List(List.ORDERED); list1.setIndentationLeft(10); for (Iterator iter = urndef.getComponents().iterator(); iter.hasNext();) { Component component = (Component) iter.next(); list1 .add(new ListItem(ReportUtils.getParagraphWithSeparator(document, component.getName(), ": ", component.getDescription(), //$NON-NLS-1$ descriptionFont))); } document.add(list1); } catch (Exception e) { jUCMNavErrorDialog error = new jUCMNavErrorDialog(e.getMessage()); e.printStackTrace(); } }
private void addList(List list, float left, float right, int alignment) { PdfChunk chunk; PdfChunk overflow; ArrayList allActions = new ArrayList(); processActions(list, null, allActions); int aCounter = 0; for (Iterator it = list.getItems().iterator(); it.hasNext();) { Element ele = (Element)it.next(); switch (ele.type()) { case Element.LISTITEM: ListItem item = (ListItem)ele; line = new PdfLine(left + item.getIndentationLeft(), right, alignment, item.getLeading()); line.setListItem(item); for (Iterator j = item.getChunks().iterator(); j.hasNext();) { chunk = new PdfChunk((Chunk) j.next(), (PdfAction) (allActions.get(aCounter++))); while ((overflow = line.add(chunk)) != null) { addLine(line); line = new PdfLine(left + item.getIndentationLeft(), right, alignment, item.getLeading()); chunk = overflow; } line.resetAlignment(); addLine(line); line = new PdfLine(left + item.getIndentationLeft(), right, alignment, leading); } break; case Element.LIST: List sublist = (List)ele; addList(sublist, left + sublist.getIndentationLeft(), right, alignment); break; } } }
/** * creates the scenario groups in the report * * @param document * the document in which the report is created * @param ucmspec * the ucm specification used to retrieve elements */ public void writeScenarioGroups(Document document, UCMspec ucmspec) { try { document.add(new Paragraph(Messages.getString("ReportDataDictionary.UCMScenarioGroupsDocumentation"), header1Font)); //$NON-NLS-1$ for (Iterator iter = ucmspec.getScenarioGroups().iterator(); iter.hasNext();) { ScenarioGroup group = (ScenarioGroup) iter.next(); // generate report documentation for ScenarioGroup if (group != null) { // create list for this scenario group String sScenarioGroupName = new String(group.getName()); List list1 = new List(List.UNORDERED); list1.add(new ListItem(sScenarioGroupName + ":")); //$NON-NLS-1$ document.add(list1); if (group.getScenarios() != null) { // scenario description List list2 = new List(List.ORDERED); for (Iterator iterator = group.getScenarios().iterator(); iterator.hasNext();) { // create a list for the scenario group ScenarioDef scen = (ScenarioDef) iterator.next(); list2.setIndentationLeft(10); list2.add(new ListItem(ReportUtils .getParagraphWithSeparator(document, scen.getName(), ": ", scen.getDescription(), descriptionFont))); //$NON-NLS-1$ } document.add(list2); } } } // TODO get scenarios diagrams } catch (Exception e) { jUCMNavErrorDialog error = new jUCMNavErrorDialog(e.getMessage()); e.printStackTrace(); } }
/** * creates the variables in the report * * @param document * the document in which the report is created * @param ucmspec * the ucm specification used to retrieve elements */ public void writeVariables(Document document, UCMspec ucmspec) { try { document.add(new Paragraph(Messages.getString("ReportDataDictionary.Variables"), header1Font)); //$NON-NLS-1$ List list1 = new List(List.ORDERED); for (Iterator iter = ucmspec.getVariables().iterator(); iter.hasNext();) { // generate report documentation for variables Variable var = (Variable) iter.next(); if (var != null) { String varName = var.getName(); String varType = var.getType(); String varDescription = var.getDescription(); list1.setIndentationLeft(10); if (var.getEnumerationType() != null) { // the variable type is enumeration String enumType = var.getEnumerationType().getName(); list1.add(new ListItem(ReportUtils.getParagraphWithSeparator(document, var.getName() + Messages.getString("ReportDataDictionary.ParEnum") + enumType + Messages.getString("ReportDataDictionary.ParEnumClose"), ": ", var //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ .getDescription(), descriptionFont))); } else list1.add(new ListItem(ReportUtils.getParagraphWithSeparator(document, var.getName() + " (" + varType + ")", ": ", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ var.getDescription(), descriptionFont))); } } document.add(list1); } catch (Exception e) { jUCMNavErrorDialog error = new jUCMNavErrorDialog(e.getMessage()); e.printStackTrace(); } }
public static ListItem createListItem(ChainedProperties props) { ListItem p = new ListItem(); createParagraph(p, props); return p; }
/** * This method returns a {@link IdentifiableEntityData} with the given text as specific einput. * * @param text * The text. * @param font * {@link Font} to apply on the element. * @return a {@link IdentifiableEntityData}. */ public static Element createListItem(String text, Font font) { ListItem item = new ListItem(text); if (font != null) { item.setFont(font); } return item; }
/** * Sets the listsymbol of this line. * <P> * This is only necessary for the first line of a <CODE>ListItem</CODE>. * * @param listItem the list symbol */ public void setListItem(ListItem listItem) { this.listSymbol = listItem.getListSymbol(); this.symbolIndent = listItem.getIndentationLeft(); }
/** * Constructs a RtfListItem for a ListItem belonging to a RtfDocument. * * @param doc The RtfDocument this RtfListItem belongs to. * @param listItem The ListItem this RtfListItem is based on. */ public RtfListItem(RtfDocument doc, ListItem listItem) { super(doc, listItem); }
/** * Creates a ListItem object based on a list of properties. * @param attributes * @return a ListItem */ public static ListItem getListItem(Properties attributes) { ListItem item = new ListItem(getParagraph(attributes)); return item; }
/** * Sets the listsymbol of this line. * <P> * This is only necessary for the first line of a <CODE>ListItem</CODE>. * * @param listItem the list symbol */ public void setListItem(ListItem listItem) { this.listSymbol = new PdfChunk(listItem.listSymbol(), null); this.symbolIndent = listItem.indentationLeft(); }