Author: adrianc
Date: Wed Dec 7 23:59:04 2011 New Revision: 1211716 URL: http://svn.apache.org/viewvc?rev=1211716&view=rev Log: Screen Widget Redesign - added TreeWidgetVisitor interface, also added accept methods to ModelTree subclasses. Added: ofbiz/branches/20111115ScreenWidgetRedesign/framework/widget/src/org/ofbiz/widget/tree/TreeWidgetVisitor.java (with props) Modified: ofbiz/branches/20111115ScreenWidgetRedesign/framework/widget/src/org/ofbiz/widget/tree/ModelTree.java Modified: ofbiz/branches/20111115ScreenWidgetRedesign/framework/widget/src/org/ofbiz/widget/tree/ModelTree.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20111115ScreenWidgetRedesign/framework/widget/src/org/ofbiz/widget/tree/ModelTree.java?rev=1211716&r1=1211715&r2=1211716&view=diff ============================================================================== --- ofbiz/branches/20111115ScreenWidgetRedesign/framework/widget/src/org/ofbiz/widget/tree/ModelTree.java (original) +++ ofbiz/branches/20111115ScreenWidgetRedesign/framework/widget/src/org/ofbiz/widget/tree/ModelTree.java Wed Dec 7 23:59:04 2011 @@ -85,10 +85,9 @@ public class ModelTree extends ModelWidg // ===== CONSTRUCTORS ===== /** Default Constructor */ - - /** XML Constructor */ public ModelTree() {} + /** XML Constructor */ public ModelTree(Element treeElement, Delegator delegator, LocalDispatcher dispatcher) { super(treeElement); this.rootNodeName = treeElement.getAttribute("root-node-name"); @@ -131,6 +130,10 @@ public class ModelTree extends ModelWidg } + public void accept(TreeWidgetVisitor visitor) { + visitor.visit(this); + } + public void setDefaultEntityName(String name) { String nm = name; if (UtilValidate.isEmpty(nm)) { @@ -364,6 +367,10 @@ public class ModelTree extends ModelWidg } + public void accept(TreeWidgetVisitor visitor) { + visitor.visit(this); + } + public void renderNodeString(Appendable writer, Map<String, Object> context, TreeStringRenderer treeStringRenderer, int depth) throws IOException, GeneralException { @@ -725,6 +732,10 @@ public class ModelTree extends ModelWidg } + public void accept(TreeWidgetVisitor visitor) { + visitor.visit(this); + } + public ModelTree.ModelNode getNode() { return this.rootNode; } @@ -763,6 +774,10 @@ public class ModelTree extends ModelWidg this.styleExdr = FlexibleStringExpander.getInstance(labelElement.getAttribute("style")); } + public void accept(TreeWidgetVisitor visitor) { + visitor.visit(this); + } + public void renderLabelString(Appendable writer, Map<String, Object> context, TreeStringRenderer treeStringRenderer) { try { treeStringRenderer.renderLabel(writer, context, this); @@ -849,6 +864,10 @@ public class ModelTree extends ModelWidg } } + public void accept(TreeWidgetVisitor visitor) { + visitor.visit(this); + } + public void renderLinkString(Appendable writer, Map<String, Object> context, TreeStringRenderer treeStringRenderer) { try { treeStringRenderer.renderLink(writer, context, this); @@ -1037,6 +1056,10 @@ public class ModelTree extends ModelWidg } + public void accept(TreeWidgetVisitor visitor) { + visitor.visit(this); + } + public void renderImageString(Appendable writer, Map<String, Object> context, TreeStringRenderer treeStringRenderer) { try { treeStringRenderer.renderImage(writer, context, this); Added: ofbiz/branches/20111115ScreenWidgetRedesign/framework/widget/src/org/ofbiz/widget/tree/TreeWidgetVisitor.java URL: http://svn.apache.org/viewvc/ofbiz/branches/20111115ScreenWidgetRedesign/framework/widget/src/org/ofbiz/widget/tree/TreeWidgetVisitor.java?rev=1211716&view=auto ============================================================================== --- ofbiz/branches/20111115ScreenWidgetRedesign/framework/widget/src/org/ofbiz/widget/tree/TreeWidgetVisitor.java (added) +++ ofbiz/branches/20111115ScreenWidgetRedesign/framework/widget/src/org/ofbiz/widget/tree/TreeWidgetVisitor.java Wed Dec 7 23:59:04 2011 @@ -0,0 +1,40 @@ +/******************************************************************************* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + *******************************************************************************/ +package org.ofbiz.widget.tree; + +import org.ofbiz.widget.tree.ModelTree.ModelNode; +import org.ofbiz.widget.tree.ModelTree.ModelNode.ModelSubNode; + +/** + * Tree widget visitor. + */ +public interface TreeWidgetVisitor { + + void visit(ModelNode modelNode); + + void visit(ModelNode.Image image); + + void visit(ModelSubNode modelSubNode); + + void visit(ModelTree modelTree); + + void visit(ModelTree.ModelNode.Label label); + + void visit(ModelTree.ModelNode.Link link); +} Propchange: ofbiz/branches/20111115ScreenWidgetRedesign/framework/widget/src/org/ofbiz/widget/tree/TreeWidgetVisitor.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/branches/20111115ScreenWidgetRedesign/framework/widget/src/org/ofbiz/widget/tree/TreeWidgetVisitor.java ------------------------------------------------------------------------------ svn:keywords = Author Date Id Rev URL |
Free forum by Nabble | Edit this page |