Examples of OdfStyleBase


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

  public String getCurrencySymbol() {
    if (getTypeAttr() != OfficeValueTypeAttribute.Value.CURRENCY) {
      throw new IllegalArgumentException();
    }

    OdfStyleBase style = getStyleHandler().getStyleElementForRead();
    if (style != null) {
      String dataStyleName = style.getOdfAttributeValue(OdfName.newName(OdfDocumentNamespace.STYLE,
          "data-style-name"));
      OdfNumberCurrencyStyle dataStyle = mCellElement.getAutomaticStyles().getCurrencyStyle(dataStyleName);
      if (dataStyle == null) {
        dataStyle = mDocument.getDocumentStyles().getCurrencyStyle(dataStyleName);
      }
View Full Code Here

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

   *             <code>getCellBackgroundColor()</code>
   */
  @Deprecated
  public String getCellBackgroundColorString() {
    String color = DEFAULT_BACKGROUND_COLOR;
    OdfStyleBase styleElement = getStyleHandler().getStyleElementForRead();
    if (styleElement != null) {
      OdfStyleProperty bkColorProperty = OdfStyleProperty.get(OdfStylePropertiesSet.TableCellProperties, OdfName
          .newName(OdfDocumentNamespace.FO, "background-color"));
      String property = styleElement.getProperty(bkColorProperty);
      if (Color.isValid(property)) {
        color = property;
      }
    }
    return color;
View Full Code Here

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

      Logger.getLogger(Cell.class.getName()).log(Level.WARNING,
          "Parameter is invalid for datatype Color, default background color #FFFFFF will be set.");
      cellBackgroundColor = DEFAULT_BACKGROUND_COLOR;
    }
    splitRepeatedCells();
    OdfStyleBase styleElement = getStyleHandler().getStyleElementForWrite();
    if (styleElement != null) {
      OdfStyleProperty bkColorProperty = OdfStyleProperty.get(OdfStylePropertiesSet.TableCellProperties, OdfName
          .newName(OdfDocumentNamespace.FO, "background-color"));
      styleElement.setProperty(bkColorProperty, cellBackgroundColor);
    }
  }
View Full Code Here

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

   * Get the style name of this cell.
   *
   * @return the name of the style
   */
  public String getStyleName() {
    OdfStyleBase style = getStyleHandler().getStyleElementForRead();
    if (style == null) {
      return "";
    }
    if (style instanceof OdfStyle)
      return ((OdfStyle) style).getStyleNameAttribute();
View Full Code Here

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

      throw new IllegalArgumentException("This function doesn't support " + typeValue + " cell.");
    }
  }

  private void setDataDisplayStyleName(String name) {
    OdfStyleBase styleElement = getStyleHandler().getStyleElementForWrite();
    if (styleElement != null) {
      styleElement.setOdfAttributeValue(OdfName.newName(OdfDocumentNamespace.STYLE, "data-style-name"), name);
    }
  }
View Full Code Here

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

    }
  }

  private String getDataDisplayStyleName() {
    String datadisplayStylename = null;
    OdfStyleBase styleElement = getStyleHandler().getStyleElementForRead();
    if (styleElement != null) {
      datadisplayStylename = styleElement.getOdfAttributeValue(OdfName.newName(OdfDocumentNamespace.STYLE,
          "data-style-name"));
    }

    return datadisplayStylename;
  }
View Full Code Here

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

    FontMetrics fm = txtField.getFontMetrics(txtField.getFont());
    // content width in pixels.
    int widthPixels = fm.stringWidth(content);
    // content height in pixels.
    // int heightPixels = fm.getHeight();
    OdfStyleBase properties = getStyleHandler().getStyleElementForRead();
    double millimeterPadding = 0.0;
    if(properties!=null){
      String padding = properties.getProperty(StyleTableCellPropertiesElement.Padding);
      if(padding!=null){
        millimeterPadding = Length.parseDouble(padding, Unit.MILLIMETER);
      }
    }
    // convert width pixels to mm
View Full Code Here

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

      autoStyles = doc.getContentDom().getAutomaticStyles();
    } catch (Exception e1) {
      Assert.fail("Failed with " + e1.getClass().getName() + ": '" + e1.getMessage() + "'");
    }
    // T4 is the bold style for text
    OdfStyleBase style = autoStyles.getStyle("T4", OdfStyleFamily.Text);
    Assert.assertNotNull(style);

    while (search.hasNext()) {
      TextSelection item = (TextSelection) search.nextSelection();
      try {
View Full Code Here

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

   * If no horizontal alignment is set, null will be returned.
   *
   * @return the horizontal alignment setting.
   */
  public String getHorizontalAlignment() {
    OdfStyleBase styleElement = getCellStyleElement();
    if (styleElement != null) {
      OdfStyleProperty property = OdfStyleProperty.get(OdfStylePropertiesSet.ParagraphProperties,
          OdfName.newName(OdfDocumentNamespace.FO, "text-align"));
      return styleElement.getProperty(property);
    }
    return null;
  }
View Full Code Here

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

    }
    if (FoTextAlignAttribute.Value.RIGHT.toString().equalsIgnoreCase(horizontalAlignment)) {
      horizontalAlignment = FoTextAlignAttribute.Value.END.toString();
    }
    splitRepeatedCells();
    OdfStyleBase styleElement = getCellStyleElementForWrite();
    if (styleElement != null) {
      OdfStyleProperty property = OdfStyleProperty.get(OdfStylePropertiesSet.ParagraphProperties, OdfName.newName(
          OdfDocumentNamespace.FO, "text-align"));
      if (horizontalAlignment != null) {
        styleElement.setProperty(property, horizontalAlignment);
      } else {
        styleElement.removeProperty(property);
      }
    }
  }
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.