package org.madore.damlengine; import java.util.ArrayList; import org.w3c.dom.*; public final class TodoEntryTitleElement extends TodoDefaultElement { public static class Factory extends TodoElement.Factory { @Override public TodoEntryTitleElement newItem(Element node, Context ctx, TodoItem caller) { return new TodoEntryTitleElement(node, ctx, caller); } } public TodoEntryTitleElement(Element node, Context ctx, TodoItem caller) { super(node, ctx, caller); } @Override public void handleNodeOnly() { Element h2 = ctx.doc.createElementNS(DamlEngine.XHTML_NS, "h2"); String explicitLang = LangHelper.getLangNorec(node); if ( explicitLang != null ) LangHelper.setLangNorec(h2, explicitLang); node.getParentNode().replaceChild(h2, node); h2.setAttributeNS(null, "class", "weblog-entry-title"); ArrayList childList = getChildList(this.node); ArrayList toProcess = new ArrayList(childList.size()); for ( Node child : childList ) { h2.appendChild(child); if ( child.getNodeType() == Node.ELEMENT_NODE ) { TodoElement it = TodoElement.getTodoElement((Element)child, this.ctx, this); toProcess.add(it); } } this.ownerDeque.registerAtStart(toProcess); } }