Package org.apache.xmlbeans

Examples of org.apache.xmlbeans.XmlCursor.toParent()


     * verifies that cursor is on the right position
     * @param cursor
     */
    private boolean isCursorInBody(XmlCursor cursor) {
        XmlCursor verify = cursor.newCursor();
        verify.toParent();
        try {
            return (verify.getObject() == this.ctDocument.getBody());
        } finally {
            verify.dispose();
        }
View Full Code Here


   * get the TableCell which belongs to the TableCell
   * @param cell
   */
  public XWPFTableCell getTableCell(CTTc cell) {
    XmlCursor cursor = cell.newCursor();
    cursor.toParent();
    XmlObject o = cursor.getObject();
    if(!(o instanceof CTRow)){
      return null;
    }
    CTRow row = (CTRow)o;
View Full Code Here

    XmlObject o = cursor.getObject();
    if(!(o instanceof CTRow)){
      return null;
    }
    CTRow row = (CTRow)o;
    cursor.toParent();
    o = cursor.getObject();
        cursor.dispose();
    if(! (o instanceof CTTbl)){
      return null;
    }
View Full Code Here

  /**
   * verifies that cursor is on the right position
   */
  private boolean isCursorInTableCell(XmlCursor cursor) {
    XmlCursor verify = cursor.newCursor();
    verify.toParent();
    if(verify.getObject() == this.ctTc){
      return true;
    }
    return false;
  }
View Full Code Here

  /**
   * get the TableCell which belongs to the TableCell
   */
  public XWPFTableCell getTableCell(CTTc cell) {
    XmlCursor cursor = cell.newCursor();
    cursor.toParent();
    XmlObject o = cursor.getObject();
    if(!(o instanceof CTRow)){
      return null;
    }
    CTRow row = (CTRow)o;
View Full Code Here

    XmlObject o = cursor.getObject();
    if(!(o instanceof CTRow)){
      return null;
    }
    CTRow row = (CTRow)o;
    cursor.toParent();
    o = cursor.getObject();
        cursor.dispose();
    if(! (o instanceof CTTbl)){
      return null;
    }
View Full Code Here

    private XSSFAnchor getAnchorFromParent(XmlObject obj){
        XSSFAnchor anchor = null;

        XmlObject parentXbean = null;
        XmlCursor cursor = obj.newCursor();
        if(cursor.toParent()) parentXbean = cursor.getObject();
        cursor.dispose();
        if(parentXbean != null){
            if (parentXbean instanceof CTTwoCellAnchor) {
                CTTwoCellAnchor ct = (CTTwoCellAnchor)parentXbean;
                anchor = new XSSFClientAnchor(ct.getFrom(), ct.getTo());
View Full Code Here

     * @param cell
     * @see org.apache.poi.xwpf.usermodel.IBody#getTableCell(CTTc cell)
     */
    public XWPFTableCell getTableCell(CTTc cell) {
        XmlCursor cursor = cell.newCursor();
        cursor.toParent();
        XmlObject o = cursor.getObject();
        if(!(o instanceof CTRow)){
            return null;
        }
        CTRow row = (CTRow)o;
View Full Code Here

        XmlObject o = cursor.getObject();
        if(!(o instanceof CTRow)){
            return null;
        }
        CTRow row = (CTRow)o;
        cursor.toParent();
        o = cursor.getObject();
        cursor.dispose();
        if(! (o instanceof CTTbl)){
            return null;
        }
View Full Code Here

     * verifies that cursor is on the right position
     * @param cursor
     */
    private boolean isCursorInFtn(XmlCursor cursor) {
        XmlCursor verify = cursor.newCursor();
        verify.toParent();
        if(verify.getObject() == this.ctFtnEdn){
            return true;
        }
        return false;
    }
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.