diff options
Diffstat (limited to 'org/madore/damlengine/TodoDamlElement.java')
-rw-r--r-- | org/madore/damlengine/TodoDamlElement.java | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/org/madore/damlengine/TodoDamlElement.java b/org/madore/damlengine/TodoDamlElement.java index 88881ae..fefd0f1 100644 --- a/org/madore/damlengine/TodoDamlElement.java +++ b/org/madore/damlengine/TodoDamlElement.java @@ -8,16 +8,16 @@ public class TodoDamlElement extends TodoDefaultElement { public static class Factory extends TodoElement.Factory { public TodoDamlElement newItem(Element node, - TodoContext context, + Context ctx, TodoItem.Options options) { - return new TodoDamlElement(node, context, options); + return new TodoDamlElement(node, ctx, options); } } public TodoDamlElement(Element node, - TodoContext context, + Context ctx, TodoItem.Options options) { - super(node, context, options); + super(node, ctx, options); } public static class DamlOptions extends TodoItem.Options { @@ -28,42 +28,42 @@ public class TodoDamlElement extends TodoDefaultElement { throw new Error("daml node can only be root node"); String uriToTop = node.getAttributeNS(null, "uri-to-top"); if ( uriToTop != null ) - context.uriToTop = uriToTop; + ctx.uriToTop = uriToTop; String fileName = node.getAttributeNS(null, "file.name"); if ( fileName != null ) - context.fileName = fileName; + ctx.fileName = fileName; - if ( context.htmlNode != null ) + if ( ctx.htmlNode != null ) throw new Error("html node already defined at daml node"); - context.htmlNode = context.doc.createElementNS(DamlEngine.XHTML_NS, "html"); + ctx.htmlNode = ctx.doc.createElementNS(DamlEngine.XHTML_NS, "html"); String lang = LangHelper.getLangNorec(node); if ( lang != null ) - LangHelper.setLangNorec(context.htmlNode, lang); - node.getParentNode().replaceChild(context.htmlNode, node); - context.htmlNode.appendChild(context.doc.createTextNode("\n")); - context.htmlNode.appendChild(context.doc.createComment(" This file is automatically generated. Do not edit! ")); - context.htmlNode.appendChild(context.doc.createTextNode("\n")); - if ( context.headNode != null ) + LangHelper.setLangNorec(ctx.htmlNode, lang); + node.getParentNode().replaceChild(ctx.htmlNode, node); + ctx.htmlNode.appendChild(ctx.doc.createTextNode("\n")); + ctx.htmlNode.appendChild(ctx.doc.createComment(" This file is automatically generated. Do not edit! ")); + ctx.htmlNode.appendChild(ctx.doc.createTextNode("\n")); + if ( ctx.headNode != null ) throw new Error("head node already defined at daml node"); - context.headNode = context.doc.createElementNS(DamlEngine.XHTML_NS, "head"); - context.htmlNode.appendChild(context.headNode); - context.htmlNode.appendChild(context.doc.createTextNode("\n")); - context.headNode.appendChild(context.doc.createTextNode("\n")); + ctx.headNode = ctx.doc.createElementNS(DamlEngine.XHTML_NS, "head"); + ctx.htmlNode.appendChild(ctx.headNode); + ctx.htmlNode.appendChild(ctx.doc.createTextNode("\n")); + ctx.headNode.appendChild(ctx.doc.createTextNode("\n")); ArrayList<Node> childList = getChildList(this.node); ArrayList<TodoElement> toProcess = new ArrayList<TodoElement>(childList.size()); for ( Node child : childList ) { if ( child.getNodeType() == Node.ELEMENT_NODE ) { if ( child.getLocalName().equals("body") ) { - context.htmlNode.appendChild(context.doc.createTextNode("\n")); - context.htmlNode.appendChild(child); - context.htmlNode.appendChild(context.doc.createTextNode("\n")); + ctx.htmlNode.appendChild(ctx.doc.createTextNode("\n")); + ctx.htmlNode.appendChild(child); + ctx.htmlNode.appendChild(ctx.doc.createTextNode("\n")); } else { - context.headNode.appendChild(child); - context.headNode.appendChild(context.doc.createTextNode("\n")); + ctx.headNode.appendChild(child); + ctx.headNode.appendChild(ctx.doc.createTextNode("\n")); } TodoElement it - = TodoElement.getTodoElement((Element)child, this.context, + = TodoElement.getTodoElement((Element)child, this.ctx, new DamlOptions()); toProcess.add(it); } else if ( child.getNodeType() == Node.TEXT_NODE |