private void addBookmarkEnd(int id, DocumentFragment docfrag) { CTMarkupRange markuprange = Context.getWmlObjectFactory().createCTMarkupRange(); markuprange.setId( BigInteger.valueOf(id ) ); Document tmpDoc = XmlUtils.marshaltoW3CDomDocument(markuprange); XmlUtils.treeCopy(tmpDoc.getDocumentElement(), docfrag); }
/** * Create an instance of {@link CTMarkupRange } * */ public CTMarkupRange createCTMarkupRange() { return new CTMarkupRange(); }
private CTMarkupRange findEnds(List<CTMarkupRange> ends, BigInteger id) { for (CTMarkupRange bm : ends) { if (bm.getId()==id) { return bm; } } return null; //shouldn't happen }
CTMarkupRange mr = (CTMarkupRange)o; List<Object> theList = null; if (mr.getParent() instanceof List) { theList = (List)mr.getParent(); // eg blockRange.getContents() } else { theList = ((ContentAccessor)(mr.getParent())).getContent(); CTMarkupRange mr = (CTMarkupRange)o; List<Object> theList = null; if (mr.getParent() instanceof List) { theList = (List)mr.getParent(); // eg blockRange.getContents() } else { theList = ((ContentAccessor)(mr.getParent())).getContent(); CTMarkupRange mr = Context.getWmlObjectFactory().createCTMarkupRange(); mr.setId(BigInteger.valueOf(newId)); JAXBElement<CTMarkupRange> bmEnd = Context.getWmlObjectFactory().createBodyBookmarkEnd(mr); paragraphs.add(bmEnd);
&& (!(o instanceof CTBookmark) /* exclude starts - note inheritance hierarchy */ )) { CTMarkupRange end = (CTMarkupRange)o; Object parent = end.getParent(); if (parent instanceof ContentAccessor) { if (remove( ((ContentAccessor)parent).getContent(), o)) { write("FIXME Couldn't find end " + end.getId().longValue() ); log.warn("FIXME Couldn't find end " + end.getId().longValue() );
/** * This method is invoked by the JAXB implementation on each instance when unmarshalling completes. * * @param parent * The parent object in the object tree. * @param unmarshaller * The unmarshaller that generated the instance. */ public void afterUnmarshal(Unmarshaller unmarshaller, Object parent) { setParent(parent); }
CTMarkupRange mr = (CTMarkupRange)o; List<Object> theList = null; if (mr.getParent() instanceof List) { theList = (List)mr.getParent(); // eg blockRange.getContents() } else { theList = ((ContentAccessor)(mr.getParent())).getContent(); CTMarkupRange mr = (CTMarkupRange)o; List<Object> theList = null; if (mr.getParent() instanceof List) { theList = (List)mr.getParent(); // eg blockRange.getContents() } else { theList = ((ContentAccessor)(mr.getParent())).getContent(); CTMarkupRange mr = Context.getWmlObjectFactory().createCTMarkupRange(); mr.setId(BigInteger.valueOf(newId)); JAXBElement<CTMarkupRange> bmEnd = Context.getWmlObjectFactory().createBodyBookmarkEnd(mr); paragraphs.add(bmEnd);
&& (!(o instanceof CTBookmark) /* exclude starts - note inheritance hierarchy */ )) { CTMarkupRange end = (CTMarkupRange)o; Object parent = end.getParent(); if (parent instanceof ContentAccessor) { if (remove( ((ContentAccessor)parent).getContent(), o)) { write("FIXME Couldn't find end " + end.getId().longValue() ); log.warn("FIXME Couldn't find end " + end.getId().longValue() );
/** * This method is invoked by the JAXB implementation on each instance when unmarshalling completes. * * @param parent * The parent object in the object tree. * @param unmarshaller * The unmarshaller that generated the instance. */ public void afterUnmarshal(Unmarshaller unmarshaller, Object parent) { setParent(parent); }
private void appendBookmarksToMove(Object child) { CTBookmark bm = (CTBookmark)XmlUtils.unwrap(child); JAXBElement<CTMarkupRange> jaxbBmEnd = null; CTMarkupRange bmEnd = null; bookmarksStartToMove.add(child); //The bookmarkEnd is put directly after a moved bookmarkStart in the paragraph. //the corresponding bookmarkEnd is later deleted //(this ensures that the bookmarkEnd isn't before the bookmarkStart bmEnd = Context.getWmlObjectFactory().createCTMarkupRange(); bmEnd.setId(bm.getId()); jaxbBmEnd = Context.getWmlObjectFactory().createPBookmarkEnd(bmEnd); bookmarksStartToMove.add(jaxbBmEnd); bookmarksEndToRemove.add(bm.getId()); }
/** * Create an instance of {@link CTMarkupRange } * */ public CTMarkupRange createCTMarkupRange() { return new CTMarkupRange(); }
mr.setId(ID); JAXBElement<CTMarkupRange> bmEnd = factory.createBodyBookmarkEnd(mr); p.getContent().add(bmEnd);
BigInteger id = bm.getId();
@Override public CTMarkupRange createBookmarkEnd(final CTBookmark bookmarkStart, final boolean isBlockBookmark) { CTMarkupRange mr = myFactory.createCTMarkupRange(); mr.setId(bookmarkStart.getId()); JAXBElement<CTMarkupRange> bmEnd = myFactory.createBodyBookmarkEnd(mr); if (isBlockBookmark) { myContentContainer.addContentElement(bmEnd); } else { // add as inline getP().getContent().add(bmEnd); } return mr; }
private CTMarkupRange findEnds(List<CTMarkupRange> ends, BigInteger id) { for (CTMarkupRange bm : ends) { if (bm.getId()==id) { return bm; } } return null; //shouldn't happen }
private CTMarkupRange generateBookmarkEnd() { CTMarkupRange markuprange = Context.getWmlObjectFactory().createCTMarkupRange(); markuprange.setId( BigInteger.valueOf(getBookmarkId().getAndIncrement() ) ); return markuprange; }
private void addBookmarkEnd(int id, DocumentFragment docfrag) { CTMarkupRange markuprange = Context.getWmlObjectFactory().createCTMarkupRange(); markuprange.setId( BigInteger.valueOf(id ) ); Document tmpDoc = XmlUtils.marshaltoW3CDomDocument(markuprange); XmlUtils.treeCopy(tmpDoc.getDocumentElement(), docfrag); }
BigInteger id = bm.getId();