Package org.odftoolkit.odfdom.dom.element.style

Examples of org.odftoolkit.odfdom.dom.element.style.StyleStyleElement


   * @param styleFamilyValue  the <code>String</code> value of <code>StyleFamilyAttribute</code>, see {@odf.attribute  style:family} at specification
   * @param styleNameValue  the <code>String</code> value of <code>StyleNameAttribute</code>, see {@odf.attribute  style:name} at specification
   * @return the element {@odf.element style:style}
   */
   public StyleStyleElement newStyleStyleElement(String styleFamilyValue, String styleNameValue) {
    StyleStyleElement styleStyle = ((OdfFileDom) this.ownerDocument).newOdfElement(StyleStyleElement.class);
    styleStyle.setStyleFamilyAttribute(styleFamilyValue);
    styleStyle.setStyleNameAttribute(styleNameValue);
    this.appendChild(styleStyle);
    return styleStyle;
  }
View Full Code Here


   *            The style property
   * @return string for a property.
   */
  public String getProperty(OdfStyleProperty property) {
    // first try automatic style
    StyleStyleElement style = mAutomaticStyle;

    if (style == null) {
      style = getOfficeStyle();
    }

    if (style != null) {
      return style.getProperty(property);
    }

    return null;
  }
View Full Code Here

      OdfOfficeStyles styles = textDoc.getOrCreateDocumentStyles();
      StyleDefaultStyleElement def = styles.newStyleDefaultStyleElement("text");
      def.setStyleFamilyAttribute(OdfStyleFamily.Paragraph.toString());
      def.setProperty(StyleTextPropertiesElement.TextUnderlineColor, "#00FF00");

      StyleStyleElement parent = styles.newStyleStyleElement("text","TheParent");
      parent.setStyleFamilyAttribute(OdfStyleFamily.Paragraph.toString());

      parent.setProperty(StyleTextPropertiesElement.FontSize, "17pt");
      parent.setProperty(StyleTextPropertiesElement.Color, "#FF0000");
      OdfStylesDom stylesDom = textDoc.getStylesDom();
      XPath xpath = stylesDom.getXPath();
      StyleStyleElement styleTest = (StyleStyleElement) xpath.evaluate("//style:style[last()]", stylesDom, XPathConstants.NODE);
      Assert.assertEquals(styleTest, parent);
      textDoc.save(ResourceUtilities.newTestOutputFile("CreatChildrenForStyles.odt"));

    } catch (Exception e) {
      Logger.getLogger(CreateChildrenElementsTest.class.getName()).log(Level.SEVERE, e.getMessage(), e);
View Full Code Here

   * @param styleFamilyValue  the <code>String</code> value of <code>StyleFamilyAttribute</code>, see {@odf.attribute  style:family} at specification
   * @param styleNameValue  the <code>String</code> value of <code>StyleNameAttribute</code>, see {@odf.attribute  style:name} at specification
   * @return the element {@odf.element style:style}
   */
   public StyleStyleElement newStyleStyleElement(String styleFamilyValue, String styleNameValue) {
    StyleStyleElement styleStyle = ((OdfFileDom) this.ownerDocument).newOdfElement(StyleStyleElement.class);
    styleStyle.setStyleFamilyAttribute(styleFamilyValue);
    styleStyle.setStyleNameAttribute(styleNameValue);
    this.appendChild(styleStyle);
    return styleStyle;
  }
View Full Code Here

   *            The style property
   * @return string for a property.
   */
  public String getProperty(OdfStyleProperty property) {
    // first try automatic style
    StyleStyleElement style = mAutomaticStyle;

    if (style == null) {
      style = getOfficeStyle();
    }

    if (style != null) {
      return style.getProperty(property);
    }

    return null;
  }
View Full Code Here

            OdfTextParagraph para2 = (OdfTextParagraph) OdfXMLFactory.newOdfElement(dom, OdfTextParagraph.ELEMENT_NAME);
            para2.setProperty(StyleChartPropertiesElement.DataLabelNumber, "value");
            para2.setProperty(StyleParagraphPropertiesElement.TextAlign, "left");
            para2.setProperty(StyleTextPropertiesElement.FontSize, "17pt");

            StyleStyleElement style1 = para1.getAutomaticStyle();
            StyleStyleElement style2 = para2.getAutomaticStyle();

            String styleName1 = para1.getStyleName();
            String styleName2 = para2.getStyleName();

            Assert.assertFalse(styleName1.equals(styleName2));
            Assert.assertTrue(style1.getStyleUserCount() == 1);
            Assert.assertTrue(style2.getStyleUserCount() == 1);

            OdfOfficeAutomaticStyles autoStyles = para1.getAutomaticStyles();

            Iterator<OdfStyle> iter = autoStyles.getStylesForFamily(OdfStyleFamily.Paragraph).iterator();
            int count = 0;
View Full Code Here

   * @param styleFamilyValue  the <code>String</code> value of <code>StyleFamilyAttribute</code>, see {@odf.attribute  style:family} at specification
   * @param styleNameValue  the <code>String</code> value of <code>StyleNameAttribute</code>, see {@odf.attribute  style:name} at specification
   * @return the element {@odf.element style:style}
   */
   public StyleStyleElement newStyleStyleElement(String styleFamilyValue, String styleNameValue) {
    StyleStyleElement styleStyle = ((OdfFileDom) this.ownerDocument).newOdfElement(StyleStyleElement.class);
    styleStyle.setStyleFamilyAttribute(styleFamilyValue);
    styleStyle.setStyleNameAttribute(styleNameValue);
    this.appendChild(styleStyle);
    return styleStyle;
  }
View Full Code Here

TOP

Related Classes of org.odftoolkit.odfdom.dom.element.style.StyleStyleElement

Copyright © 2018 www.massapicom. 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.