From 8b2d4cc55eba7b1431a861beaf8181d0052b76bf Mon Sep 17 00:00:00 2001 From: "David A. Madore" Date: Mon, 19 Apr 2010 09:48:21 +0200 Subject: Rather than an ad hoc "Options" class, use caller todo directly. --- org/madore/damlengine/TodoBodyElement.java | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'org/madore/damlengine/TodoBodyElement.java') diff --git a/org/madore/damlengine/TodoBodyElement.java b/org/madore/damlengine/TodoBodyElement.java index c5cc6c8..2ee2286 100644 --- a/org/madore/damlengine/TodoBodyElement.java +++ b/org/madore/damlengine/TodoBodyElement.java @@ -9,19 +9,19 @@ public class TodoBodyElement extends TodoDefaultElement { public static class Factory extends TodoElement.Factory { public TodoBodyElement newItem(Element node, Context ctx, - TodoItem.Options options) { - return new TodoBodyElement(node, ctx, options); + TodoItem caller) { + return new TodoBodyElement(node, ctx, caller); } } public TodoBodyElement(Element node, Context ctx, - TodoItem.Options options) { - super(node, ctx, options); + TodoItem caller) { + super(node, ctx, caller); } public void handleNodeOnly() { - if ( ! ( options instanceof TodoDamlElement.DamlOptions ) ) + if ( ! ( caller instanceof TodoDamlElement ) ) throw new IllegalArgumentException("body node can only be child of daml node"); Element bodyNode = ctx.doc.createElementNS(DamlEngine.XHTML_NS, "body"); @@ -38,16 +38,14 @@ public class TodoBodyElement extends TodoDefaultElement { "d:implicit-do-navbar"); bodyNode.appendChild(ctx.doc.createTextNode("\n")); bodyNode.appendChild(token); - // toProcess.add(new TodoNavbar(token, this.ctx, - // new TodoItem.Options())); + // toProcess.add(new TodoNavbar(token, this.ctx, this)); } if ( node.getAttributeNS(null, "notranslations").equals("") ) { Element token = ctx.doc.createElementNS(DamlEngine.DAML_NS, "d:implicit-do-translations"); bodyNode.appendChild(ctx.doc.createTextNode("\n")); bodyNode.appendChild(token); - // toProcess.add(new TodoTranslations(token, this.ctx, - // new TodoItem.Options())); + // toProcess.add(new TodoTranslations(token, this.ctx, this)); } for ( Node child : childList ) { if ( child.getNodeType() == Node.TEXT_NODE @@ -58,8 +56,7 @@ public class TodoBodyElement extends TodoDefaultElement { bodyNode.appendChild(child); if ( child.getNodeType() == Node.ELEMENT_NODE ) { TodoElement it - = TodoElement.getTodoElement((Element)child, this.ctx, - new TodoItem.Options()); + = TodoElement.getTodoElement((Element)child, this.ctx, this); toProcess.add(it); } } @@ -68,8 +65,7 @@ public class TodoBodyElement extends TodoDefaultElement { "d:implicit-do-footer"); bodyNode.appendChild(token); bodyNode.appendChild(ctx.doc.createTextNode("\n")); - // toProcess.add(new TodoFooter(token, this.ctx, - // new TodoItem.Options())); + // toProcess.add(new TodoFooter(token, this.ctx, this)); } this.ownerDeque.registerAtStart(toProcess); } -- cgit v1.2.3