Skip to content

Commit

Permalink
Tree widget documentation, no functional change.
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1649275 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
adrian-crum committed Jan 4, 2015
1 parent 0c7142d commit 65e4015
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 3 deletions.
27 changes: 24 additions & 3 deletions framework/widget/src/org/ofbiz/widget/tree/ModelTree.java
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,20 @@
@SuppressWarnings("serial")
public class ModelTree extends ModelWidget {

/*
* ----------------------------------------------------------------------- *
* DEVELOPERS PLEASE READ
* ----------------------------------------------------------------------- *
*
* This model is intended to be a read-only data structure that represents
* an XML element. Outside of object construction, the class should not
* have any behaviors.
*
* Instances of this class will be shared by multiple threads - therefore
* it is immutable. DO NOT CHANGE THE OBJECT'S STATE AT RUN TIME!
*
*/

public static final String module = ModelTree.class.getName();

private final String defaultEntityName;
Expand All @@ -82,9 +96,6 @@ public class ModelTree extends ModelWidget {
private final String rootNodeName;
private final FlexibleStringExpander trailNameExdr;

// ===== CONSTRUCTORS =====
/** Default Constructor */

public ModelTree(Element treeElement, String location) {
super(treeElement);
this.location = location;
Expand Down Expand Up @@ -258,6 +269,11 @@ public void renderTreeString(Appendable writer, Map<String, Object> context, Tre
}
}

/**
* Models the &lt;node&gt; element.
*
* @see <code>widget-tree.xsd</code>
*/
public static class ModelNode extends ModelWidget {

private final List<ModelWidgetAction> actions;
Expand Down Expand Up @@ -920,6 +936,11 @@ public void renderLinkString(Appendable writer, Map<String, Object> context, Tre
}
}

/**
* Models the &lt;sub-node&gt; element.
*
* @see <code>widget-tree.xsd</code>
*/
public static class ModelSubNode extends ModelWidget {

private final List<ModelWidgetAction> actions;
Expand Down
35 changes: 35 additions & 0 deletions framework/widget/src/org/ofbiz/widget/tree/ModelTreeAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,27 @@
import org.ofbiz.widget.tree.ModelTree.ModelNode;
import org.w3c.dom.Document;
import org.w3c.dom.Element;

/**
* Abstract tree action.
*/
@SuppressWarnings("serial")
public abstract class ModelTreeAction extends ModelWidgetAction {

/*
* ----------------------------------------------------------------------- *
* DEVELOPERS PLEASE READ
* ----------------------------------------------------------------------- *
*
* This model is intended to be a read-only data structure that represents
* an XML element. Outside of object construction, the class should not
* have any behaviors.
*
* Instances of this class will be shared by multiple threads - therefore
* it is immutable. DO NOT CHANGE THE OBJECT'S STATE AT RUN TIME!
*
*/

public static final String module = ModelTreeAction.class.getName();

public static List<ModelWidgetAction> readNodeActions(ModelWidget modelNode, Element actionsElement) {
Expand Down Expand Up @@ -94,6 +109,11 @@ public ModelTree getModelTree() {
return modelTree;
}

/**
* Models the &lt;entity-and&gt; element.
*
* @see <code>widget-tree.xsd</code>
*/
public static class EntityAnd extends ModelTreeAction {
private final ByAndFinder finder;
private final String listName;
Expand Down Expand Up @@ -149,6 +169,11 @@ public void runAction(Map<String, Object> context) {
}
}

/**
* Models the &lt;entity-condition&gt; element.
*
* @see <code>widget-tree.xsd</code>
*/
public static class EntityCondition extends ModelTreeAction {
private final ByConditionFinder finder;
private final String listName;
Expand Down Expand Up @@ -204,6 +229,11 @@ public void runAction(Map<String, Object> context) {
}
}

/**
* Models the &lt;script&gt; element.
*
* @see <code>widget-tree.xsd</code>
*/
public static class Script extends ModelTreeAction {
private final String location;
private final String method;
Expand Down Expand Up @@ -267,6 +297,11 @@ public void runAction(Map<String, Object> context) {
}
}

/**
* Models the &lt;service&gt; element.
*
* @see <code>widget-tree.xsd</code>
*/
public static class Service extends ModelTreeAction {
private final FlexibleStringExpander autoFieldMapExdr;
private final Map<FlexibleMapAccessor<Object>, Object> fieldMap;
Expand Down

0 comments on commit 65e4015

Please sign in to comment.