/** @see IQueueRegion#newDequeueContext() */ public DequeueContext newDequeueContext() { IMarkupFragment markup = getRegionMarkup(); if (markup == null) { return null; } return new DequeueContext(markup, this, false); }
public DequeueContext(IMarkupFragment markup, MarkupContainer root, boolean skipFirst) { this.markup = markup; this.skipFirst = skipFirst; this.containers.push(root); this.next = nextTag(); }
@Override public void dequeue(DequeueContext dequeue) { if (size() > 0) { // essentially what we do is for every child replace the repeater with the child in // dequeue container stack and run the dequeue on the child. we also take care to reset // the state of the dequeue context after we process every child. Bookmark bookmark = dequeue.save(); for (Component child : this) { if (child instanceof MarkupContainer) { dequeue.popContainer(); // pop the repeater MarkupContainer container = (MarkupContainer) child; dequeue.pushContainer(container); container.dequeue(dequeue); dequeue.restore(bookmark); } } } dequeue.skipToCloseTag(); } }
private void dequeueChildrenContainer(DequeueContext dequeue, MarkupContainer child) { dequeue.pushContainer(child); child.dequeue(dequeue); dequeue.popContainer(); }
while (dequeue.isAtOpenOrOpenCloseTag()) ComponentTag tag = dequeue.takeTag(); child = dequeue.findComponentToDequeue(tag);
/** * Checks if the tag returned by {@link #peekTag()} is either open or open-close. * * @return */ public boolean isAtOpenOrOpenCloseTag() { ComponentTag tag = peekTag(); return tag != null && (tag.isOpen() || tag.isOpenClose()); }
DequeueTagAction action = canDequeueTag(tag); switch (action) switch (canDequeueTag(open))
while (dequeue.isAtOpenOrOpenCloseTag()) ComponentTag tag = dequeue.takeTag(); child = dequeue.findComponentToDequeue(tag);
private void dequeueChildrenContainer(DequeueContext dequeue, MarkupContainer child) { dequeue.pushContainer(child); child.dequeue(dequeue); dequeue.popContainer(); }
/** * Checks if the tag returned by {@link #peekTag()} is either open or open-close. * * @return */ public boolean isAtOpenOrOpenCloseTag() { ComponentTag tag = peekTag(); return tag != null && (tag.isOpen() || tag.isOpenClose()); }
DequeueTagAction action = canDequeueTag(tag); switch (action) switch (canDequeueTag(open))
@Override public void dequeue(DequeueContext dequeue) { if (size() > 0) { // essentially what we do is for every child replace the repeater with the child in // dequeue container stack and run the dequeue on the child. we also take care to reset // the state of the dequeue context after we process every child. Bookmark bookmark = dequeue.save(); for (Component child : this) { if (child instanceof MarkupContainer) { dequeue.popContainer(); // pop the repeater MarkupContainer container = (MarkupContainer) child; dequeue.pushContainer(container); container.dequeue(dequeue); dequeue.restore(bookmark); } } } dequeue.skipToCloseTag(); } }
/** @see IQueueRegion#newDequeueContext() */ public DequeueContext newDequeueContext() { IMarkupFragment markup = getRegionMarkup(); if (markup == null) { return null; } return new DequeueContext(markup, this, false); }
public DequeueContext(IMarkupFragment markup, MarkupContainer root, boolean skipFirst) { this.markup = markup; this.skipFirst = skipFirst; this.containers.push(root); this.next = nextTag(); }
if (dequeue.peekTag() != null)
@Override public DequeueContext newDequeueContext() { Border border = findParent(Border.class); IMarkupFragment fragment = border.getMarkup(); if (fragment == null) { return null; } return new DequeueContext(fragment, this, true); }
/** * Skips to the closing tag of the tag retrieved from last call to {@link #takeTag()} */ public void skipToCloseTag() { while (!next.closes(tags.peek())) { next = nextTag(); } }
if (dequeue.peekTag() != null)
@Override public DequeueContext newDequeueContext() { IMarkupFragment markup = getMarkupSourcingStrategy().getMarkup(this, null); if (markup == null) { return null; } return new DequeueContext(markup, this, true); } }
/** * Skips to the closing tag of the tag retrieved from last call to {@link #takeTag()} */ public void skipToCloseTag() { while (!next.closes(tags.peek())) { next = nextTag(); } }