Examples of OdfStylePropertiesBase


Examples of org.odftoolkit.odfdom.dom.element.OdfStylePropertiesBase

   * @param style
   *            - a style element
   * @return an instance of <code>TableProperties</p>
   */
  public static TableProperties getOrCreateTableProperties(OdfStyleBase style) {
    OdfStylePropertiesBase properties = style
        .getOrCreatePropertiesElement(OdfStylePropertiesSet.TableProperties);
    return new TableProperties((StyleTablePropertiesElement) properties);
  }
View Full Code Here

Examples of org.odftoolkit.odfdom.dom.element.OdfStylePropertiesBase

   *            - a style element
   * @return an instance of <code>TableProperties</p>;Null if there is no
   *         "style:table-properties" defined
   */
  public static TableProperties getTableProperties(OdfStyleBase style) {
    OdfStylePropertiesBase properties = style
        .getPropertiesElement(OdfStylePropertiesSet.TableProperties);
    if (properties != null)
      return new TableProperties((StyleTablePropertiesElement) properties);
    else
      return null;
View Full Code Here

Examples of org.odftoolkit.odfdom.dom.element.OdfStylePropertiesBase

   * @param style
   *            - a style element
   * @return an instance of <code>GraphicProperties</p>
   */
  public static GraphicProperties getOrCreateGraphicProperties(OdfStyleBase style) {
    OdfStylePropertiesBase properties = style.getOrCreatePropertiesElement(OdfStylePropertiesSet.GraphicProperties);
    return new GraphicProperties((StyleGraphicPropertiesElement) properties);
  }
View Full Code Here

Examples of org.odftoolkit.odfdom.dom.element.OdfStylePropertiesBase

   *            - a style element
   * @return an instance of <code>GraphicProperties</p>;Null if there is no
   *         "style:graphic-properties" defined
   */
  public static GraphicProperties getGraphicProperties(OdfStyleBase style) {
    OdfStylePropertiesBase properties = style.getPropertiesElement(OdfStylePropertiesSet.GraphicProperties);
    if (properties != null)
      return new GraphicProperties((StyleGraphicPropertiesElement) properties);
    else
      return null;
  }
View Full Code Here

Examples of org.odftoolkit.odfdom.dom.element.OdfStylePropertiesBase

   * @param style
   *            - a style element
   * @return an instance of <code>ParagraphProperties</p>
   */
  public static ParagraphProperties getOrCreateParagraphProperties(OdfStyleBase style) {
    OdfStylePropertiesBase properties = style
        .getOrCreatePropertiesElement(OdfStylePropertiesSet.ParagraphProperties);
    return new ParagraphProperties((StyleParagraphPropertiesElement) properties);
  }
View Full Code Here

Examples of org.odftoolkit.odfdom.dom.element.OdfStylePropertiesBase

   *            - a style element
   * @return an instance of <code>ParagraphProperties</p>;Null if there is no
   *         "style:paragraph-properties" defined
   */
  public static ParagraphProperties getParagraphProperties(OdfStyleBase style) {
    OdfStylePropertiesBase properties = style.getPropertiesElement(OdfStylePropertiesSet.ParagraphProperties);
    if (properties != null)
      return new ParagraphProperties((StyleParagraphPropertiesElement) properties);
    else
      return null;
  }
View Full Code Here

Examples of org.odftoolkit.odfdom.dom.element.OdfStylePropertiesBase

                NodeList lst = odfContent.getElementsByTagNameNS(OdfDocumentNamespace.TEXT.getUri(), "p");
                Node node = lst.item(0);
                OdfTextParagraph para = (OdfTextParagraph) node;
                OdfStyleBase paraLocalStyle = para.getAutomaticStyle();

                OdfStylePropertiesBase paraProperties = paraLocalStyle.getPropertiesElement(OdfStylePropertiesSet.ParagraphProperties);

                StyleTabStopsElement tabstops = OdfElement.findFirstChildNode(StyleTabStopsElement.class, paraProperties );
                Assert.assertNotNull(tabstops);

                StyleTabStopElement tabstop = OdfElement.findFirstChildNode(StyleTabStopElement.class, tabstops);
View Full Code Here

Examples of org.odftoolkit.odfdom.dom.element.OdfStylePropertiesBase

            // 9. tab stops vs background image
            StyleTabStopsElement tabStops = (StyleTabStopsElement) OdfXMLFactory.newOdfElement(dom, StyleTabStopsElement.ELEMENT_NAME);
            StyleTabStopElement tabStop1 = (StyleTabStopElement) OdfXMLFactory.newOdfElement(dom, StyleTabStopElement.ELEMENT_NAME);
            StyleTabStopElement tabStop2 = (StyleTabStopElement) OdfXMLFactory.newOdfElement(dom, StyleTabStopElement.ELEMENT_NAME);
            OdfStylePropertiesBase propElement = style1.getPropertiesElement(OdfStylePropertiesSet.ParagraphProperties);
            propElement.appendChild(tabStops);
            tabStops.appendChild(tabStop1);
            tabStops.appendChild(tabStop2);
            StyleBackgroundImageElement img = (StyleBackgroundImageElement) OdfXMLFactory.newOdfElement(dom, StyleBackgroundImageElement.ELEMENT_NAME);
            propElement = style2.getPropertiesElement(OdfStylePropertiesSet.ParagraphProperties);
            propElement.appendChild(img);
            Assert.assertTrue(style2.compareTo(style1) < 0);

            // 10. Same tab stops and background image, different position:
            // These two styles are considered distinct!
            tabStops = (StyleTabStopsElement) OdfXMLFactory.newOdfElement(dom, StyleTabStopsElement.ELEMENT_NAME);
            tabStop1 = (StyleTabStopElement) OdfXMLFactory.newOdfElement(dom, StyleTabStopElement.ELEMENT_NAME);
            tabStop2 = (StyleTabStopElement) OdfXMLFactory.newOdfElement(dom, StyleTabStopElement.ELEMENT_NAME);
            propElement = style2.getPropertiesElement(OdfStylePropertiesSet.ParagraphProperties);
            propElement.appendChild(tabStops);
            tabStops.appendChild(tabStop1);
            tabStops.appendChild(tabStop2);
            img = (StyleBackgroundImageElement) OdfXMLFactory.newOdfElement(dom, StyleBackgroundImageElement.ELEMENT_NAME);
            propElement = style1.getPropertiesElement(OdfStylePropertiesSet.ParagraphProperties);
            propElement.appendChild(img);
            Assert.assertTrue(style2.compareTo(style1) < 0);

        } catch (Exception e) {
            Logger.getLogger(StyleTest.class.getName()).log(Level.SEVERE, e.getMessage(), e);
            Assert.fail("Failed with " + e.getClass().getName() + ": '" + e.getMessage() + "'");
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.