Package org.odftoolkit.odfdom.dom.element.table

Examples of org.odftoolkit.odfdom.dom.element.table.TableContentValidationElement


   *            the list of allowed values.
   * @since 0.6
   */
  public void setValidityList(List<String> values) {
    try {
      TableContentValidationElement validation = getContentValidationEle();
      validation.setTableAllowEmptyCellAttribute(true);
      String split = "";
      StringBuilder listStr = new StringBuilder("");
      for (String value : values) {
        listStr.append(split);
        listStr.append("\"");
        listStr.append(value);
        listStr.append("\"");
        split = ";";
      }
      validation.setTableConditionAttribute("cell-content-is-in-list(" + listStr + ")");
      String tableName = getTableElement().getTableNameAttribute();
      validation.setTableBaseCellAddressAttribute(tableName + "." + getCellAddress());
      validation.setTableDisplayListAttribute("unsorted");
    } catch (Exception e) {
      Logger.getLogger(Cell.class.getName()).log(Level.SEVERE, null, e);
    }
  }
View Full Code Here


   *            the text of the tip.
   * @since 0.6
   */
  public void setInputHelpMessage(String title, String text) {
    try {
      TableContentValidationElement validationElement = getContentValidationEle();
      TableHelpMessageElement helpMessageElement = OdfElement.findFirstChildNode(TableHelpMessageElement.class,
          validationElement);
      if (helpMessageElement != null) {
        validationElement.removeChild(helpMessageElement);
      }
      helpMessageElement = validationElement.newTableHelpMessageElement();
      helpMessageElement.setTableTitleAttribute(title);
      helpMessageElement.setTableDisplayAttribute(true);
      helpMessageElement.newTextPElement().setTextContent(text);
    } catch (Exception e) {
      Logger.getLogger(Cell.class.getName()).log(Level.SEVERE, null, e);
View Full Code Here

      validations = (TableContentValidationsElement) OdfXMLFactory.newOdfElement(ownerDocument
          .getContentDom(), OdfName.newName(OdfDocumentNamespace.TABLE, "content-validations"));
      contentRootElement.insertBefore(validations, contentRootElement.getFirstChild());
    }
    String validationName = getOdfElement().getTableContentValidationNameAttribute();
    TableContentValidationElement validationElement = null;
    if (validationName != null) {
      Node child = validations.getFirstChild();
      while (child != null) {
        TableContentValidationElement contentValidationElementRef = (TableContentValidationElement) child;
        if (validationName.equals(contentValidationElementRef.getTableNameAttribute())) {
          validationElement = contentValidationElementRef;
          break;
        }
      }
    } else {
View Full Code Here

   *            the list of allowed values.
   * @since 0.6
   */
  public void setValidityList(List<String> values) {
    try {
      TableContentValidationElement validation = getContentValidationEle();
      validation.setTableAllowEmptyCellAttribute(true);
      String split = "";
      StringBuilder listStr = new StringBuilder("");
      for (String value : values) {
        listStr.append(split);
        listStr.append("\"");
        listStr.append(value);
        listStr.append("\"");
        split = ";";
      }
      validation.setTableConditionAttribute("cell-content-is-in-list(" + listStr + ")");
      String tableName = getTableElement().getTableNameAttribute();
      validation.setTableBaseCellAddressAttribute(tableName + "." + getCellAddress());
      validation.setTableDisplayListAttribute("unsorted");
    } catch (Exception e) {
      Logger.getLogger(Cell.class.getName()).log(Level.SEVERE, null, e);
    }
  }
View Full Code Here

   *            the text of the tip.
   * @since 0.6
   */
  public void setInputHelpMessage(String title, String text) {
    try {
      TableContentValidationElement validationElement = getContentValidationEle();
      TableHelpMessageElement helpMessageElement = OdfElement.findFirstChildNode(TableHelpMessageElement.class,
          validationElement);
      if (helpMessageElement != null) {
        validationElement.removeChild(helpMessageElement);
      }
      helpMessageElement = validationElement.newTableHelpMessageElement();
      helpMessageElement.setTableTitleAttribute(title);
      helpMessageElement.setTableDisplayAttribute(true);
      helpMessageElement.newTextPElement().setTextContent(text);
    } catch (Exception e) {
      Logger.getLogger(Cell.class.getName()).log(Level.SEVERE, null, e);
View Full Code Here

      validations = (TableContentValidationsElement) OdfXMLFactory.newOdfElement(ownerDocument
          .getContentDom(), OdfName.newName(OdfDocumentNamespace.TABLE, "content-validations"));
      contentRootElement.insertBefore(validations, contentRootElement.getFirstChild());
    }
    String validationName = getOdfElement().getTableContentValidationNameAttribute();
    TableContentValidationElement validationElement = null;
    if (validationName != null) {
      Node child = validations.getFirstChild();
      while (child != null) {
        TableContentValidationElement contentValidationElementRef = (TableContentValidationElement) child;
        if (validationName.equals(contentValidationElementRef.getTableNameAttribute())) {
          validationElement = contentValidationElementRef;
          break;
        }
      }
    } else {
View Full Code Here

   *            the list of allowed values.
   * @since 0.6
   */
  public void setValidityList(List<String> values) {
    try {
      TableContentValidationElement validation = getContentValidationEle();
      validation.setTableAllowEmptyCellAttribute(true);
      String split = "";
      StringBuilder listStr = new StringBuilder("");
      for (String value : values) {
        listStr.append(split);
        listStr.append("\"");
        listStr.append(value);
        listStr.append("\"");
        split = ";";
      }
      validation.setTableConditionAttribute("cell-content-is-in-list(" + listStr + ")");
      String tableName = getTableElement().getTableNameAttribute();
      validation.setTableBaseCellAddressAttribute(tableName + "." + getCellAddress());
      validation.setTableDisplayListAttribute("unsorted");
    } catch (Exception e) {
      Logger.getLogger(Cell.class.getName()).log(Level.SEVERE, null, e);
    }
  }
View Full Code Here

   *            the text of the tip.
   * @since 0.6
   */
  public void setInputHelpMessage(String title, String text) {
    try {
      TableContentValidationElement validationElement = getContentValidationEle();
      TableHelpMessageElement helpMessageElement = OdfElement.findFirstChildNode(TableHelpMessageElement.class,
          validationElement);
      if (helpMessageElement != null) {
        validationElement.removeChild(helpMessageElement);
      }
      helpMessageElement = validationElement.newTableHelpMessageElement();
      helpMessageElement.setTableTitleAttribute(title);
      helpMessageElement.setTableDisplayAttribute(true);
      helpMessageElement.newTextPElement().setTextContent(text);
    } catch (Exception e) {
      Logger.getLogger(Cell.class.getName()).log(Level.SEVERE, null, e);
View Full Code Here

      validations = (TableContentValidationsElement) OdfXMLFactory.newOdfElement(ownerDocument
          .getContentDom(), OdfName.newName(OdfDocumentNamespace.TABLE, "content-validations"));
      contentRootElement.insertBefore(validations, contentRootElement.getFirstChild());
    }
    String validationName = getOdfElement().getTableContentValidationNameAttribute();
    TableContentValidationElement validationElement = null;
    if (validationName != null) {
      Node child = validations.getFirstChild();
      while (child != null) {
        TableContentValidationElement contentValidationElementRef = (TableContentValidationElement) child;
        if (validationName.equals(contentValidationElementRef.getTableNameAttribute())) {
          validationElement = contentValidationElementRef;
          break;
        }
      }
    } else {
View Full Code Here

TOP

Related Classes of org.odftoolkit.odfdom.dom.element.table.TableContentValidationElement

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.