Package org.odftoolkit.odfdom.dom.element

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


    if (tempColor != null)
      return tempColor;

    boolean isDefault = isUseDefaultStyle;
    // find in parent style definition
    OdfStyleBase parentStyle = null;
    if (!isDefault)
      parentStyle = getParentStyle((OdfStyle) getCurrentUsedStyle());
    while ((!isDefault) && (parentStyle != null)) {
      TableCellProperties parentStyleSetting = TableCellProperties.getTableCellProperties(parentStyle);
      tempColor = parentStyleSetting.getBackgroundColor();
View Full Code Here


    if (tempBorder != null)
      return tempBorder;

    boolean isDefault = isUseDefaultStyle;
    // find in parent style definition
    OdfStyleBase parentStyle = null;
    if (!isDefault)
      parentStyle = getParentStyle((OdfStyle) getCurrentUsedStyle());
    while ((!isDefault) && (parentStyle != null)) {
      TableCellProperties parentStyleSetting = TableCellProperties.getTableCellProperties(parentStyle);
      tempBorder = getNullableBorder(parentStyleSetting, type);
View Full Code Here

    if (tempAlign != null)
      return tempAlign;

    boolean isDefault = isUseDefaultStyle;
    // find in parent style definition
    OdfStyleBase parentStyle = null;
    if (!isDefault)
      parentStyle = getParentStyle((OdfStyle) getCurrentUsedStyle());
    while ((!isDefault) && (parentStyle != null)) {
      TableCellProperties parentStyleSetting = TableCellProperties.getTableCellProperties(parentStyle);
      tempAlign = parentStyleSetting.getVerticalAlignment();
View Full Code Here

    if (tempBool != null)
      return tempBool.booleanValue();

    boolean isDefault = isUseDefaultStyle;
    // find in parent style definition
    OdfStyleBase parentStyle = null;
    if (!isDefault)
      parentStyle = getParentStyle((OdfStyle) getCurrentUsedStyle());
    while ((!isDefault) && (parentStyle != null)) {
      TableCellProperties parentStyleSetting = TableCellProperties.getTableCellProperties(parentStyle);
      tempBool = parentStyleSetting.isWrapped();
View Full Code Here

    if (tempAlign != null)
      return tempAlign;

    boolean isDefault = isUseDefaultStyle;
    // find in parent style definition
    OdfStyleBase parentStyle = null;
    if (!isDefault)
      parentStyle = getParentStyle((OdfStyle) getCurrentUsedStyle());
    while ((!isDefault) && (parentStyle != null)) {
      ParagraphProperties parentStyleSetting = ParagraphProperties.getParagraphProperties(parentStyle);
      tempAlign = parentStyleSetting.getHorizontalAlignment();
View Full Code Here

    OdfNumberTimeStyle timeStyle = new OdfNumberTimeStyle(
        (OdfFileDom) element.getOwnerDocument(), formatStr, name);
    timeStyle.setNumberLanguageAttribute(locale.getLanguage());
    timeStyle.setNumberCountryAttribute(locale.getCountry());
    element.getAutomaticStyles().appendChild(timeStyle);
    OdfStyleBase styleElement = drawingShape.getStyleHandler()
        .getStyleElementForWrite();
    if (styleElement != null) {
      styleElement.setOdfAttributeValue(OdfName.newName(
          OdfDocumentNamespace.STYLE, "data-style-name"), name);
    }
  }
View Full Code Here

   * @since 0.5.5
   */
  public void setVerticalMargin(double spaceTop, double spaceBottom) {
    String tableStyleName = mTableElement.getStyleName();
    OdfOfficeAutomaticStyles automaticStyles = mTableElement.getAutomaticStyles();
    OdfStyleBase tableStyle = automaticStyles.getStyle(tableStyleName, OdfStyleFamily.Table);
    if (tableStyle != null) {
      tableStyle.setProperty(StyleTablePropertiesElement.MarginTop,
          (new DecimalFormat("#0.##").format(spaceTop) + Unit.CENTIMETER.abbr()).replace(",", "."));
      tableStyle.setProperty(StyleTablePropertiesElement.MarginBottom, (new DecimalFormat("#0.##")
          .format(spaceBottom) + Unit.CENTIMETER.abbr()).replace(",", "."));
    }
  }
View Full Code Here

  protected void refreshAfterFrontalInsert(Selection insertedItem) {
    textSelection.refreshAfterFrontalInsert(insertedItem);
  }

  private ParagraphProperties getParagraphPropertiesForWrite() {
    OdfStyleBase style = paragraphContainer.getStyleHandler()
        .getStyleElementForRead();
    if (style == null || style.getLocalName().equals("default-style")) {
      OdfStyle element = paragraphContainer.getStyleHandler()
          .getStyleElementForWrite();
      NodeList nodes = element.getChildNodes();
      int size = nodes.getLength();
      for (int i = 0; i < size; i++) {
View Full Code Here

    ParagraphProperties properties = paragraphContainer.getStyleHandler()
        .getParagraphPropertiesForWrite();
    return properties;
  }
  private OdfStyleBase getParagraphStyleElementForWrite() {
    OdfStyleBase style = paragraphContainer.getStyleHandler()
        .getStyleElementForRead();
    OdfStyle element = paragraphContainer.getStyleHandler()
        .getStyleElementForWrite();
    if (style == null || style.getLocalName().equals("default-style")) {
      NodeList nodes = element.getChildNodes();
      int size = nodes.getLength();
      for (int i = 0; i < size; i++) {
        element.removeChild(nodes.item(0));
      }
View Full Code Here

  }
  private void cleanBreakProperty(Paragraph paragraph) {
    TextNavigation search = this.textSelection.getTextNavigation();
    if (search == null)
      throw new IllegalStateException("Navigation is null");
    OdfStyleBase styleElement = paragraph.getStyleHandler()
        .getStyleElementForRead();
    String name = styleElement.getAttribute("style:name");
    String newName = null;
    OdfElement modifiedStyleElement = search
        .getModifiedStyleElement(styleElement);
    if (modifiedStyleElement == null) {
      modifiedStyleElement = (OdfElement) styleElement.cloneNode(true);
      search.addModifiedStyleElement(styleElement, modifiedStyleElement);
      NodeList paragraphProperties = modifiedStyleElement
          .getElementsByTagName("style:paragraph-properties");
      if (paragraphProperties != null
          && paragraphProperties.getLength() > 0) {
        StyleParagraphPropertiesElement property = (StyleParagraphPropertiesElement) paragraphProperties
            .item(0);
        property.removeAttribute("fo:break-before");
        property.removeAttribute("fo:break-after");
        property.removeAttribute("style:page-number");
      }
      modifiedStyleElement.removeAttribute("style:master-page-name");
      newName = name + "-" + makeUniqueName();
      NamedNodeMap attributes = modifiedStyleElement.getAttributes();
      if (attributes != null) {
        for (int i = 0; i < attributes.getLength(); i++) {
          Node item = attributes.item(i);
          String value = item.getNodeValue();
          if (name.equals(value)) {
            item.setNodeValue(newName);
            break;
          }
        }
      }
      styleElement.getParentNode().appendChild(modifiedStyleElement);
    } else {
      newName = modifiedStyleElement.getAttribute("style:name");
    }
    NamedNodeMap attributes = paragraph.getOdfElement().getAttributes();
    if (attributes != null) {
View Full Code Here

TOP

Related Classes of org.odftoolkit.odfdom.dom.element.OdfStyleBase

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.