private void processText(NodeTracker state, Text node) { BasedSequence original = node.getChars(); boolean wrapInTextBase = !(node.getParent() instanceof TextBase); TextBase textBase = null; while (wrapInTextBase) { if (wrapInTextBase) { wrapInTextBase = false; textBase = new TextBase(original); node.insertBefore(textBase); textBase.appendChild(node); state.nodeAdded(textBase); } } }
@Override protected String toStringAttributes() { return "text=" + getChars(); } }
@Override public void getAstExtra(StringBuilder out) { astExtraChars(out); }
static void textBaseWrap(final NodeTracker state, Node lastNonAttributesNode, final Node lastNode, final TextBase textBase) { while (lastNonAttributesNode != lastNode) { Node nextNode = lastNonAttributesNode.getNext(); lastNonAttributesNode.unlink(); state.nodeRemoved(lastNonAttributesNode); textBase.appendChild(lastNonAttributesNode); lastNonAttributesNode = nextNode; } textBase.setCharsFromContent(); lastNode.insertBefore(textBase); state.nodeAddedWithDescendants(textBase); }
private void visit(TextBase node) { myEndOffset = node.getEndOffset(); } }
static void textBaseWrap(final NodeTracker state, Node lastNonAttributesNode, final Node lastNode, final TextBase textBase) { while (lastNonAttributesNode != lastNode) { Node nextNode = lastNonAttributesNode.getNext(); lastNonAttributesNode.unlink(); state.nodeRemoved(lastNonAttributesNode); textBase.appendChild(lastNonAttributesNode); lastNonAttributesNode = nextNode; } textBase.setCharsFromContent(); lastNode.insertBefore(textBase); state.nodeAddedWithDescendants(textBase); }
private void visit(TextBase node) { myEndOffset = node.getEndOffset(); } }
private void visit(Text node) { if (!node.isOrDescendantOfType(DoNotDecorate.class)) { // do some processing BasedSequence original = node.getChars(); boolean wrapInTextBase = !(node.getParent() instanceof TextBase); TextBase textBase = null; while (wrapInTextBase) { if (wrapInTextBase) { wrapInTextBase = false; textBase = new TextBase(original); node.insertBefore(textBase); textBase.appendChild(node); } } } }
private void visit(TextBase node) { out.append(node.getChars()); } }
@Override public void getAstExtra(StringBuilder out) { astExtraChars(out); }
textBase = new TextBase(original); node.insertBefore(textBase); state.nodeAdded(textBase); BasedSequence escapedChars = original.subSequence(lastEscaped, startOffset); Node node1 = new Text(escapedChars); textBase.appendChild(node1); state.nodeAdded(node1); textBase.appendChild(decorationNode); BasedSequence escapedChars = original.subSequence(lastEscaped, original.length()); Node node1 = new Text(escapedChars); textBase.appendChild(node1); state.nodeAdded(node1);
private void visit(TextBase node) { out.append(node.getChars()); } }
if (wrapInTextBase) { wrapInTextBase = false; textBase = new TextBase(original); node.insertBefore(textBase); state.nodeAdded(textBase); textBase.appendChild(node1); state.nodeAdded(node1); BasedSequence text = origToDecorateText.subSequence(1); EscapedCharacter decorationNode = new EscapedCharacter(origToDecorateText.subSequence(0, 1), text); textBase.appendChild(decorationNode); BasedSequence escapedChars = original.subSequence(lastEscaped, original.length()); Node node1 = new Text(escapedChars); textBase.appendChild(node1); state.nodeAdded(node1);
@Override protected String toStringAttributes() { return "text=" + getChars(); } }
textBase = new TextBase(original); node.insertBefore(textBase); state.nodeAdded(textBase); Node node1 = new Text(escapedChars); if (textBase != null) { textBase.appendChild(node1); } else { node.insertBefore(node1); linkNode.appendChild(contentNode); if (textBase != null) { textBase.appendChild(linkNode); } else { node.insertBefore(linkNode); Node node1 = new Text(escapedChars); if (textBase != null) { textBase.appendChild(node1); } else { node.insertBefore(node1);
private void visit(TextBase node) { out.append(node.getChars()); } }
TextBase textBase = new TextBase(); textBaseWrap(state, lastNonAttributesNode, attributesNode, textBase); previous = textBase; TextBase textBase = new TextBase(previous.getChars()); previous.insertBefore(textBase); previous.unlink(); state.nodeRemoved(previous); textBase.appendChild(previous); state.nodeAddedWithChildren(textBase); attributeOwner = textBase;
textBase = new TextBase(original); node.insertBefore(textBase); state.nodeAdded(textBase); BasedSequence escapedChars = original.subSequence(lastEscaped, startOffset); Node node1 = new Text(escapedChars); textBase.appendChild(node1); state.nodeAdded(node1); textBase.appendChild(decorationNode); BasedSequence escapedChars = original.subSequence(lastEscaped, original.length()); Node node1 = new Text(escapedChars); textBase.appendChild(node1); state.nodeAdded(node1);