Examples of OdfStyleBase


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

   * The returned value can be "auto", "automatic", "baseline", "bottom", "middle", or "top".
   *
   * @return the vertical alignment setting of this cell.
   */
  public String getVerticalAlignment() {
    OdfStyleBase styleElement = getCellStyleElement();
    if (styleElement != null) {
      OdfStyleProperty property = OdfStyleProperty.get(OdfStylePropertiesSet.TableCellProperties,
          OdfName.newName(OdfDocumentNamespace.STYLE, "vertical-align"));
      return styleElement.getProperty(property);
    }
    return null;
  }
View Full Code Here

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

   *
   * @param verticalAlignment  the vertical alignment setting.
   */
  public void setVerticalAlignment(String verticalAlignment) {
    splitRepeatedCells();
    OdfStyleBase styleElement = getCellStyleElementForWrite();
    if (styleElement != null) {
      OdfStyleProperty property = OdfStyleProperty.get(OdfStylePropertiesSet.TableCellProperties, OdfName.newName(
          OdfDocumentNamespace.STYLE, "vertical-align"));
      if (verticalAlignment != null) {
        styleElement.setProperty(property, verticalAlignment);
      } else {
        styleElement.removeProperty(property);
      }
    }
  }
View Full Code Here

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

   * @return true if the cell content can be wrapped;
   * <p>
   * false if the cell content cannot be wrapped.
   */
  public boolean isTextWrapped() {
    OdfStyleBase styleElement = getCellStyleElement();
    if (styleElement != null) {
      OdfStyleProperty property = OdfStyleProperty.get(OdfStylePropertiesSet.TableCellProperties,
          OdfName.newName(OdfDocumentNamespace.FO, "wrap-option"));
      String wrapped = styleElement.getProperty(property);
      if ((wrapped != null) && (wrapped.equals(FoWrapOptionAttribute.Value.WRAP.toString()))) {
        return true;
      }
    }
    return false;
View Full Code Here

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

   * Set the wrap option of this cell.
   * @param isTextWrapped  whether the cell content can be wrapped or not
   */
  public void setTextWrapped(boolean isTextWrapped) {
    splitRepeatedCells();
    OdfStyleBase styleElement = getCellStyleElementForWrite();
    if (styleElement != null) {
      OdfStyleProperty property = OdfStyleProperty.get(OdfStylePropertiesSet.TableCellProperties,
          OdfName.newName(OdfDocumentNamespace.FO, "wrap-option"));
      if (isTextWrapped) {
        styleElement.setProperty(property, FoWrapOptionAttribute.Value.WRAP.toString());
      } else {
        styleElement.setProperty(property, FoWrapOptionAttribute.Value.NO_WRAP.toString());
      }
    }
  }
View Full Code Here

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

   *
   * @return the background color of this cell
   */
  public Color getCellBackgroundColor() {
    Color color = Color.WHITE;
    OdfStyleBase styleElement = getCellStyleElement();
    if (styleElement != null) {
      OdfStyleProperty bkColorProperty = OdfStyleProperty.get(OdfStylePropertiesSet.TableCellProperties,
          OdfName.newName(OdfDocumentNamespace.FO, "background-color"));
      String property = styleElement.getProperty(bkColorProperty);
      if (property != null) {
        try {
          color = new Color(property);
        } catch (Exception e) {
          // use default background color White
View Full Code Here

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

   *
   * @return the background color of this cell
   */
  public String getCellBackgroundColorString() {
    String color = DEFAULT_BACKGROUND_COLOR;
    OdfStyleBase styleElement = getCellStyleElement();
    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

  public void setCellBackgroundColor(Color cellBackgroundColor) {
    if (cellBackgroundColor == null) {
      cellBackgroundColor = Color.WHITE;
    }
    splitRepeatedCells();
    OdfStyleBase styleElement = getCellStyleElementForWrite();
    if (styleElement != null) {
      OdfStyleProperty bkColorProperty = OdfStyleProperty.get(OdfStylePropertiesSet.TableCellProperties,
          OdfName.newName(OdfDocumentNamespace.FO, "background-color"));
      styleElement.setProperty(bkColorProperty, cellBackgroundColor.toString());
    }
  }
View Full Code Here

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

    if (!Color.isValid(cellBackgroundColor)) {
      Logger.getLogger(OdfTableCell.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 = getCellStyleElementForWrite();
    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

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

  private void setDataDisplayStyleName(String name) {
    OdfStyleBase styleElement = getCellStyleElementForWrite();
    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

    return styleElement;
  }

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

    return datadisplayStylename;
  }
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.