From 99cea43742283d7bc383021ebd52087115448159 Mon Sep 17 00:00:00 2001 From: "David A. Madore" Date: Sun, 18 Apr 2010 21:07:21 +0200 Subject: Rename TodoContext class to Context. Usually call "ctx" its instances. --- org/madore/damlengine/TodoDamlElement.java | 48 +++++++++++++++--------------- 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'org/madore/damlengine/TodoDamlElement.java') 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 childList = getChildList(this.node); ArrayList toProcess = new ArrayList(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 -- cgit v1.2.3