Package org.odftoolkit.odfdom.pkg

Examples of org.odftoolkit.odfdom.pkg.OdfElement


     * @param cutItem
     *            the cut item
     */
    public synchronized static void refreshAfterCut(Selection cutItem) {
      // travase the whole sub tree
      OdfElement element = cutItem.getElement();
      if (repository.containsKey(element)) {
        Vector<Selection> selections = repository.get(element);
        for (int i = 0; i < selections.size(); i++) {
          if (selections.get(i).getIndex() > cutItem.getIndex()) {
            selections.get(i).refreshAfterFrontalDelete(cutItem);
View Full Code Here


  public List<TableTableElement> getTables() {
    List<TableTableElement> tableList = new ArrayList<TableTableElement>();
    try {
      // find tables from content.xml
      OfficeBodyElement officeBody = OdfElement.findFirstChildNode(OfficeBodyElement.class, getContentDom().getRootElement());
      OdfElement contentRoot = OdfElement.findFirstChildNode(OdfElement.class, officeBody);
      tableList = fillTableList(contentRoot, tableList);
     
      // find tables from styles.xml (header & footer)
      Map<String, StyleMasterPageElement> masterPages = getMasterPages();
      StyleMasterPageElement defaultMasterPage = masterPages.get("Standard");
View Full Code Here

   * @return the default value as <code>String</code> dependent of its element name
   *         return <code>null</code> if the default value does not exist
   */
  @Override
  public String getDefault() {
    OdfElement parentElement = (OdfElement)getOwnerElement();
    String defaultValue = null;
    if (parentElement != null) {
      if (parentElement instanceof DbConnectionResourceElement) {
        defaultValue = DEFAULT_VALUE_ONREQUEST;
      }
View Full Code Here

   * @return the default value as <code>String</code> dependent of its element name
   *         return <code>null</code> if the default value does not exist
   */
  @Override
  public String getDefault() {
    OdfElement parentElement = (OdfElement)getOwnerElement();
    String defaultValue = null;
    if (parentElement != null) {
      if (parentElement instanceof AnimAnimateElement) {
        defaultValue = DEFAULT_VALUE_DISCRETE;
      }
View Full Code Here

   * @return the default value as <code>String</code> dependent of its element name
   *         return <code>null</code> if the default value does not exist
   */
  @Override
  public String getDefault() {
    OdfElement parentElement = (OdfElement)getOwnerElement();
    String defaultValue = null;
    if (parentElement != null) {
      if (parentElement instanceof DbConnectionResourceElement) {
        defaultValue = DEFAULT_VALUE_NONE;
      }
View Full Code Here

   * @return the default value as <code>String</code> dependent of its element name
   *         return <code>null</code> if the default value does not exist
   */
  @Override
  public String getDefault() {
    OdfElement parentElement = (OdfElement)getOwnerElement();
    String defaultValue = null;
    if (parentElement != null) {
      if (parentElement instanceof DrawConnectorElement) {
        defaultValue = DEFAULT_VALUE_STANDARD;
      }
View Full Code Here

   * @return the default value as <code>String</code> dependent of its element name
   *         return <code>null</code> if the default value does not exist
   */
  @Override
  public String getDefault() {
    OdfElement parentElement = (OdfElement)getOwnerElement();
    String defaultValue = null;
    if (parentElement != null) {
      defaultValue=DEFAULT_VALUE;
    }
    return defaultValue;
View Full Code Here

          doc3.save(TEST_FILE_SAVE_EMBEDDED_OUT2);

          OdfDocument testLoad = OdfDocument.loadDocument(TEST_FILE_SAVE_EMBEDDED_OUT2);
          NodeList linkNodes = (NodeList) xpath.evaluate("//*[@xlink:href]", testLoad.getContentDom(), XPathConstants.NODE);
          for (int i = 0; i < linkNodes.getLength(); i++) {
            OdfElement object = (OdfElement) linkNodes.item(i);
            String refObjPath = object.getAttributeNS(OdfDocumentNamespace.XLINK.getUri(), "href");
            Assert.assertTrue(refObjPath.equals("Pictures/"  + TEST_PIC|| refObjPath.equals("./NewEmbedded"));
          }
          Assert.assertNotNull(testLoad.getPackage().getFileEntry("Pictures/" + TEST_PIC));
          OdfDocument embedDocOftestLoad = testLoad.loadSubDocument("NewEmbedded/");
          contentDom4 = embedDocOftestLoad.getContentDom();
View Full Code Here

  public List addList(ListDecorator decorator) {
    return new List(this, decorator);
  }

  public void clearList() {
    OdfElement containerElement = getListContainerElement();
    Node child = getListContainerElement().getFirstChild();
    while (child != null) {
      if (child instanceof TextListElement) {
        Node tmp = child;
        child = child.getNextSibling();
        containerElement.removeChild(tmp);
      } else {
        child = child.getNextSibling();
      }
    }
  }
View Full Code Here

  public Iterator<List> getListIterator() {
    return new SimpleListIterator(this);
  }

  public boolean removeList(List list) {
    OdfElement containerElement = getListContainerElement();
    Node child = containerElement.getFirstChild();
    OdfFileDom ownerDocument = (OdfFileDom) containerElement.getOwnerDocument();
    Document doc = (Document) ownerDocument.getDocument();
    while (child != null) {
      if (child instanceof TextListElement) {
        TextListElement listElement1 = (TextListElement) child;
        String id1 = listElement1.getXmlIdAttribute();
        TextListElement listElement2 = list.getOdfElement();
        String id2 = listElement2.getXmlIdAttribute();
        if ((listElement1 == listElement2) || ((id1 != null) && (id2 != null) && (id1.equals(id2)))) {
          doc.removeElementLinkedResource(listElement1);
          containerElement.removeChild(child);
          return true;
        }
      }
      child = child.getNextSibling();
    }
View Full Code Here

TOP

Related Classes of org.odftoolkit.odfdom.pkg.OdfElement

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.