Examples of newStyle()


Examples of org.odftoolkit.odfdom.incubator.doc.office.OdfOfficeAutomaticStyles.newStyle()

      style = contentAutoStyles.newStyle(OdfStyleFamily.TableCell);
      noaaDateStyleName = style.getStyleNameAttribute();
      style.setStyleDataStyleNameAttribute("numberDateStyle");

      // and for time cells
      style = contentAutoStyles.newStyle(OdfStyleFamily.TableCell);
      noaaTempStyleName = style.getStyleNameAttribute();
      style.setStyleDataStyleNameAttribute("numberTemperatureStyle");
      style.setProperty(StyleParagraphPropertiesElement.TextAlign, "end");

      Table table = Table.newTable(outputDocument);
View Full Code Here

Examples of org.odftoolkit.odfdom.incubator.doc.office.OdfOfficeAutomaticStyles.newStyle()

        styles = ((OdfContentDom) dom).getAutomaticStyles();
      } else if (dom instanceof OdfStylesDom) {
        styles = ((OdfStylesDom) dom).getAutomaticStyles();
      }
     
      OdfStyle newStyle = styles.newStyle(OdfStyleFamily.Paragraph);
      OdfStyle style = styles.getStyle(stylename, OdfStyleFamily.Paragraph);
      if (style != null) {
        String styleName = newStyle.getStyleNameAttribute();
        styles.removeChild(newStyle);
        newStyle = (OdfStyle) style.cloneNode(true);
View Full Code Here

Examples of org.odftoolkit.odfdom.incubator.doc.office.OdfOfficeAutomaticStyles.newStyle()

    }
    OdfStyle tableStyle = styles.getStyle(stylename, OdfStyleFamily.Table);
    tableStyle.setProperty(StyleTablePropertiesElement.Shadow, "none");
    NodeList cells = tableEle.getElementsByTagNameNS(OdfDocumentNamespace.TABLE.getUri(), "table-cell");
    if (cells != null && cells.getLength() > 0) {
      OdfStyle cellStyleWithoutBorder = styles.newStyle(OdfStyleFamily.TableCell);
      cellStyleWithoutBorder.setProperty(StyleTableCellPropertiesElement.Border, "none");
      cellStyleWithoutBorder.removeProperty(StyleTableCellPropertiesElement.Padding);
      String cellStyleName = cellStyleWithoutBorder.getStyleNameAttribute();
      for (int i = 0; i < cells.getLength(); i++) {
        TableTableCellElement cell = (TableTableCellElement) cells.item(i);
View Full Code Here

Examples of org.odftoolkit.odfdom.incubator.doc.office.OdfOfficeAutomaticStyles.newStyle()

      Document doc = (Document) ((OdfFileDom) footerEle
          .getOwnerDocument()).getDocument();
      OdfContentDom contentDocument = doc.getContentDom();
      OdfOfficeAutomaticStyles styles = contentDocument
          .getAutomaticStyles();
      OdfStyle style = styles.newStyle(OdfStyleFamily.Section);
      StyleSectionPropertiesElement sProperties = style
          .newStyleSectionPropertiesElement();
      sProperties.setTextDontBalanceTextColumnsAttribute(false);
      sProperties.setStyleEditableAttribute(false);
      StyleColumnsElement columnEle = sProperties
View Full Code Here

Examples of org.odftoolkit.odfdom.incubator.doc.office.OdfOfficeAutomaticStyles.newStyle()

    if (dom instanceof OdfContentDom) {
      styles = ((OdfContentDom) dom).getAutomaticStyles();
    } else if (dom instanceof OdfStylesDom) {
      styles = ((OdfStylesDom) dom).getAutomaticStyles();
    }
    OdfStyle textStyle = styles.newStyle(OdfStyleFamily.Text);
    StyleTextPropertiesElement styleTextPropertiesElement = textStyle.newStyleTextPropertiesElement(null);
    styleTextPropertiesElement.setStyleFontNameAttribute("Tahoma");
    styleTextPropertiesElement.setFoFontSizeAttribute("10pt");
    styleTextPropertiesElement.setStyleFontNameAsianAttribute("Lucida Sans Unicode");
    styleTextPropertiesElement.setStyleFontSizeAsianAttribute("12pt");
View Full Code Here

Examples of org.odftoolkit.odfdom.incubator.doc.office.OdfOfficeAutomaticStyles.newStyle()

        styles = ((OdfContentDom) dom).getAutomaticStyles();
      } else if (dom instanceof OdfStylesDom) {
        styles = ((OdfStylesDom) dom).getAutomaticStyles();
      }

      OdfStyle newStyle = styles.newStyle(OdfStyleFamily.Paragraph);
      OdfStyle style = styles.getStyle(stylename, OdfStyleFamily.Paragraph);
      if (style != null) {
        String styleName = newStyle.getStyleNameAttribute();
        styles.removeChild(newStyle);
        newStyle = (OdfStyle) style.cloneNode(true);
View Full Code Here

Examples of org.odftoolkit.odfdom.incubator.doc.office.OdfOfficeAutomaticStyles.newStyle()

    }
    OdfStyle tableStyle = styles.getStyle(stylename, OdfStyleFamily.Table);
    tableStyle.setProperty(StyleTablePropertiesElement.Shadow, "none");
    NodeList cells = tableEle.getElementsByTagNameNS(OdfDocumentNamespace.TABLE.getUri(), "table-cell");
    if (cells != null && cells.getLength() > 0) {
      OdfStyle cellStyleWithoutBorder = styles.newStyle(OdfStyleFamily.TableCell);
      cellStyleWithoutBorder.setProperty(StyleTableCellPropertiesElement.Border, "none");
      cellStyleWithoutBorder.removeProperty(StyleTableCellPropertiesElement.Padding);
      String cellStyleName = cellStyleWithoutBorder.getStyleNameAttribute();
      for (int i = 0; i < cells.getLength(); i++) {
        TableTableCellElement cell = (TableTableCellElement) cells.item(i);
View Full Code Here

Examples of org.odftoolkit.odfdom.incubator.doc.office.OdfOfficeAutomaticStyles.newStyle()

      Document doc = (Document) ((OdfFileDom) headerEle
          .getOwnerDocument()).getDocument();
      OdfContentDom contentDocument = doc.getContentDom();
      OdfOfficeAutomaticStyles styles = contentDocument
          .getAutomaticStyles();
      OdfStyle style = styles.newStyle(OdfStyleFamily.Section);
      StyleSectionPropertiesElement sProperties = style
          .newStyleSectionPropertiesElement();
      sProperties.setTextDontBalanceTextColumnsAttribute(false);
      sProperties.setStyleEditableAttribute(false);
      StyleColumnsElement columnEle = sProperties
View Full Code Here

Examples of org.odftoolkit.odfdom.incubator.doc.office.OdfOfficeAutomaticStyles.newStyle()

    TableTableElement newTEle = (TableTableElement) OdfXMLFactory.newOdfElement(dom,
        OdfName.newName(OdfDocumentNamespace.TABLE, "table"));
    String tablename = getUniqueTableName(parent);
    newTEle.setTableNameAttribute(tablename);
    //create style
    OdfStyle tableStyle = styles.newStyle(OdfStyleFamily.Table);
    String stylename = tableStyle.getStyleNameAttribute();
    tableStyle.setProperty(StyleTablePropertiesElement.Width, DEFAULT_TABLE_WIDTH + "in");
    tableStyle.setProperty(StyleTablePropertiesElement.Align, DEFAULT_TABLE_ALIGN);
    newTEle.setStyleName(stylename);
View Full Code Here

Examples of org.odftoolkit.odfdom.incubator.doc.office.OdfOfficeAutomaticStyles.newStyle()

    tableStyle.setProperty(StyleTablePropertiesElement.Align, DEFAULT_TABLE_ALIGN);
    newTEle.setStyleName(stylename);

    // 2. create column elements
    // 2.0 create column style
    OdfStyle columnStyle = styles.newStyle(OdfStyleFamily.TableColumn);
    String columnStylename = columnStyle.getStyleNameAttribute();
    columnStyle.setProperty(StyleTableColumnPropertiesElement.ColumnWidth,
        new DecimalFormat("000.0000").format(DEFAULT_TABLE_WIDTH / numCols) + "in");
    columnStyle.setProperty(StyleTableColumnPropertiesElement.RelColumnWidth, Math.round(DEFAULT_REL_TABLE_WIDTH / numCols) + "*");
    // 2.1 create header column elements
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.