List of usage examples for org.apache.poi.xwpf.usermodel XWPFParagraph setIndentationLeft
public void setIndentationLeft(int indentation)
If this attribute is omitted, its value shall be assumed to be zero.
From source file:com.siemens.sw360.licenseinfo.outputGenerators.DocxUtils.java
License:Open Source License
private static void styleTableHeaderParagraph(XWPFParagraph paragraph) { paragraph.setIndentationLeft(0); paragraph.setWordWrap(true);// w w w . jav a 2 s . c om paragraph.setAlignment(ParagraphAlignment.LEFT); }
From source file:ru.ksu.niimm.cll.mocassin.rdf.ontology.util.OntologyReportGenerator.java
License:Open Source License
private static void addProperties(XWPFDocument wordDocument, OntClass ontClass) { Set<OntClass> equivalentClasses = ontClass.listEquivalentClasses().toSet(); if (equivalentClasses.isEmpty()) return;// w ww.j ava 2s. com XWPFParagraph paragraph = wordDocument.createParagraph(); paragraph.setStyle("style0"); XWPFRun run = paragraph.createRun(); run.setText("?: "); for (OntClass equivalentClass : equivalentClasses) { if (!equivalentClass.isRestriction()) continue; AllValuesFromRestriction restriction = equivalentClass.asRestriction().asAllValuesFromRestriction(); XWPFParagraph p = wordDocument.createParagraph(); p.setIndentationLeft(1440); XWPFRun r = p.createRun(); OntProperty onProperty = restriction.getOnProperty(); OntClass toClass = restriction.getAllValuesFrom().as(OntClass.class); r.setText(format("%s: %s", formatPropertyURI(onProperty), formatURI(toClass))); r.setItalic(true); } wordDocument.createParagraph().setIndentationLeft(1440); }
From source file:ru.ksu.niimm.cll.mocassin.rdf.ontology.util.OntologyReportGenerator.java
License:Open Source License
private static void addNeighbourClasses(XWPFDocument wordDocument, Set<OntClass> classes, String header) { if (classes.isEmpty()) return;//from w w w . j a va 2s . c o m XWPFParagraph paragraph = wordDocument.createParagraph(); paragraph.setStyle("style0"); XWPFRun run = paragraph.createRun(); run.setText(header); StringBuilder sb = new StringBuilder(); List<OntClass> classList = new ArrayList<OntClass>(classes); Collections.sort(classList, new OntClassByLabelComparatorAsc()); Iterator<OntClass> it = classList.iterator(); while (it.hasNext()) { OntClass clazz = it.next(); sb.append(formatURI(clazz)); if (it.hasNext()) { sb.append("; "); } } XWPFParagraph p = wordDocument.createParagraph(); p.setIndentationLeft(1440); XWPFRun r = p.createRun(); r.setText(sb.toString()); r.setItalic(true); wordDocument.createParagraph().setIndentationLeft(1440); }