labs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simo...@apache.org
Subject svn commit: r833033 [1/2] - in /labs/magma/trunk: foundation-beans-view/src/main/java/org/apache/magma/view/ foundation-beans-view/src/main/java/org/apache/magma/view/tree/ maps-google/src/main/java/org/apache/magma/maps/google/ website-administration/...
Date Thu, 05 Nov 2009 12:04:52 GMT
Author: simoneg
Date: Thu Nov  5 12:02:43 2009
New Revision: 833033

URL: http://svn.apache.org/viewvc?rev=833033&view=rev
Log:
LABS-207: Support for different styles in lists and beans view parts

Added:
    labs/magma/trunk/foundation-beans-view/src/main/java/org/apache/magma/view/tree/RootNode.java
    labs/magma/trunk/maps-google/src/main/java/org/apache/magma/maps/google/MappedListStyle.java
    labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/BeanStyle.java
    labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/BeanStylePlainDivs.java
    labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/BeanStyleTable.java
    labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/ListStyle.java
    labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/ListStyleTable.java
    labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/ListStyleTableWithSorting.java
    labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/ListStyleUl.java
Removed:
    labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/ListHtmlEmitter.java
    labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/TableListHtmlEmitter.java
    labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/UlListHtmlEmitter.java
Modified:
    labs/magma/trunk/foundation-beans-view/src/main/java/org/apache/magma/view/AddViewTreeToBeanData.aj
    labs/magma/trunk/foundation-beans-view/src/main/java/org/apache/magma/view/tree/Node.java
    labs/magma/trunk/foundation-beans-view/src/main/java/org/apache/magma/view/tree/ViewUtils.java
    labs/magma/trunk/maps-google/src/main/java/org/apache/magma/maps/google/MappedSmartListProducer.java
    labs/magma/trunk/website-administration/src/main/java/org/apache/magma/website/admin/AbstractCrudHandler.java
    labs/magma/trunk/website-administration/src/main/java/org/apache/magma/website/admin/CompleteCrudHandler.java
    labs/magma/trunk/website-administration/src/main/java/org/apache/magma/website/admin/ModifyOnlyCrudHandler.java
    labs/magma/trunk/website-administration/src/main/java/org/apache/magma/website/admin/ReadAndModifyCrudHandler.java
    labs/magma/trunk/website-administration/src/main/java/org/apache/magma/website/admin/ReadOnlyCrudHandler.java
    labs/magma/trunk/website-beansview/pom.xml
    labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/BeanFormProducer.java
    labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/Contextualizer.aj
    labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/ShowBean.java
    labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/ShowList.java
    labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/SmartForm.java
    labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/SmartList.java
    labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/SmartListProducer.java
    labs/magma/trunk/website-beansview/src/main/resources/org/apache/magma/website/beansview/magmaBeansview.css
    labs/magma/trunk/website-beansview/src/test/java/org/apache/magma/website/beansview/ShowListTest.java

Modified: labs/magma/trunk/foundation-beans-view/src/main/java/org/apache/magma/view/AddViewTreeToBeanData.aj
URL: http://svn.apache.org/viewvc/labs/magma/trunk/foundation-beans-view/src/main/java/org/apache/magma/view/AddViewTreeToBeanData.aj?rev=833033&r1=833032&r2=833033&view=diff
==============================================================================
--- labs/magma/trunk/foundation-beans-view/src/main/java/org/apache/magma/view/AddViewTreeToBeanData.aj (original)
+++ labs/magma/trunk/foundation-beans-view/src/main/java/org/apache/magma/view/AddViewTreeToBeanData.aj Thu Nov  5 12:02:43 2009
@@ -20,26 +20,26 @@
 import java.util.HashMap;
 import java.util.Map;
 
-import org.apache.magma.view.tree.Node;
+import org.apache.magma.view.tree.RootNode;
 import org.apache.magma.view.tree.ViewUtils;
 import org.apache.magma.beans.BeanData;
 
 public aspect AddViewTreeToBeanData {
 
-	private Map<String, Node> BeanData.viewTree = new HashMap<String, Node>();
+	private Map<String, RootNode> BeanData.viewTree = new HashMap<String, RootNode>();
 	
-	public Node BeanData.getViewTree() {
+	public RootNode BeanData.getViewTree() {
 		return getViewTree(new String[0]);
 	}
 
-	public Node BeanData.getViewTree(String layer) {
+	public RootNode BeanData.getViewTree(String layer) {
 		return getViewTree(new String[] { layer });
 	}
 	
-	public Node BeanData.getViewTree(String[] layers) {
+	public RootNode BeanData.getViewTree(String[] layers) {
 		if (layers == null || layers.length == 0) layers = new String[] { MagDefaultLayers.DEFAULT };
 		String key = Arrays.toString(layers);
-		Node ret = viewTree.get(key);
+		RootNode ret = viewTree.get(key);
 		if (ret == null) {
 			ret = ViewUtils.createTree(this, layers);
 			viewTree.put(key, ret);

Modified: labs/magma/trunk/foundation-beans-view/src/main/java/org/apache/magma/view/tree/Node.java
URL: http://svn.apache.org/viewvc/labs/magma/trunk/foundation-beans-view/src/main/java/org/apache/magma/view/tree/Node.java?rev=833033&r1=833032&r2=833033&view=diff
==============================================================================
--- labs/magma/trunk/foundation-beans-view/src/main/java/org/apache/magma/view/tree/Node.java (original)
+++ labs/magma/trunk/foundation-beans-view/src/main/java/org/apache/magma/view/tree/Node.java Thu Nov  5 12:02:43 2009
@@ -16,6 +16,7 @@
  */
 package org.apache.magma.view.tree;
 
+import org.apache.magma.view.OrdinalConstraint;
 import org.apache.magma.view.OrdinalSetting;
 import org.apache.magma.view.Side;
 import org.apache.magma.view.ViewSettings;
@@ -27,6 +28,31 @@
 import java.util.Map;
 import java.util.Set;
 
+/**
+ * Represents a node in the view tree.
+ * 
+ * Nodes contains zone, zone contains nodes organized in slices.
+ * 
+ * Nodes and zones are built using data from {@link OrdinalSetting}s and
+ * {@link ZoneSetting}s.
+ * 
+ * Based on zone settings, a node is placed in the right zone or another node.
+ * 
+ * Each node has 6 zone :
+ * <ul>
+ * <li>The main zone, which is central, and is occupied by the node content</li>
+ * <li>Four "inside" zones, left, right, top and bottom, that are around the main zone</li>
+ * <li>Two "outside" zones, left and right, that are on the left and on the right of the block composed of main and "inside" zones</li>
+ * </ul>
+ * 
+ * Then, based on ordinal settings, nodes in the zones are sorted.
+ * 
+ * Nodes in a zone are organized in slices, depending on whether they share
+ * their space with other nodes or not.
+ *
+ * @author Simone Gianni <simoneg@apache.org>
+ */
+
 public class Node {
 
 	protected OrdinalSetting ordinal;

Added: labs/magma/trunk/foundation-beans-view/src/main/java/org/apache/magma/view/tree/RootNode.java
URL: http://svn.apache.org/viewvc/labs/magma/trunk/foundation-beans-view/src/main/java/org/apache/magma/view/tree/RootNode.java?rev=833033&view=auto
==============================================================================
--- labs/magma/trunk/foundation-beans-view/src/main/java/org/apache/magma/view/tree/RootNode.java (added)
+++ labs/magma/trunk/foundation-beans-view/src/main/java/org/apache/magma/view/tree/RootNode.java Thu Nov  5 12:02:43 2009
@@ -0,0 +1,29 @@
+package org.apache.magma.view.tree;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.magma.view.ViewSettings;
+
+public class RootNode extends Node {
+
+	private Map<String, String> templates = new HashMap<String, String>();
+	
+	public RootNode(String id, ViewSettings settings) {
+		super(id, settings);
+	}
+
+	public RootNode(String id) {
+		super(id);
+	}
+	
+	public String getTemplate(String id) {
+		return this.templates.get(id);
+	}
+	
+	public void storeTemplate(String id, String template) {
+		this.templates.put(id, template);
+	}
+
+	
+}

Modified: labs/magma/trunk/foundation-beans-view/src/main/java/org/apache/magma/view/tree/ViewUtils.java
URL: http://svn.apache.org/viewvc/labs/magma/trunk/foundation-beans-view/src/main/java/org/apache/magma/view/tree/ViewUtils.java?rev=833033&r1=833032&r2=833033&view=diff
==============================================================================
--- labs/magma/trunk/foundation-beans-view/src/main/java/org/apache/magma/view/tree/ViewUtils.java (original)
+++ labs/magma/trunk/foundation-beans-view/src/main/java/org/apache/magma/view/tree/ViewUtils.java Thu Nov  5 12:02:43 2009
@@ -18,6 +18,7 @@
 
 import java.lang.reflect.Method;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
@@ -69,13 +70,13 @@
 	}
 
 	
-	public static Node createTree(BeanData data, String[] layers) {
+	public static RootNode createTree(BeanData data, String[] layers) {
 		return createTree(data, layers, null);
 	}
 	
 	
-	private static Node createTree(BeanData data, String[] layers, Node parent) {
-		Node root = new Node("root");
+	private static RootNode createTree(BeanData data, String[] layers, Node parent) {
+		RootNode root = new RootNode("root");
 		
 		List<FieldNode> nodelist = new ArrayList<FieldNode>();
 		Set<String> propertyNames = data.getPropertyNames();

Added: labs/magma/trunk/maps-google/src/main/java/org/apache/magma/maps/google/MappedListStyle.java
URL: http://svn.apache.org/viewvc/labs/magma/trunk/maps-google/src/main/java/org/apache/magma/maps/google/MappedListStyle.java?rev=833033&view=auto
==============================================================================
--- labs/magma/trunk/maps-google/src/main/java/org/apache/magma/maps/google/MappedListStyle.java (added)
+++ labs/magma/trunk/maps-google/src/main/java/org/apache/magma/maps/google/MappedListStyle.java Thu Nov  5 12:02:43 2009
@@ -0,0 +1,31 @@
+package org.apache.magma.maps.google;
+
+import org.apache.magma.basics.LocalizableString;
+import org.apache.magma.website.beansview.ListStyleTable;
+
+public class MappedListStyle extends ListStyleTable {
+
+	@Override
+	protected void closeHeaderRow() {
+		buff.append("<th class=\"MagmaList-HeaderCell MagmaGoogleMapsMarker\">");
+		buff.append(new LocalizableString("Marker").toString());
+		buff.append("</th>");		
+		buff.append("<th class=\"MagmaList-HeaderCell MagmaGoogleMapsDescription\">");
+		buff.append(new LocalizableString("Description").toString());
+		buff.append("</th>");
+		super.closeHeaderRow();
+	}
+	
+	@Override
+	protected void closeRow() {
+		buff.append("<td class=\"MagmaList-Cell MagmaGoogleMapsMarker\">");
+		buff.append("${list.markerFor($row)}");
+		buff.append("</td>");
+		
+		buff.append("<td class=\"MagmaList-Cell MagmaGoogleMapsDescription\">");
+		buff.append("${list.descriptionFor($row)}");
+		buff.append("</td>");
+		super.closeRow();
+	}
+	
+}

Modified: labs/magma/trunk/maps-google/src/main/java/org/apache/magma/maps/google/MappedSmartListProducer.java
URL: http://svn.apache.org/viewvc/labs/magma/trunk/maps-google/src/main/java/org/apache/magma/maps/google/MappedSmartListProducer.java?rev=833033&r1=833032&r2=833033&view=diff
==============================================================================
--- labs/magma/trunk/maps-google/src/main/java/org/apache/magma/maps/google/MappedSmartListProducer.java (original)
+++ labs/magma/trunk/maps-google/src/main/java/org/apache/magma/maps/google/MappedSmartListProducer.java Thu Nov  5 12:02:43 2009
@@ -32,6 +32,7 @@
 import org.apache.magma.view.tree.Node;
 import org.apache.magma.view.tree.ViewUtils;
 import org.apache.magma.website.Head;
+import org.apache.magma.website.beansview.ListStyleTable;
 import org.apache.magma.website.beansview.SmartListProducer;
 
 public class MappedSmartListProducer extends SmartListProducer {
@@ -88,7 +89,7 @@
 	public void produce(Writer stream) throws IOException {
 		// We cannot use non-table cause javascript depends on data inside the table
 		// we could solve this with HTML5 microtype informations
-		useTable();
+		this.listStyle = new ListStyleTable();
 		stream.write("<div class=\"MagmaGoogleMapsList\">");
 		super.produce(stream);
 		sendPrototype(stream);
@@ -120,21 +121,7 @@
 		stream.write("<div class=\"MagmaCssDetect\"></div>");
 	}
 
-	
-	
-	@Override
-	protected void closeHeaderRow(Node root, Writer tables) throws IOException {
-		tables.write("<th class=\"MagmaList-HeaderCell MagmaGoogleMapsMarker\">");
-		tables.write(new LocalizableString("Marker").toString());
-		tables.write("</th>");		
-		tables.write("<th class=\"MagmaList-HeaderCell MagmaGoogleMapsDescription\">");
-		tables.write(new LocalizableString("Description").toString());
-		tables.write("</th>");
-		super.closeHeaderRow(root, tables);
-	}
-	
-	@Override
-	protected void closeRow(MagmaBeanSupport o, Writer tables) throws IOException {
+	public String markerFor(MagmaBeanSupport o) {
 		GeoCoordinates coords = null;
 		if (o instanceof GeoAware) {
 			GeoLocated loc = ((GeoAware)o).getGeoLocatedObject();
@@ -145,19 +132,15 @@
 		if (o instanceof GeoLocated) {
 			coords = ((GeoLocated)o).getCoordinates();
 		}
-		tables.write("<td class=\"MagmaList-Cell MagmaGoogleMapsMarker\">");
 		if (coords != null && coords.getCoordinatesAccuracy() != GeoCoordinates.Accuracy.UNRESOVED) {
-			tables.write(addMarker(coords));
+			return addMarker(coords);
+		} else {
+			return "";
 		}
-		tables.write("</td>");
-		if (o instanceof MagmaBeanSupport) {
-			tables.write("<td class=\"MagmaList-Cell MagmaGoogleMapsDescription\">");
-			tables.write(((MagmaBeanSupport)o).toUser());
-			tables.write("</td>");
-		}
-		super.closeRow(o, tables);
 	}
 	
-	
+	public String descriptionFor(MagmaBeanSupport o) {
+		return ((MagmaBeanSupport)o).toUser();
+	}	
 
 }

Modified: labs/magma/trunk/website-administration/src/main/java/org/apache/magma/website/admin/AbstractCrudHandler.java
URL: http://svn.apache.org/viewvc/labs/magma/trunk/website-administration/src/main/java/org/apache/magma/website/admin/AbstractCrudHandler.java?rev=833033&r1=833032&r2=833033&view=diff
==============================================================================
--- labs/magma/trunk/website-administration/src/main/java/org/apache/magma/website/admin/AbstractCrudHandler.java (original)
+++ labs/magma/trunk/website-administration/src/main/java/org/apache/magma/website/admin/AbstractCrudHandler.java Thu Nov  5 12:02:43 2009
@@ -18,6 +18,7 @@
 
 import org.apache.magma.basics.LocalizableString;
 import org.apache.magma.basics.MagmaException;
+import org.apache.magma.beans.MagmaBeanSupport;
 import org.apache.magma.database.Database;
 import org.apache.magma.view.MagDefaultLayers;
 import org.apache.magma.website.CompoundType;
@@ -28,7 +29,7 @@
 import org.apache.magma.website.beansview.SmartList;
 import org.apache.magma.website.producers.StringHtmlProducer;
 
-public class AbstractCrudHandler<T> extends WebHandler {
+public class AbstractCrudHandler<T extends MagmaBeanSupport> extends WebHandler {
 
 	protected Class<T> myclass = null;
 	

Modified: labs/magma/trunk/website-administration/src/main/java/org/apache/magma/website/admin/CompleteCrudHandler.java
URL: http://svn.apache.org/viewvc/labs/magma/trunk/website-administration/src/main/java/org/apache/magma/website/admin/CompleteCrudHandler.java?rev=833033&r1=833032&r2=833033&view=diff
==============================================================================
--- labs/magma/trunk/website-administration/src/main/java/org/apache/magma/website/admin/CompleteCrudHandler.java (original)
+++ labs/magma/trunk/website-administration/src/main/java/org/apache/magma/website/admin/CompleteCrudHandler.java Thu Nov  5 12:02:43 2009
@@ -16,12 +16,13 @@
  */
 package org.apache.magma.website.admin;
 
+import org.apache.magma.beans.MagmaBeanSupport;
 import org.apache.magma.website.HtmlProducer;
 import org.apache.magma.website.Producer;
 import org.apache.magma.website.beansview.SmartForm;
 import org.apache.magma.website.beansview.SmartList;
 
-public class CompleteCrudHandler<T> extends AbstractCrudHandler<T> {
+public class CompleteCrudHandler<T extends MagmaBeanSupport> extends AbstractCrudHandler<T> {
 
 	public CompleteCrudHandler(Class<T> myBeanClass) {
 		super(myBeanClass);

Modified: labs/magma/trunk/website-administration/src/main/java/org/apache/magma/website/admin/ModifyOnlyCrudHandler.java
URL: http://svn.apache.org/viewvc/labs/magma/trunk/website-administration/src/main/java/org/apache/magma/website/admin/ModifyOnlyCrudHandler.java?rev=833033&r1=833032&r2=833033&view=diff
==============================================================================
--- labs/magma/trunk/website-administration/src/main/java/org/apache/magma/website/admin/ModifyOnlyCrudHandler.java (original)
+++ labs/magma/trunk/website-administration/src/main/java/org/apache/magma/website/admin/ModifyOnlyCrudHandler.java Thu Nov  5 12:02:43 2009
@@ -16,9 +16,10 @@
  */
 package org.apache.magma.website.admin;
 
+import org.apache.magma.beans.MagmaBeanSupport;
 import org.apache.magma.website.beansview.SmartForm;
 
-public class ModifyOnlyCrudHandler<T> extends AbstractCrudHandler<T> {
+public class ModifyOnlyCrudHandler<T extends MagmaBeanSupport> extends AbstractCrudHandler<T> {
 
 	public ModifyOnlyCrudHandler(Class<T> myBeanClass) {
 		super(myBeanClass);

Modified: labs/magma/trunk/website-administration/src/main/java/org/apache/magma/website/admin/ReadAndModifyCrudHandler.java
URL: http://svn.apache.org/viewvc/labs/magma/trunk/website-administration/src/main/java/org/apache/magma/website/admin/ReadAndModifyCrudHandler.java?rev=833033&r1=833032&r2=833033&view=diff
==============================================================================
--- labs/magma/trunk/website-administration/src/main/java/org/apache/magma/website/admin/ReadAndModifyCrudHandler.java (original)
+++ labs/magma/trunk/website-administration/src/main/java/org/apache/magma/website/admin/ReadAndModifyCrudHandler.java Thu Nov  5 12:02:43 2009
@@ -16,9 +16,10 @@
  */
 package org.apache.magma.website.admin;
 
+import org.apache.magma.beans.MagmaBeanSupport;
 import org.apache.magma.website.beansview.SmartForm;
 
-public class ReadAndModifyCrudHandler<T> extends ReadOnlyCrudHandler<T> {
+public class ReadAndModifyCrudHandler<T extends MagmaBeanSupport> extends ReadOnlyCrudHandler<T> {
 
 	public ReadAndModifyCrudHandler(Class<T> myBeanClass) {
 		super(myBeanClass);

Modified: labs/magma/trunk/website-administration/src/main/java/org/apache/magma/website/admin/ReadOnlyCrudHandler.java
URL: http://svn.apache.org/viewvc/labs/magma/trunk/website-administration/src/main/java/org/apache/magma/website/admin/ReadOnlyCrudHandler.java?rev=833033&r1=833032&r2=833033&view=diff
==============================================================================
--- labs/magma/trunk/website-administration/src/main/java/org/apache/magma/website/admin/ReadOnlyCrudHandler.java (original)
+++ labs/magma/trunk/website-administration/src/main/java/org/apache/magma/website/admin/ReadOnlyCrudHandler.java Thu Nov  5 12:02:43 2009
@@ -16,10 +16,11 @@
  */
 package org.apache.magma.website.admin;
 
+import org.apache.magma.beans.MagmaBeanSupport;
 import org.apache.magma.website.HtmlProducer;
 import org.apache.magma.website.beansview.SmartList;
 
-public class ReadOnlyCrudHandler<T> extends AbstractCrudHandler<T> {
+public class ReadOnlyCrudHandler<T extends MagmaBeanSupport> extends AbstractCrudHandler<T> {
 
 	public ReadOnlyCrudHandler(Class<T> myBeanClass) {
 		super(myBeanClass);

Modified: labs/magma/trunk/website-beansview/pom.xml
URL: http://svn.apache.org/viewvc/labs/magma/trunk/website-beansview/pom.xml?rev=833033&r1=833032&r2=833033&view=diff
==============================================================================
--- labs/magma/trunk/website-beansview/pom.xml (original)
+++ labs/magma/trunk/website-beansview/pom.xml Thu Nov  5 12:02:43 2009
@@ -42,6 +42,11 @@
 			<version>0.0.3-SNAPSHOT</version>
 		</dependency>
 		<dependency>
+			<groupId>org.apache.magma</groupId>
+			<artifactId>website-velocity</artifactId>
+			<version>0.0.3-SNAPSHOT</version>
+		</dependency>
+		<dependency>
 			<groupId>junit</groupId>
 			<artifactId>junit</artifactId>
 			<version>4.4</version>

Modified: labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/BeanFormProducer.java
URL: http://svn.apache.org/viewvc/labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/BeanFormProducer.java?rev=833033&r1=833032&r2=833033&view=diff
==============================================================================
--- labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/BeanFormProducer.java (original)
+++ labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/BeanFormProducer.java Thu Nov  5 12:02:43 2009
@@ -28,6 +28,7 @@
 import org.apache.magma.view.tree.FieldNode;
 import org.apache.magma.view.tree.LabelNode;
 import org.apache.magma.view.tree.Node;
+import org.apache.magma.view.tree.PropertyNode;
 import org.apache.magma.view.tree.ViewUtils;
 
 import java.io.IOException;
@@ -68,6 +69,10 @@
 	@Override
 	public void produce(Writer out) throws IOException {
 		try {
+			if (beanStyle == null) {
+				beanStyle = new BeanStyleTable();
+			}
+			beanStyle.setWithCustomClasses(true);
 			out.write("<form action=\"filled\" method=\"post\" accept-charset=\"utf-8\"><div>");
 			out.write("<input type=\"submit\" class=\"DefaultHiddenSubmit\" value=\"-\"/>");
 			out.flush();
@@ -111,34 +116,26 @@
 	}
 	
 	@Override
-	protected void createLabelNodeOutput(LabelNode node, Writer out) throws IOException {
-		Node relatedTo = node.getRelatedTo();
+	protected String labelFor(Node gennode) {
+		Node relatedTo = gennode.getRelatedTo();
 		if (relatedTo != null) {
 			if (relatedTo instanceof ContainerProperty) {
-				super.createLabelNodeOutput(node, out);
-				return;
+				return super.labelFor(gennode);
 			}
 		}
+
+		if (!(gennode instanceof LabelNode)) return "NA";
+		LabelNode node = (LabelNode) gennode;
+		StringBuilder out = new StringBuilder();
 		
-		StringBuilder sb = new StringBuilder();
-		sb.append("MagmaLabel");
-		PropertyInfo property = node.getProperty();
-		List<LocalizableString> errs = findErrors(property);
-		if (errs.size() > 0) {
-			sb.append(" WithErrors");
-		}
-		CompoundValidator allvals = property.getValidator();
-		if (allvals != null && !allvals.acceptsNulls()) {
-			sb.append(" NotNullable");
-		}
-		
-		
-		createAdditionalInfo(node, sb.toString(), out, "label");	
 		out.append("<label for=\"" + node.getCorrespondingFieldId() + "\">");
-		super.createLabelNodeOutput(node, out);
+		out.append(super.labelFor(gennode));
+		PropertyInfo property = node.getProperty();
+		CompoundValidator allvals = property.getValidator();		
 		if (allvals != null && !allvals.acceptsNulls()) {
 			out.append("<span class=\"NotNullableSign\">*</span>");
 		}
+		List<LocalizableString> errs = findErrors(property);		
 		if (errs.size() > 0) {
 			createInlineErrorsOutput(node, out, errs);
 		}
@@ -147,9 +144,10 @@
 			createBlockErrorsOutput(node, out, errs);
 		}
 		sentErrors.addAll(errs);
+		return out.toString();
 	}
 
-	private void createInlineErrorsOutput(LabelNode node, Writer out, List<LocalizableString> errs) throws IOException {
+	private void createInlineErrorsOutput(LabelNode node, StringBuilder out, List<LocalizableString> errs) {
 		StringBuilder sb = new StringBuilder();
 		for (LocalizableString err : errs) {
 			sb.append(err.toString());
@@ -160,7 +158,7 @@
 		out.append("\">!</a>");
 	}
 
-	private void createBlockErrorsOutput(LabelNode node, Writer out, List<LocalizableString> errs) throws IOException {
+	private void createBlockErrorsOutput(LabelNode node, StringBuilder out, List<LocalizableString> errs) {
 		StringBuilder sb = new StringBuilder();
 		for (LocalizableString err : errs) {
 			sb.append(err.toString());
@@ -171,7 +169,6 @@
 		out.append("</div>");		
 	}
 
-	
 	protected List<LocalizableString> findErrors(PropertyInfo property) {
 		List<LocalizableString> errs = new ArrayList<LocalizableString>();
 		for (LocalizableStringWithSubject acerr : this.errors) {
@@ -180,36 +177,30 @@
 		return errs;
 	}
 
+	
+	
 	@Override
-	protected void createFieldNodeOutput(FieldNode node, Writer out) throws IOException {
+	protected String valueFor(Node gennode) {
+		if (!(gennode instanceof FieldNode)) return "NA";
+		FieldNode node = (FieldNode) gennode;
+
 		PropertyInfo property = node.getProperty();
 		if (!property.isWriteable()) {
-			super.createFieldNodeOutput(node, out);
+			return super.valueFor(gennode);
 		} else {
 			if (property.getType().isEnum() || MagmaBeanSupport.class.isAssignableFrom(property.getType())) {
-				createSelectionListField(node, out);
+				return createSelectionListField(node);
 			} else if (property.getType().equals(Boolean.class) || property.getType().equals(Boolean.TYPE)) {
-				createBooleanField(node, out);
+				return createBooleanField(node);
 			} else {
-				createTextField(node, out);
+				return createTextField(node);
 			}
 		}
-	}
-
-	private void commonFieldClasses(FieldNode node, StringBuilder sb) {
-		PropertyInfo property = node.getProperty();
-		List<LocalizableString> errs = findErrors(property);
-		if (errs.size() > 0) {
-			sb.append(" WithErrors");
-		}
-		CompoundValidator allvals = property.getValidator();
-		if (allvals != null && !allvals.acceptsNulls()) {
-			sb.append(" NotNullable");
-		}
 		
 	}
+	
 
-	protected void createSelectionListField(FieldNode node, Writer out) throws IOException {
+	protected String createSelectionListField(FieldNode node) {
 		PropertyInfo property = node.getProperty();
 		List<?> elements = this.lists .get(node.getId());
 		if (elements == null) {
@@ -223,7 +214,7 @@
 			}
 		}
 		if (elements != null && elements.size() > 0) {
-			createDropDownField(node, elements, out);				
+			return createDropDownField(node, elements);				
 			/*
 			if (elements.size() < 3) {
 				createRadioField(node, elements, out);
@@ -235,26 +226,34 @@
 			}
 			*/
 		} else {
-			StringBuilder sb = new StringBuilder();
-			sb.append("MagmaField Select");
-			commonFieldClasses(node, sb);
-			createAdditionalInfo(node, sb.toString(), out);
-			
-			out.append("<input type=\"hidden\" ");
-			createNameAndId(node, out);
-			out.append("/>");			
+			return "<input type=\"hidden\" "+ createNameAndId(node) + "/>";			
 		}
 	}
+
+	protected String createNameAndId(Node node, String addToId) {
+		StringBuilder out = new StringBuilder();
+		out.append(" name=\"");
+		out.append(code);
+		out.append(".");
+		out.append(node.getId());
+		out.append("\" id=\"");
+		out.append(getId(node, addToId));
+		out.append('\"');		
+		return out.toString();
+	}
 	
+	protected String createNameAndId(Node node) {
+		return createNameAndId(node, null);
+	}
 	
-	protected void createRadioField(FieldNode node, List<?> elements, Writer out) throws IOException {
-		StringBuilder sb = new StringBuilder();
-		sb.append("MagmaField RadioButton");
-		commonFieldClasses(node, sb);
-		createAdditionalInfo(node, sb.toString(), out);
-		
+	protected String getId(Node node, String addToId) {
+		return node.getId() + (addToId != null ? "-" + addToId : "");
+	}	
+	
+	protected String createRadioField(FieldNode node, List<?> elements) {
 		PropertyInfo property = node.getProperty();		
 		int i = 0;
+		StringBuilder out = new StringBuilder();
 		CompoundValidator<Object> val = property.getValidator();
 		if ((val == null || (val != null && val.acceptsNulls())) && !elements.contains(null)) {
 			createRadioButton(node, out, i++, null);
@@ -262,14 +261,13 @@
 		for (Object object : elements) {
 			createRadioButton(node, out, i++, object);
 		}
+		return out.toString();
 	}
 
-
-
-	protected void createRadioButton(FieldNode node, Writer out, int i, Object object) throws IOException {
+	protected void createRadioButton(FieldNode node, StringBuilder out, int i, Object object) {
 		String val = node.getProperty().toString(object);
 		out.append("<input type=\"radio\"");
-		createNameAndId(node, out, Integer.toString(i));
+		out.append(createNameAndId(node, Integer.toString(i)));
 		out.append(" value=\"");
 		out.append(val);
 		out.append("\"");
@@ -292,14 +290,10 @@
 		out.append("</label>");
 	}
 
-	protected void createDropDownField(FieldNode node, List<?> elements, Writer out) throws IOException {
-		StringBuilder sb = new StringBuilder();
-		sb.append("MagmaField Select");
-		commonFieldClasses(node, sb);
-		createAdditionalInfo(node, sb.toString(), out);
-		
+	protected String createDropDownField(FieldNode node, List<?> elements){
+		StringBuilder out = new StringBuilder();
 		out.append("<select");
-		createNameAndId(node, out);
+		out.append(createNameAndId(node));
 		out.append('>');
 		PropertyInfo property = node.getProperty();
 		CompoundValidator<Object> val = property.getValidator();
@@ -309,10 +303,11 @@
 		for (Object object : elements) {
 			createDropDownOption(node, out, object);			
 		}
-		out.append("</select>");		
+		out.append("</select>");
+		return out.toString();
 	}
 
-	protected void createDropDownOption(FieldNode node, Writer out, Object object) throws IOException {
+	protected void createDropDownOption(FieldNode node, StringBuilder out, Object object) {
 		String val = node.getProperty().toString(object);
 		out.append("<option value=\"");
 		out.append(val);
@@ -334,51 +329,43 @@
 	}
 	
 	
-	protected void createBooleanField(FieldNode node, Writer out) throws IOException {
-		StringBuilder sb = new StringBuilder();
-		sb.append("MagmaField CheckBox");
-		commonFieldClasses(node, sb);
-		createAdditionalInfo(node, sb.toString(), out);	
+	protected String createBooleanField(FieldNode node) {
+		StringBuilder out = new StringBuilder();
 		out.append("<input type=\"checkbox\"");
-		createNameAndId(node, out);
+		out.append(createNameAndId(node));
 		out.append(" value=\"true\"");
 		Boolean bool = (Boolean) ViewUtils.getNodeValue(node, bean);
 		if (bool != null && bool.booleanValue()) {
 			out.append(" checked=\"checked\"");
 		}
 		out.append("/>");
+		return out.toString();
 	}
 
 
-	protected void createTextField(FieldNode node, Writer out) throws IOException {
+	protected String createTextField(FieldNode node) {
 		PropertyInfo property = node.getProperty();
 		int maxSize = findInputMaxSize(property);
 		if (property.getViewSettings().isPassword()) {
-			createPasswordField(node, out);
+			return createPasswordField(node);
 		} else {
 			if (maxSize < 256) {
-				createSimpleTextField(node, out);
+				return createSimpleTextField(node);
 			} else {
-				createTextAreaField(node, out);			
+				return createTextAreaField(node);			
 			}
 		}
 	}
 
-	protected void createPasswordField(FieldNode node, Writer out) throws IOException {
-		StringBuilder sb = new StringBuilder();
-		sb.append("MagmaField TextField");
-		commonFieldClasses(node, sb);
+	protected String createPasswordField(FieldNode node) {
 		PropertyInfo property = node.getProperty();
 		int maxSize = findInputMaxSize(property);
 		int size = maxSize;
 		if (size > MAX_FIELD_SIZE) size = 0;
-		if (size <= 0) {
-			sb.append(" NoSize");
-		}		
-		createAdditionalInfo(node, sb.toString(), out);	
-		
+
+		StringBuilder out = new StringBuilder();
 		out.append("<input type=\"password\"");
-		createNameAndId(node, out);
+		out.append(createNameAndId(node));
 		if (size > 0) {
 			out.append(" size=\"");
 			out.append(Integer.toString(size));
@@ -390,28 +377,25 @@
 			out.append('\"');
 		}
 		out.append("/>");		
+		return out.toString();
 	}
 
 
 
-	protected void createTextAreaField(FieldNode node, Writer out) throws IOException {
-		StringBuilder sb = new StringBuilder();
-		sb.append("MagmaField TextArea");
-		commonFieldClasses(node, sb);
-		createAdditionalInfo(node, sb.toString(), out);
-		
+	protected String createTextAreaField(FieldNode node) {
 		PropertyInfo property = node.getProperty();
 		int maxSize = findInputMaxSize(property);
 		int size = Math.min(MAX_FIELD_SIZE, maxSize);
 		if (size == 0) size = 80;
 		int rows = maxSize / size;
 		if (rows > 15) rows = 15;
+		StringBuilder out = new StringBuilder();
 		out.append("<textarea rows=\"");
 		out.append(Integer.toString(rows));
 		//out.append("\" cols=\"");
 		//out.append(Integer.toString(size));
 		out.append('\"');
-		createNameAndId(node, out);		
+		out.append(createNameAndId(node));		
 		out.append('>');
 		MagmaBeanSupport subbean = ViewUtils.findProperBean(node, bean, false);
 		if (subbean != null) {
@@ -419,23 +403,18 @@
 			out.append(val == null ? "" : val);
 		}
 		out.append("</textarea>");		
+		return out.toString();
 	}
 
-	protected void createSimpleTextField(FieldNode node, Writer out) throws IOException {
-		StringBuilder sb = new StringBuilder();
-		sb.append("MagmaField TextField");
-		commonFieldClasses(node, sb);
+	protected String createSimpleTextField(FieldNode node) {
 		PropertyInfo property = node.getProperty();
 		int maxSize = findInputMaxSize(property);
 		int size = maxSize;
 		if (size > MAX_FIELD_SIZE) size = 0;
-		if (size <= 0) {
-			sb.append(" NoSize");
-		}		
-		createAdditionalInfo(node, sb.toString(), out);	
-		
+
+		StringBuilder out = new StringBuilder();
 		out.append("<input type=\"text\"");
-		createNameAndId(node, out);
+		out.append(createNameAndId(node));
 		if (size > 0) {
 			out.append(" size=\"");
 			out.append(Integer.toString(size));
@@ -453,33 +432,87 @@
 			out.append(val == null ? "" : val);
 		}
 		out.append("\"/>");		
+		return out.toString();
 	}
 
 	public int findInputMaxSize(PropertyInfo property) {
 		return property.getMaximumStringSize();
 	}
 
+	@Override
+	protected String classesFor(Node gennode) {
+		String ret = super.classesFor(gennode);
+		
+		if (gennode instanceof PropertyNode) {
+			PropertyInfo property = ((PropertyNode)gennode).getProperty();
+			List<LocalizableString> errs = findErrors(property);
+			if (errs.size() > 0) {
+				ret +=" WithErrors";
+			}
+		}
+		return ret;
+	}
+	
 	public void setLists(Map<String, List<?>> lists) {
 		this.lists = lists;
 	}
 
-	protected void createNameAndId(Node node, Writer out) throws IOException {
-		createNameAndId(node, out, null);
-	}
-	
 	
-	protected void createNameAndId(Node node, Writer out, String addToId) throws IOException {
-		out.append(" name=\"");
-		out.append(code);
-		out.append(".");
-		out.append(node.getId());
-		out.append("\" id=\"");
-		out.append(getId(node, addToId));
-		out.append('\"');		
+	/*
+	@Override
+	protected void createLabelNodeOutput(LabelNode node, Writer out) throws IOException {
+		Node relatedTo = node.getRelatedTo();
+		if (relatedTo != null) {
+			if (relatedTo instanceof ContainerProperty) {
+				super.createLabelNodeOutput(node, out);
+				return;
+			}
+		}
+		
+		StringBuilder sb = new StringBuilder();
+		sb.append("MagmaLabel");
+		PropertyInfo property = node.getProperty();
+		List<LocalizableString> errs = findErrors(property);
+		if (errs.size() > 0) {
+			sb.append(" WithErrors");
+		}
+		CompoundValidator allvals = property.getValidator();
+		if (allvals != null && !allvals.acceptsNulls()) {
+			sb.append(" NotNullable");
+		}
+		
+		
+		createAdditionalInfo(node, sb.toString(), out, "label");	
 	}
-	
-	protected String getId(Node node, String addToId) {
-		return node.getId() + (addToId != null ? "-" + addToId : "");
+
+	@Override
+	protected void createFieldNodeOutput(FieldNode node, Writer out) throws IOException {
+		PropertyInfo property = node.getProperty();
+		if (!property.isWriteable()) {
+			super.createFieldNodeOutput(node, out);
+		} else {
+			if (property.getType().isEnum() || MagmaBeanSupport.class.isAssignableFrom(property.getType())) {
+				createSelectionListField(node, out);
+			} else if (property.getType().equals(Boolean.class) || property.getType().equals(Boolean.TYPE)) {
+				createBooleanField(node, out);
+			} else {
+				createTextField(node, out);
+			}
+		}
 	}
+	private void commonFieldClasses(FieldNode node, StringBuilder sb) {
+		PropertyInfo property = node.getProperty();
+		List<LocalizableString> errs = findErrors(property);
+		if (errs.size() > 0) {
+			sb.append(" WithErrors");
+		}
+		CompoundValidator allvals = property.getValidator();
+		if (allvals != null && !allvals.acceptsNulls()) {
+			sb.append(" NotNullable");
+		}
+		
+	}
+	*/
+
 	
 }

Added: labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/BeanStyle.java
URL: http://svn.apache.org/viewvc/labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/BeanStyle.java?rev=833033&view=auto
==============================================================================
--- labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/BeanStyle.java (added)
+++ labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/BeanStyle.java Thu Nov  5 12:02:43 2009
@@ -0,0 +1,281 @@
+/*
+ * 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.apache.magma.website.beansview;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.StringWriter;
+import java.io.UnsupportedEncodingException;
+import java.io.Writer;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.regex.Matcher;
+
+import org.apache.commons.lang.StringEscapeUtils;
+import org.apache.magma.basics.LocalizableString;
+import org.apache.magma.basics.MagmaException;
+import org.apache.magma.beans.MagmaBeanSupport;
+import org.apache.magma.beans.PropertyInfo;
+import org.apache.magma.validation.CompoundValidator;
+import org.apache.magma.view.MagView;
+import org.apache.magma.view.Side;
+import org.apache.magma.view.tree.ContainerProperty;
+import org.apache.magma.view.tree.FieldNode;
+import org.apache.magma.view.tree.LabelNode;
+import org.apache.magma.view.tree.Node;
+import org.apache.magma.view.tree.RootNode;
+import org.apache.magma.view.tree.ViewUtils;
+import org.apache.magma.view.tree.Zone;
+import org.apache.magma.website.Head;
+import org.apache.magma.website.HtmlProducer;
+
+/**
+ * Outputs a bean using informations taken from the view tree.
+ * 
+ * The view tree is represented by {@link Node}s, and is constructed
+ * parsing {@link MagView} annotations.
+ *
+ * @author Simone Gianni <simoneg@apache.org>
+ */
+public abstract class BeanStyle {
+
+	protected Class<?> myclass;
+	protected RootNode root;
+	protected StringBuilder buff;
+	protected boolean withCustomClasses;
+	protected int maxFieldSize = 80;
+	
+	public void setMyclass(Class<?> myclass) {
+		this.myclass = myclass;
+	}
+
+	public void setRoot(RootNode root) {
+		this.root = root;
+	}
+
+	public void setWithCustomClasses(boolean withCustomClasses) {
+		this.withCustomClasses = withCustomClasses;
+	}
+	
+	public void setMaxFieldSize(int maxFieldSize) {
+		this.maxFieldSize = maxFieldSize;
+	}
+	
+	public void generate() {
+		buff = new StringBuilder();
+		createTable(root);
+	}
+	
+	public String getTemplate() {
+		String fullform = buff.toString();
+		//fullform = fullform.replaceFirst("<table", "<table id=\"" + myclass.getSimpleName() + "-table\"");
+		fullform = fullform.replaceAll(">\\|MAGMA-([^\\|]*)\\|"," $1>");
+		fullform = fullform.replaceAll("<td([^>]*)></td>", "<td$1>&nbsp;</td>");
+		return fullform;
+	}
+
+	/**
+	 * Creates a "table" for a node. Depending on the node properties, it delegates
+	 * to createContainerNodeTable, createMain, or create(Out|In)sideZonedNodeTable.
+	 * @param node
+	 */
+	protected void createTable(Node node) {
+		// Skip container only nodes
+		if (node.hasSingleZone()) { 
+			createContainerNodeTable(node);
+			return;
+		}
+		createOutsideZonedNodeTable(node);
+	}
+
+	/**
+	 * Creates the outside zones structure for this node.
+	 * 
+	 * In a table style, it will be a table, with a single row
+	 * and three cells. The first and the last cells will contain
+	 * outsideLeft and outsideRight stuff, respectively, while 
+	 * the central one will contain the main node content.
+	 * 
+	 * This method should call {@link #createInsideZonedNodeTable(Node)}
+	 * if the node does not have outside zones.
+	 * 
+	 * This method should call createZoneTable for
+	 * outside zones, and to createInsideZonedNodeTable
+	 * for the main area. 
+	 * @param node
+	 */
+	protected abstract void createOutsideZonedNodeTable(Node node);
+	
+	
+	/**
+	 * Creates the outside zones structure for this node.
+	 * 
+	 * In a table style, it will be a table, with a single row
+	 * and three cells. The first and the last cells will contain
+	 * left and right stuff, respectively, while 
+	 * the central one will contain the top content, followed vertically
+	 * by the main content and the bottom one.
+	 * 
+	 * This method should call {@link #createMain(Node)}
+	 * if the node does not have inside zones.
+	 * 
+	 * This method should call createZoneTable for
+	 * outside zones, and to createInsideZonedNodeTable
+	 * for the main area. 
+	 * @param node
+	 */	
+	protected abstract void createInsideZonedNodeTable(Node node);
+
+	protected void createContainerNodeTable(Node node) {
+		if (node instanceof ContainerProperty) {
+			createAdditionalInfo(node, "ForBean", false);					
+		}
+		Zone zone = node.getUniqueZone();
+		boolean vertical = zone.getSide().equals(Side.OutsideLeft) ||
+				zone.getSide().equals(Side.OutsideRight) ||
+				zone.getSide().equals(Side.InsideLeft) ||
+				zone.getSide().equals(Side.InsideRight);
+		createZoneTable(zone, vertical);
+	}
+
+	/**
+	 * Creates a table for a single zone.
+	 * 
+	 * Depending on the zone type, it
+	 * can be a vertical or horizontal zone.
+	 * 
+	 * If the zone is a vertical one, then nodes
+	 * inside it are placed vertically one under the other,
+	 * otherwise they are placed horizontally one after the other.
+	 * 
+	 * This method should call {@link #createTable(Node)} for each
+	 * node.
+	 * 
+	 * @param zone
+	 * @param vertical
+	 */
+	protected abstract void createZoneTable(Zone zone, boolean vertical);
+	
+	protected void createMain(Node node) {
+		if (node instanceof LabelNode) {
+			createLabelNodeOutput((LabelNode) node);
+		} else if (node instanceof FieldNode) {
+			createFieldNodeOutput((FieldNode) node);
+		} else if (node instanceof ContainerProperty) {
+			createContainerPropertyNodeOutput((ContainerProperty) node);
+		} else {
+			createGenericNodeOutput(node);
+		}		
+	}
+
+	private void createContainerPropertyNodeOutput(ContainerProperty node) {
+	}
+	
+	protected void createFieldNodeOutput(FieldNode node) {
+		String baseclass = "MagmaField";
+		if (withCustomClasses) {
+			PropertyInfo property = node.getProperty();
+			CompoundValidator allvals = property.getValidator();
+			if (allvals != null && !allvals.acceptsNulls()) {
+				baseclass += " NotNullable";
+			}
+			if (!property.isWriteable()) {
+				baseclass += " ReadOnly";
+			} else {
+				if (property.getType().isEnum() || MagmaBeanSupport.class.isAssignableFrom(property.getType())) {
+					baseclass += " Select";
+				} else if (property.getType().equals(Boolean.class) || property.getType().equals(Boolean.TYPE)) {
+					baseclass += " CheckBox";
+				} else {
+					int maxSize = property.getMaximumStringSize();
+					if (property.getViewSettings().isPassword()) {
+						baseclass += " TextField Password";
+						if (maxSize > maxFieldSize) baseclass += " NoSize";
+					} else {
+						if (maxSize < 256) {
+							baseclass += " TextField";
+							if (maxSize > maxFieldSize) baseclass += " NoSize";
+						} else {
+							baseclass += " TextArea";
+						}
+					}
+				}
+			}
+			
+		}
+		createAdditionalInfo(node, baseclass, true);
+		
+		buff.append("${prod.valueFor('");
+		buff.append(node.getId());
+		buff.append("')}");		
+	}
+	
+
+	protected void createLabelNodeOutput(LabelNode node) {
+		String baseclass = "MagmaLabel";
+		Node relatedTo = node.getRelatedTo();
+		if (relatedTo != null) {
+			if (relatedTo instanceof ContainerProperty) {
+				baseclass += " ForBean";
+			}
+		}
+		if (withCustomClasses) {
+			CompoundValidator allvals = node.getProperty().getValidator();
+			if (allvals != null && !allvals.acceptsNulls()) {
+				baseclass += " NotNullable";
+			}
+		}
+		
+		createAdditionalInfo(node, baseclass, true);
+
+		buff.append("${prod.labelFor('");
+		buff.append(node.getId());
+		buff.append("')}");		
+	}
+
+	protected void createGenericNodeOutput(Node node) {
+		//out.append("Node " + node.getId());
+	}
+
+	protected void createAdditionalInfo(Node node, String baseclass, String idsuffix, boolean additional) {
+		buff.append("|MAGMA-");
+		buff.append("class=\"");
+		buff.append(baseclass);
+		if (additional && withCustomClasses) {
+			buff.append(" ${prod.classesFor('");
+			buff.append(node.getId());
+			buff.append("')}");					
+		}
+		buff.append("\" id=\"");
+		buff.append(node.getId());
+		buff.append("-");
+		buff.append(idsuffix);
+		buff.append("\"");
+		buff.append("|");		
+	}
+	
+	protected void createAdditionalInfo(Node node, String baseclass, boolean additional) {
+		createAdditionalInfo(node, baseclass, "cell", additional);
+	}
+	
+	public String getStyleKey() {
+		return "CC" + this.withCustomClasses + "MF" + this.maxFieldSize;
+	}
+
+}

Added: labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/BeanStylePlainDivs.java
URL: http://svn.apache.org/viewvc/labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/BeanStylePlainDivs.java?rev=833033&view=auto
==============================================================================
--- labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/BeanStylePlainDivs.java (added)
+++ labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/BeanStylePlainDivs.java Thu Nov  5 12:02:43 2009
@@ -0,0 +1,91 @@
+package org.apache.magma.website.beansview;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.magma.view.Side;
+import org.apache.magma.view.tree.Node;
+import org.apache.magma.view.tree.Zone;
+
+public class BeanStylePlainDivs extends BeanStyle {
+	@Override
+	protected void createOutsideZonedNodeTable(Node node) {
+		if (!node.hasOutsideZones()) {
+			createInsideZonedNodeTable(node);
+			return;
+		}
+
+		buff.append("<div class=\"OutsideZones\">");
+		Zone zone = node.getZone(Side.OutsideLeft);
+		if (zone != null && zone.getSlices() > 0) {
+			createZoneTable(zone, true);
+		}
+		createInsideZonedNodeTable(node);
+		zone = node.getZone(Side.OutsideRight);
+		if (zone != null && zone.getSlices() > 0) {
+			createZoneTable(zone, true);
+		}		
+		buff.append("</div>");
+	}
+	
+	@Override
+	protected void createInsideZonedNodeTable(Node node) {
+		if (!node.hasInsideZones()) {
+			createMain(node);
+			return;
+		}
+		
+		Zone zone = node.getZone(Side.InsideLeft);
+		if (zone != null && zone.getSlices() > 0) {
+			createZoneTable(zone, true);
+		}
+		boolean maindone = false;
+		zone = node.getZone(Side.Top);
+		if (zone != null && zone.getSlices() > 0) {
+			createZoneTable(zone, false);
+		}
+		createMain(node);
+		zone = node.getZone(Side.Bottom);
+		if (zone != null && zone.getSlices() > 0) {
+			createZoneTable(zone, false);
+		}
+		zone = node.getZone(Side.InsideRight);
+		if (zone != null && zone.getSlices() > 0) {
+			createZoneTable(zone, true);
+		}
+	}
+
+	@Override
+	protected void createZoneTable(Zone zone, boolean vertical) {
+		if (zone.getSlices() > 1) {
+			buff.append("<div class=\"ZoneSlices " + (vertical ? "Vertical" : "Horizontal") + "\">");
+		}
+		for (int slice = 0; slice < zone.getSlices(); slice++) {
+			List<Node> sliceNodes = zone.getSliceNodes(slice);
+			if (sliceNodes.size() > 0) {
+				if (sliceNodes.size() > 1) {
+					buff.append("<div class=\"LayoutTable Slice\">");
+				}
+				for (Iterator iterator = sliceNodes.iterator(); iterator.hasNext();) {
+					Node acnode = (Node) iterator.next();
+					createTable(acnode);
+				}
+				if (sliceNodes.size() > 1) {
+					buff.append("</div>");
+				}
+			}
+		}
+		if (zone.getSlices() > 1) {
+			buff.append("</div>");
+		}
+	}
+	
+	@Override
+	protected void createMain(Node node) {
+		buff.append("<div>");
+		super.createMain(node);
+		buff.append("</div>");
+	}
+	
+
+}

Added: labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/BeanStyleTable.java
URL: http://svn.apache.org/viewvc/labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/BeanStyleTable.java?rev=833033&view=auto
==============================================================================
--- labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/BeanStyleTable.java (added)
+++ labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/BeanStyleTable.java Thu Nov  5 12:02:43 2009
@@ -0,0 +1,144 @@
+package org.apache.magma.website.beansview;
+
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.magma.view.Side;
+import org.apache.magma.view.tree.Node;
+import org.apache.magma.view.tree.Zone;
+
+public class BeanStyleTable extends BeanStyle {
+
+	@Override
+	protected void createOutsideZonedNodeTable(Node node) {
+		if (!node.hasOutsideZones()) {
+			createInsideZonedNodeTable(node);
+			return;
+		}
+
+		// Create a full table
+		buff.append("<table class=\"LayoutTable OutsideZones\">");
+		buff.append("<tr>");
+		// Create the table for the outside left
+		Zone zone = node.getZone(Side.OutsideLeft);
+		if (zone != null && zone.getSlices() > 0) {
+			buff.append("<td>");
+			createZoneTable(zone, true);
+			buff.append("</td>");
+		}
+		buff.append("<td>");
+		createInsideZonedNodeTable(node);
+		buff.append("</td>");
+		// Create the outside right table
+		zone = node.getZone(Side.OutsideRight);
+		if (zone != null && zone.getSlices() > 0) {
+			buff.append("<td>");
+			createZoneTable(zone, true);
+			buff.append("</td>");
+		}		
+		buff.append("</tr>");
+		buff.append("</table>");
+	}
+	
+	@Override
+	protected void createInsideZonedNodeTable(Node node) {
+		if (!node.hasInsideZones()) {
+			createMain(node);
+			return;
+		}
+		// Create a full table
+		buff.append("<table class=\"LayoutTable InsideZones\">");
+		buff.append("<tr>");
+		Zone zone = node.getZone(Side.InsideLeft);
+		if (zone != null && zone.getSlices() > 0) {
+			buff.append("<td rowspan=\"3\">");
+			createZoneTable(zone, true);
+			buff.append("</td>");
+		}
+		boolean maindone = false;
+		Zone bottomzone = node.getZone(Side.Bottom);
+		boolean hasbottom = bottomzone != null && bottomzone.getSlices() > 0;
+		zone = node.getZone(Side.Top);
+		if (zone != null && zone.getSlices() > 0) {
+			buff.append("<td>");
+			createZoneTable(zone, false);
+			buff.append("</td>");
+		} else {
+			if (hasbottom) {
+				buff.append("<td rowspan=\"2\">");				
+			} else {
+				buff.append("<td rowspan=\"3\">");
+			}
+			createMain(node);
+			buff.append("</td>");
+			maindone = true;
+		}
+		zone = node.getZone(Side.InsideRight);
+		if (zone != null && zone.getSlices() > 0) {
+			buff.append("<td rowspan=\"3\">");
+			createZoneTable(zone, true);
+			buff.append("</td>");
+		}
+		buff.append("</tr>");
+		buff.append("<tr>");
+		if (!maindone) {
+			if (hasbottom) {
+				buff.append("<td>");				
+			} else {
+				buff.append("<td rowspan=\"2\">");
+			}
+			createMain(node);
+			buff.append("</td>");
+			maindone = true;			
+		}
+		buff.append("</tr>");
+		buff.append("<tr>");
+		if (hasbottom) {
+			buff.append("<td>");
+			createZoneTable(bottomzone, false);
+			buff.append("</td>");			
+		}
+		buff.append("</tr>");
+		buff.append("</table>");
+	}
+
+	@Override
+	protected void createZoneTable(Zone zone, boolean vertical) {
+		String sliceseparator = vertical ? "</td><td>" : "</td></tr><tr><td>";
+		String nodeseparator = vertical ? "</td></tr><tr><td>" : "</td><td>";
+		if (zone.getSlices() > 1) {
+			buff.append("<table class=\"LayoutTable ZoneSlices " + (vertical ? "Vertical" : "Horizontal") + "\">");
+			buff.append("<tr><td>");
+		}
+		for (int slice = 0; slice < zone.getSlices(); slice++) {
+			List<Node> sliceNodes = zone.getSliceNodes(slice);
+			if (sliceNodes.size() > 0) {
+				if (sliceNodes.size() > 1) {
+					buff.append("<table class=\"LayoutTable Slice\">");
+					buff.append("<tr><td>");				
+				}
+				for (Iterator iterator = sliceNodes.iterator(); iterator.hasNext();) {
+					Node acnode = (Node) iterator.next();
+					createTable(acnode);
+					if (iterator.hasNext()) {
+						buff.append(nodeseparator);
+					}
+				}
+				if (sliceNodes.size() > 1) {
+					buff.append("</td></tr>");				
+					buff.append("</table>");
+				}
+				if (slice + 1 < zone.getSlices()) {
+					buff.append(sliceseparator);
+				}
+			}
+		}
+		if (zone.getSlices() > 1) {
+			buff.append("</td></tr>");
+			buff.append("</table>");
+		}
+	}
+	
+	
+	
+}

Modified: labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/Contextualizer.aj
URL: http://svn.apache.org/viewvc/labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/Contextualizer.aj?rev=833033&r1=833032&r2=833033&view=diff
==============================================================================
--- labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/Contextualizer.aj (original)
+++ labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/Contextualizer.aj Thu Nov  5 12:02:43 2009
@@ -39,7 +39,7 @@
 	
 	void around() : (
 			execution(void ShowBean+.create*(Node+,..)) || 
-			execution(void ShowList+.create*(Node+,..))
+			execution(void ListStyle+.create*(Node+,..))
 			) {
 		Object[] args = thisJoinPoint.getArgs();
 		if (args == null || args.length == 0) {

Added: labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/ListStyle.java
URL: http://svn.apache.org/viewvc/labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/ListStyle.java?rev=833033&view=auto
==============================================================================
--- labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/ListStyle.java (added)
+++ labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/ListStyle.java Thu Nov  5 12:02:43 2009
@@ -0,0 +1,160 @@
+package org.apache.magma.website.beansview;
+
+import java.io.IOException;
+import java.io.Writer;
+import java.util.List;
+
+import org.apache.commons.lang.StringEscapeUtils;
+import org.apache.magma.basics.LocalizableString;
+import org.apache.magma.beans.BeanData;
+import org.apache.magma.beans.MagmaBeanSupport;
+import org.apache.magma.beans.PropertyInfo;
+import org.apache.magma.view.tree.FieldNode;
+import org.apache.magma.view.tree.Node;
+import org.apache.magma.view.tree.RootNode;
+import org.apache.magma.view.tree.ViewUtils;
+import org.apache.magma.website.WebHandler;
+
+public abstract class ListStyle {
+
+	protected Class<?> myclass;
+	protected RootNode root;
+	protected boolean withLink = false;
+	protected StringBuilder buff;
+
+	public void setMyclass(Class<?> myclass) {
+		this.myclass = myclass;
+	}
+
+	public void setRoot(RootNode root) {
+		this.root = root;
+	}
+
+	public void setWithLink(boolean withLink) {
+		this.withLink = withLink;
+	}	
+	
+	public void generate() {
+		buff = new StringBuilder();
+		openOuterTable();
+		createHeader();
+		createBody();
+		createFooter();
+		closeOuterTable();
+	}
+	
+	public String getTemplate() {
+		return buff.toString();
+	}
+	
+	
+	protected void createHeader() {
+		openHeaderRow();
+		List<Node> nodes = root.getUniqueZone().getNodes();
+		for (Node node : nodes) {
+			if (node instanceof FieldNode) {
+				FieldNode fldn = (FieldNode) node;
+				createFieldNodeHeader(fldn);
+			}
+		}
+		closeHeaderRow();
+	}
+	protected abstract void openHeaderRow();
+	
+	protected abstract void openHeaderCell(FieldNode fldn);
+	
+	protected void createFieldNodeHeader(FieldNode fldn) {
+		openHeaderCell(fldn);
+		buff.append("${list.labelFor('");
+		buff.append(fldn.getId());
+		buff.append("')}");
+		closeHeaderCell(fldn);
+	}
+	protected abstract void closeHeaderCell(FieldNode fldn);
+
+	protected abstract void closeHeaderRow();
+	
+	
+	protected void createBody() {
+		openBody();
+		openIterator();
+		openRow();
+		List<Node> nodes = root.getUniqueZone().getNodes();
+		for (Node node : nodes) {
+			if (node instanceof FieldNode) {
+				FieldNode fldn = (FieldNode) node;
+				createFieldNodeCell(fldn);
+			}
+		}			
+		closeRow();
+		closeIterator();
+		closeBody();
+	}
+
+	protected abstract void openBody();
+	
+	protected void openIterator() {
+		buff.append('\n');
+		buff.append("#foreach($row in $list.getList())");
+		buff.append('\n');
+	}
+	
+	protected abstract void openRow();
+	
+	protected void closeIterator() {
+		buff.append('\n');
+		buff.append("#end");
+		buff.append('\n');		
+	}
+
+	protected abstract void closeBody();
+	
+	protected abstract void closeRow();
+	
+	
+	protected void createFieldNodeCell(FieldNode fldn) {
+		openCell(fldn);
+		if (withLink) {
+			openLink(fldn);
+		}
+		createFieldNodeCellContent(fldn);
+		if (withLink) {
+			closeLink(fldn);
+		}
+		closeCell(fldn);
+	}
+	
+	protected abstract void openCell(FieldNode fldn);
+	
+	protected void openLink(FieldNode fldn) {
+		buff.append("<a href=\"${list.computeLinkURL($row,'");
+		buff.append(fldn.getId());
+		buff.append("')}\" title=\"${list.computeLinkTitle($row,'");
+		buff.append(fldn.getId());		
+		buff.append("')}\">");
+	}
+	
+	protected void createFieldNodeCellContent(FieldNode fldn) {
+		PropertyInfo prop = fldn.getProperty();
+		buff.append("${list.contentFor($row,'");
+		buff.append(fldn.getId());
+		buff.append("')}");		
+	}
+	
+	protected void closeLink(FieldNode fldn) {
+		buff.append("</a>");
+	}
+
+	protected abstract void closeCell(FieldNode fldn);	
+	
+	protected abstract void createFooter();
+
+	protected abstract void closeOuterTable();
+
+	protected abstract void openOuterTable();
+	
+	protected String getStyleKey() {
+		return "WL" + this.withLink;
+	}
+
+}

Added: labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/ListStyleTable.java
URL: http://svn.apache.org/viewvc/labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/ListStyleTable.java?rev=833033&view=auto
==============================================================================
--- labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/ListStyleTable.java (added)
+++ labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/ListStyleTable.java Thu Nov  5 12:02:43 2009
@@ -0,0 +1,88 @@
+package org.apache.magma.website.beansview;
+
+import org.apache.magma.view.tree.FieldNode;
+import org.apache.magma.view.tree.RootNode;
+
+public class ListStyleTable extends ListStyle {
+
+	@Override
+	protected void closeBody() {
+		buff.append("</tbody>");		
+	}
+
+	@Override
+	protected void closeCell(FieldNode fldn) {
+		buff.append("</td>");
+	}
+
+	@Override
+	protected void closeHeaderCell(FieldNode fldn) {
+		buff.append("</th>");		
+	}
+
+	@Override
+	protected void closeHeaderRow() {
+		buff.append("</tr>");		
+		buff.append("</thead>");
+	}
+
+	@Override
+	protected void closeOuterTable() {
+		buff.append("</table>");
+	}
+
+	@Override
+	protected void closeRow() {
+		buff.append("</tr>");
+	}
+
+	@Override
+	protected void createFooter() {
+	}
+
+	@Override
+	protected void openBody() {
+		buff.append("<tbody>");
+	}
+
+	@Override
+	protected void openCell(FieldNode fldn) {
+		// TODO add call for additional classes
+		buff.append("<td class=\"MagmaList-Cell " + fldn.getId() + "\">");		
+	}
+
+	@Override
+	protected void openHeaderCell(FieldNode fldn) {
+		// TODO add call for additional classes
+		buff.append("<th class=\"MagmaList-HeaderCell " + fldn.getId() + "\">");
+	}
+
+	@Override
+	protected void openHeaderRow() {
+		buff.append("<thead>");
+		buff.append("<tr>");
+	}
+
+	@Override
+	protected void openOuterTable() {
+		buff.append("<table class=\"MagmaList ShowList ");
+		buff.append(myclass.getSimpleName());
+		buff.append("\" summary=\"$list.getSummary()\"");
+		buff.append(">");
+		buff.append("<caption>");
+		buff.append("$list.getCaption()");
+		buff.append("</caption>");
+	}
+
+	@Override
+	protected void openRow() {
+		buff.append("<tr>");
+	}
+
+	@Override
+	protected String getStyleKey() {
+		return null;
+	}
+
+
+}

Added: labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/ListStyleTableWithSorting.java
URL: http://svn.apache.org/viewvc/labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/ListStyleTableWithSorting.java?rev=833033&view=auto
==============================================================================
--- labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/ListStyleTableWithSorting.java (added)
+++ labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/ListStyleTableWithSorting.java Thu Nov  5 12:02:43 2009
@@ -0,0 +1,44 @@
+package org.apache.magma.website.beansview;
+
+import java.util.Set;
+
+import org.apache.magma.basics.LocalizableString;
+import org.apache.magma.view.tree.FieldNode;
+import org.apache.magma.website.WebHandler;
+
+public class ListStyleTableWithSorting extends ListStyleTable {
+
+	@Override
+	protected void openHeaderCell(FieldNode fldn) {
+		super.openHeaderCell(fldn);
+		buff.append("\n#set( $hasSortLink = $list.isSortable('");
+		buff.append(fldn.getId());
+		buff.append("') )\n");
+		buff.append("#if( $hasSortLink )\n");
+		buff.append("<a href=\"${list.sortLink('");
+		buff.append(fldn.getId());
+		buff.append("')}\">");
+		buff.append("\n#end\n");
+	}
+	
+	@Override
+	protected void closeHeaderCell(FieldNode fldn) {
+		buff.append("\n#if( $list.isSorted('");
+		buff.append(fldn.getId());
+		buff.append("'))\n");
+		buff.append("\n#if ($list.desc)\n");
+		buff.append("<img src=\"sortDesc.png\" alt=\"");
+		buff.append(new LocalizableString("Sorted").toString());
+		buff.append("\"/>");
+		buff.append("\n#else\n");
+		buff.append("<img src=\"sortAsc.png\" alt=\"");
+		buff.append(new LocalizableString("Sorted").toString());
+		buff.append("\"/>");		
+		buff.append("\n#end\n");
+		buff.append("\n#if( $hasSortLink )\n");
+		buff.append("</a>");
+		buff.append("\n#end\n");
+		super.closeHeaderCell(fldn);
+	}
+		
+}

Added: labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/ListStyleUl.java
URL: http://svn.apache.org/viewvc/labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/ListStyleUl.java?rev=833033&view=auto
==============================================================================
--- labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/ListStyleUl.java (added)
+++ labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/ListStyleUl.java Thu Nov  5 12:02:43 2009
@@ -0,0 +1,69 @@
+package org.apache.magma.website.beansview;
+
+import org.apache.magma.view.tree.FieldNode;
+
+public class ListStyleUl extends ListStyle {
+
+	@Override
+	protected void closeBody() {
+		buff.append("</ul>");
+	}
+
+	@Override
+	protected void closeCell(FieldNode fldn) {
+		buff.append("</span>");
+	}
+
+	@Override
+	protected void closeHeaderCell(FieldNode fldn) {
+	}
+
+	@Override
+	protected void closeHeaderRow() {
+	}
+
+	@Override
+	protected void closeOuterTable() {
+	}
+
+	@Override
+	protected void closeRow() {
+		buff.append("</li>");
+	}
+
+	@Override
+	protected void createFooter() {
+	}
+
+	@Override
+	protected void openBody() {
+		buff.append("<ul class=\"MagmaList ShowList " + myclass.getSimpleName() + "\">");
+	}
+
+	@Override
+	protected void openCell(FieldNode fldn) {
+		buff.append("<span class=\"MagmaList-Span " + fldn.getId() + "\">");		
+	}
+
+	
+	protected void createFieldNodeHeader(FieldNode fldn) {
+	}
+	
+	@Override
+	protected void openHeaderCell(FieldNode fldn) {
+	}
+
+	@Override
+	protected void openHeaderRow() {
+	}
+
+	@Override
+	protected void openOuterTable() {
+	}
+
+	@Override
+	protected void openRow() {
+		buff.append("<li>");
+	}
+
+}

Modified: labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/ShowBean.java
URL: http://svn.apache.org/viewvc/labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/ShowBean.java?rev=833033&r1=833032&r2=833033&view=diff
==============================================================================
--- labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/ShowBean.java (original)
+++ labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/ShowBean.java Thu Nov  5 12:02:43 2009
@@ -19,6 +19,7 @@
 import java.io.IOException;
 import java.io.OutputStream;
 import java.io.OutputStreamWriter;
+import java.io.StringReader;
 import java.io.StringWriter;
 import java.io.UnsupportedEncodingException;
 import java.io.Writer;
@@ -38,15 +39,20 @@
 import org.apache.magma.view.tree.FieldNode;
 import org.apache.magma.view.tree.LabelNode;
 import org.apache.magma.view.tree.Node;
+import org.apache.magma.view.tree.RootNode;
 import org.apache.magma.view.tree.ViewUtils;
 import org.apache.magma.view.tree.Zone;
 import org.apache.magma.website.Head;
 import org.apache.magma.website.HtmlProducer;
+import org.apache.velocity.VelocityContext;
+import org.apache.velocity.app.Velocity;
 
 public class ShowBean extends HtmlProducer {
 
 	protected MagmaBeanSupport bean;
 	protected String[] layers = null;
+	protected RootNode root;
+	protected BeanStyle beanStyle;
 
 	public ShowBean(Object bean) {
 		this.bean = (MagmaBeanSupport)bean;
@@ -58,193 +64,57 @@
 	
 	@Override
 	public void produce(Writer writer) throws IOException {
-		Node root = bean.beanData().getViewTree(this.layers);
+		root = bean.beanData().getViewTree(this.layers);
+		// TODO optimize this
 		if (root.getAllNodes().size() == 1) throw new MagmaException("Cannot display {0}, seems like no @MagView elements are present or they are not correctly connected to each other correctly using @Order, @Zone etc..", bean.getClass());
-		StringWriter tables = new StringWriter();
-		try {
-			createTable(root, tables);
-			tables.flush();
-		} catch (UnsupportedEncodingException e) {
-			// Should never happen
-			throw new MagmaException(e, "Something is extremely wrong if we cannot find UTF-8");
-		} catch (IOException e) {
-			throw new MagmaException(e, "Error writing to output");
-		}
-		String fullform = tables.toString();
-		fullform = fullform.replaceFirst("<table", "<table id=\"" + bean.getClass().getSimpleName() + "-table\"");
-		fullform = fullform.replaceAll(">\\|MAGMA-([^\\|]*)\\|"," $1>");
-		fullform = fullform.replaceAll("<td([^>]*)></td>", "<td$1>&nbsp;</td>");
-		writer.write(fullform);
-	}
-
-	protected void createTable(Node node, Writer out) throws IOException {
-		// Skip container only nodes
-		if (node.hasSingleZone()) { 
-			createContainerNodeTable(node, out);
-			return;
-		}
-		if (!node.hasInsideZones() && !node.hasOutsideZones()) {
-			// Avoid creating an entire table structure if we don't have any zone to layout but only a main
-			createMain(node, out);			
-		}
-		if (node.hasOutsideZones()) {
-			createOutsideZonedNodeTable(node, out);
-		} else if (node.hasInsideZones()) {
-			createInsideZonedNodeTable(node, out);
-		}
-	}
-
-	protected void createOutsideZonedNodeTable(Node node, Writer out) throws IOException {
-		// Create a full table
-		out.append("<table class=\"LayoutTable OutsideZones\">");
-		out.append("<tr>");
-		// Create the table for the outside left
-		Zone zone = node.getZone(Side.OutsideLeft);
-		if (zone != null && zone.getSlices() > 0) {
-			out.append("<td>");
-			createZoneTable(zone, true, out);
-			out.append("</td>");
-		}
-		out.append("<td>");
-		if (!node.hasInsideZones()) {
-			createMain(node, out);
-		} else {
-			createInsideZonedNodeTable(node, out);
-		}
-		out.append("</td>");
-		// Create the outside right table
-		zone = node.getZone(Side.OutsideRight);
-		if (zone != null && zone.getSlices() > 0) {
-			out.append("<td>");
-			createZoneTable(zone, true, out);
-			out.append("</td>");
-		}		
-		out.append("</tr>");
-		out.append("</table>");
-	}
-
-	protected void createInsideZonedNodeTable(Node node, Writer out) throws IOException {
-		// Create a full table
-		out.append("<table class=\"LayoutTable InsideZones\">");
-		out.append("<tr>");
-		Zone zone = node.getZone(Side.InsideLeft);
-		if (zone != null && zone.getSlices() > 0) {
-			out.append("<td rowspan=\"3\">");
-			createZoneTable(zone, true, out);
-			out.append("</td>");
-		}
-		boolean maindone = false;
-		Zone bottomzone = node.getZone(Side.Bottom);
-		boolean hasbottom = bottomzone != null && bottomzone.getSlices() > 0;
-		zone = node.getZone(Side.Top);
-		if (zone != null && zone.getSlices() > 0) {
-			out.append("<td>");
-			createZoneTable(zone, false, out);
-			out.append("</td>");
-		} else {
-			if (hasbottom) {
-				out.append("<td rowspan=\"2\">");				
-			} else {
-				out.append("<td rowspan=\"3\">");
-			}
-			createMain(node, out);
-			out.append("</td>");
-			maindone = true;
-		}
-		zone = node.getZone(Side.InsideRight);
-		if (zone != null && zone.getSlices() > 0) {
-			out.append("<td rowspan=\"3\">");
-			createZoneTable(zone, true, out);
-			out.append("</td>");
-		}
-		out.append("</tr>");
-		out.append("<tr>");
-		if (!maindone) {
-			if (hasbottom) {
-				out.append("<td>");				
-			} else {
-				out.append("<td rowspan=\"2\">");
+		
+		if (beanStyle == null) {
+			beanStyle = new BeanStyleTable();
+		}
+		beanStyle.setMyclass(bean.getClass());
+		beanStyle.setRoot(root);
+		String tplkey = beanStyle.getClass().getName() + ":" + beanStyle.getStyleKey();
+		
+		String tplval = root.getTemplate(tplkey);
+		if (tplval == null) {
+			synchronized (root) {
+				tplval = root.getTemplate(tplkey);
+				if (tplval == null) {
+					beanStyle.generate();
+					tplval = beanStyle.getTemplate();
+				}
 			}
-			createMain(node, out);
-			out.append("</td>");
-			maindone = true;			
-		}
-		out.append("</tr>");
-		out.append("<tr>");
-		if (hasbottom) {
-			out.append("<td>");
-			createZoneTable(bottomzone, false, out);
-			out.append("</td>");			
 		}
-		out.append("</tr>");
-		out.append("</table>");
+		
+		VelocityContext ctx = new VelocityContext();
+		ctx.put("prod", this);
+		Velocity.evaluate(ctx, writer, "", new StringReader(tplval));
 	}
-
-	protected void createContainerNodeTable(Node node, Writer out) throws IOException {
-		if (node instanceof ContainerProperty) {
-			createAdditionalInfo(node, "ForBean", out);					
-		}
-		Zone zone = node.getUniqueZone();
-		boolean vertical = zone.getSide().equals(Side.OutsideLeft) ||
-				zone.getSide().equals(Side.OutsideRight) ||
-				zone.getSide().equals(Side.InsideLeft) ||
-				zone.getSide().equals(Side.InsideRight);
-		createZoneTable(zone, vertical, out);
+	
+	public MagmaBeanSupport getBean() {
+		return bean;
 	}
-
-	protected void createZoneTable(Zone zone, boolean vertical, Writer out) throws IOException {
-		String sliceseparator = vertical ? "</td><td>" : "</td></tr><tr><td>";
-		String nodeseparator = vertical ? "</td></tr><tr><td>" : "</td><td>";
-		if (zone.getSlices() > 1) {
-			out.append("<table class=\"LayoutTable ZoneSlices " + (vertical ? "Vertical" : "Horizontal") + "\">");
-			out.append("<tr><td>");
-		}
-		for (int slice = 0; slice < zone.getSlices(); slice++) {
-			List<Node> sliceNodes = zone.getSliceNodes(slice);
-			if (sliceNodes.size() > 0) {
-				if (sliceNodes.size() > 1) {
-					out.append("<table class=\"LayoutTable Slice\">");
-					out.append("<tr><td>");				
-				}
-				for (Iterator iterator = sliceNodes.iterator(); iterator.hasNext();) {
-					Node acnode = (Node) iterator.next();
-					createTable(acnode, out);
-					if (iterator.hasNext()) {
-						out.append(nodeseparator);
-					}
-				}
-				if (sliceNodes.size() > 1) {
-					out.append("</td></tr>");				
-					out.append("</table>");
-				}
-				if (slice + 1 < zone.getSlices()) {
-					out.append(sliceseparator);
-				}
-			}
-		}
-		if (zone.getSlices() > 1) {
-			out.append("</td></tr>");
-			out.append("</table>");
-		}
+	@Override
+	public void head(Head head) {
+		head.addCss("magma:/common/beansview/magmaBeansview.css");
 	}
-
-	protected void createMain(Node node, Writer out) throws IOException {
-		if (node instanceof LabelNode) {
-			createLabelNodeOutput((LabelNode) node, out);
-		} else if (node instanceof FieldNode) {
-			createFieldNodeOutput((FieldNode) node, out);
-		} else if (node instanceof ContainerProperty) {
-			createContainerPropertyNodeOutput((ContainerProperty) node, out);
-		} else {
-			createGenericNodeOutput(node, out);
-		}		
+	public String[] getLayers() {
+		return layers;
 	}
-
-	private void createContainerPropertyNodeOutput(ContainerProperty node, Writer out) throws IOException {
+	public void setLayers(String... layers) {
+		this.layers = layers;
+	}
+	
+	public final String valueFor(String nodeid) {
+		Node gennode = root.findById(nodeid);
+		return valueFor(gennode);
 	}
 	
-	protected void createFieldNodeOutput(FieldNode node, Writer out) throws IOException {
-		createAdditionalInfo(node, "MagmaField", out);
+	protected String valueFor(Node gennode) {
+		if (!(gennode instanceof FieldNode)) return "NA";
+		FieldNode node = (FieldNode) gennode; 
+		
+		// TODO move this part to PropertyInfo?		
 		Object value = ViewUtils.getNodeValue(node, bean);
 		PropertyInfo prop = node.getProperty();
 		String valueString = prop.toUser(value);
@@ -253,55 +123,42 @@
 			if (prop.getType().equals(String.class)) {
 				valueString = StringEscapeUtils.escapeHtml(valueString);
 			}
-			out.append(valueString);			
-		}
+			return valueString;			
+		}		
+		return "";
 	}
 	
-
-	protected void createLabelNodeOutput(LabelNode node, Writer out) throws IOException {
-		String baseclass = "MagmaLabel";
-		Node relatedTo = node.getRelatedTo();
-		if (relatedTo != null) {
-			if (relatedTo instanceof ContainerProperty) {
-				baseclass += " ForBean";
-			}
-		}
-		createAdditionalInfo(node, baseclass, out);
-		out.append(new LocalizableString(node.getProperty().getViewSettings().getLabel()).toString());
-	}
-
-	protected void createGenericNodeOutput(Node node, Writer out) throws IOException {
-		//out.append("Node " + node.getId());
-	}
-
-	protected void createAdditionalInfo(Node node, String baseclass, Writer out, String idsuffix) throws IOException {
-		out.append("|MAGMA-");
-		out.append("class=\"");
-		out.append(baseclass);
-		out.append("\" id=\"");
-		out.append(node.getId());
-		out.append("-");
-		out.append(idsuffix);
-		out.append("\"");
-		out.append("|");		
+	public final String labelFor(String nodeid) {
+		Node gennode = root.findById(nodeid);
+		return labelFor(gennode);
 	}
 	
-	protected void createAdditionalInfo(Node node, String baseclass, Writer out) throws IOException {
-		createAdditionalInfo(node, baseclass, out, "cell");
+	protected String labelFor(Node gennode) {
+		if (!(gennode instanceof LabelNode)) return "NA";
+		LabelNode node = (LabelNode) gennode; 
+				
+		return new LocalizableString(node.getProperty().getViewSettings().getLabel()).toString();		
 	}
 	
-	public MagmaBeanSupport getBean() {
-		return bean;
+	public final String classesFor(String nodeid) {
+		Node gennode = root.findById(nodeid);
+		return classesFor(gennode);
 	}
-	@Override
-	public void head(Head head) {
-		head.addCss("magma:/common/beansview/magmaBeansview.css");
+	protected String classesFor(Node gennode) {
+		return "";
 	}
-	public String[] getLayers() {
-		return layers;
+	
+	public ShowBean useTables() {
+		this.beanStyle = new BeanStyleTable();
+		return this;
 	}
-	public void setLayers(String... layers) {
-		this.layers = layers;
+	
+	public ShowBean usePlainDivs() {
+		this.beanStyle = new BeanStylePlainDivs();
+		return this;
+	}
+	public void setBeanStyle(BeanStyle beanStyle) {
+		this.beanStyle = beanStyle;
 	}
 	
 }

Modified: labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/ShowList.java
URL: http://svn.apache.org/viewvc/labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/ShowList.java?rev=833033&r1=833032&r2=833033&view=diff
==============================================================================
--- labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/ShowList.java (original)
+++ labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/ShowList.java Thu Nov  5 12:02:43 2009
@@ -30,14 +30,18 @@
 import org.apache.magma.view.MagDefaultLayers;
 import org.apache.magma.view.tree.FieldNode;
 import org.apache.magma.view.tree.Node;
+import org.apache.magma.view.tree.RootNode;
 import org.apache.magma.view.tree.ViewUtils;
 import org.apache.magma.website.Head;
 import org.apache.magma.website.HtmlProducer;
 import org.apache.magma.website.WebHandler;
+import org.apache.velocity.VelocityContext;
+import org.apache.velocity.app.Velocity;
 
 import java.io.IOException;
 import java.io.OutputStream;
 import java.io.OutputStreamWriter;
+import java.io.StringReader;
 import java.io.UnsupportedEncodingException;
 import java.io.Writer;
 import java.lang.reflect.Method;
@@ -57,7 +61,7 @@
 	protected String summary;
 	protected String gototitle;
 	protected String[] layers = LIST;
-	protected ListHtmlEmitter emitter = new TableListHtmlEmitter();
+	protected ListStyle listStyle;
 	
 	public <T extends MagmaBeanSupport> ShowList(Class<T> myclass, Collection<? extends T> list, String link, String... layers) {
 		this.list = list;
@@ -77,6 +81,14 @@
 		this.myclass = myclass;
 	}
 	
+	protected <T extends MagmaBeanSupport> ShowList(Class<T> myclass) {
+		this.myclass = myclass;
+	}
+	
+	protected <T extends MagmaBeanSupport> void setList(Collection<? extends T> list) {
+		this.list = list;
+	}
+	
 	@Override
 	public void produce(Writer tables) throws IOException {
 		this.gototitle = new LocalizableString("Show element").toString();		
@@ -105,115 +117,32 @@
 			if (this.converter == null) throw new MagmaException("Cannot find converter for {0}, cannot make link!", this.myclass);			
 		}
 				
-		Node root = BeanData.getFor(myclass).getViewTree(this.layers);
+		RootNode root = BeanData.getFor(myclass).getViewTree(this.layers);
+		// TODO optimize this
 		if (root.getAllNodes().size() == 1) throw new MagmaException("Cannot create list for {0}, seems like no @Listed elements are present or they are not correctly connected to each other to form a proper list", myclass);
-		try {
-			openOuterTable(root, tables);
-			createHeader(root, tables);
-			createBody(root, tables);
-			createFooter(root, tables);
-			closeOuterTable(root, tables);
-		} catch (UnsupportedEncodingException e) {
-			// Should never happen
-			throw new MagmaException(e, "Something is extremely wrong if we cannot find UTF-8");
-		} catch (IOException e) {
-			throw new MagmaException(e, "Error writing to output");
-		}
-	}
-
-	protected void createBody(Node root, Writer tables) throws IOException {
-		if (!emitter.supportsBody()) return;
-		emitter.openBody(this.myclass, root, tables);
-		if (this.list != null) {
-			for (Object o : this.list) {
-				if (!(o instanceof MagmaBeanSupport)) continue;
-				MagmaBeanSupport mb = (MagmaBeanSupport) o;
-				openRow(mb, tables);
-				List<Node> nodes = root.getUniqueZone().getNodes();
-				for (Node node : nodes) {
-					if (node instanceof FieldNode) {
-						FieldNode fldn = (FieldNode) node;
-						createFieldNodeCell(fldn,mb, tables);
-					}
-				}			
-				closeRow(mb, tables);
-			}
-		}
-		emitter.closeBody(this.myclass, root, tables);
-	}
-
-	protected void createFieldNodeCell(FieldNode fldn, MagmaBeanSupport bean, Writer tables) throws IOException {
-		emitter.openCell(fldn, bean, tables);
-		if (this.linkUrl != null) {
-			emitter.openLink(createUrlFor(fldn, bean), gototitle, tables);
-		}
-		Object value = ViewUtils.getNodeValue(fldn, bean);
-		createFieldNodeCellContent(fldn, bean, value, tables);
-		if (this.linkUrl != null) {
-			emitter.closeLink(tables);
-		}
-		emitter.closeCell(fldn, bean, tables);
-	}
-	
-	protected void createFieldNodeCellContent(FieldNode fldn, MagmaBeanSupport bean, Object value, Writer tables) throws IOException {
-		PropertyInfo prop = fldn.getProperty();
-		String string = prop.toUser(value);
-		if (string != null) {
-			if (prop.getType().equals(String.class)) {
-				string = StringEscapeUtils.escapeHtml(string);
-			}
-			tables.write(string);
-		}		
-	}
-
-	protected String createUrlFor(FieldNode fldn, MagmaBeanSupport bean) {
-		return this.linkUrl + WebHandler.paramSeparator + this.converter.to(bean);
-	}
-
-	protected void openRow(MagmaBeanSupport bean, Writer tables) throws IOException {
-		emitter.openRow(bean, tables);
-	}
-	protected void closeRow(MagmaBeanSupport bean, Writer tables) throws IOException {
-		emitter.closeRow(bean, tables);
-	}
-
-	protected void openHeaderRow(Node root, Writer tables) throws IOException {
-		emitter.openHeader(this.myclass, root, tables);
-	}
-	protected void closeHeaderRow(Node root, Writer tables) throws IOException {
-		emitter.closeHeader(this.myclass, root, tables);
-	}
 	
-	
-	protected void createHeader(Node root, Writer tables) throws IOException {
-		if (!emitter.supportsHeader()) return;
-		openHeaderRow(root, tables);
-		List<Node> nodes = root.getUniqueZone().getNodes();
-		for (Node node : nodes) {
-			if (node instanceof FieldNode) {
-				FieldNode fldn = (FieldNode) node;
-				createFieldNodeHeader(fldn, tables);
+		if (listStyle == null) {
+			listStyle = new ListStyleTable();
+		}
+		listStyle.setMyclass(myclass);
+		listStyle.setRoot(root);
+		listStyle.setWithLink(this.linkUrl != null);
+		String tplkey = listStyle.getClass().getName() + ":" + listStyle.getStyleKey();
+		
+		String tplval = root.getTemplate(tplkey);
+		if (tplval == null) {
+			synchronized (root) {
+				tplval = root.getTemplate(tplkey);
+				if (tplval == null) {
+					listStyle.generate();
+					tplval = listStyle.getTemplate();
+				}
 			}
 		}
-		closeHeaderRow(root, tables);
-	}
-	
-	protected void createFooter(Node root, Writer tables) throws IOException {
 		
-	}
-
-	protected void createFieldNodeHeader(FieldNode fldn, Writer tables) throws IOException {
-		emitter.openHeaderCell(fldn, tables);
-		tables.write(new LocalizableString(fldn.getProperty().getViewSettings().getLabel()).toString());
-		emitter.closeHeaderCell(fldn, tables);
-	}
-
-	protected void closeOuterTable(Node root, Writer tables) throws IOException {
-		emitter.closeTable(this.myclass, root, tables);
-	}
-
-	protected void openOuterTable(Node root, Writer tables) throws IOException {
-		emitter.openTable(this.myclass, root, summary, caption, tables);
+		VelocityContext ctx = new VelocityContext();
+		ctx.put("list", this);
+		Velocity.evaluate(ctx, tables, "", new StringReader(tplval));
 	}
 
 
@@ -223,7 +152,7 @@
 	}
 
 	public String getCaption() {
-		return caption;
+		return caption == null ? "" : caption;
 	}
 
 	public ShowList setCaption(String caption) {
@@ -232,7 +161,7 @@
 	}
 
 	public String getSummary() {
-		return summary;
+		return summary == null ? "" : summary;
 	}
 
 	public ShowList setSummary(String summary) {
@@ -249,23 +178,70 @@
 	}
 	
 	public ShowList useList() {
-		emitter = new UlListHtmlEmitter();
+		listStyle = new ListStyleUl();
 		return this;
 	}
 	
 	public ShowList useTable() {
-		emitter = new TableListHtmlEmitter();
+		listStyle = new ListStyleTable();
 		return this;
 	}
 
-	public ListHtmlEmitter getEmitter() {
-		return emitter;
+	public ListStyle getListTemplate() {
+		return listStyle;
 	}
 
-	public ShowList setEmitter(ListHtmlEmitter emitter) {
-		if (emitter != null) this.emitter = emitter;
+	public ShowList setListStyle(ListStyle listTemplate) {
+		if (listTemplate != null) this.listStyle = listTemplate;
 		return this;
 	}
 		
+	public String computeLinkURL(MagmaBeanSupport bean, String nodeid) {
+		return this.linkUrl + WebHandler.paramSeparator + this.converter.to(bean);
+	}
+	
+	public String computeLinkTitle(MagmaBeanSupport bean, String nodeid) {
+		return this.gototitle;
+	}
+	
+	public final String labelFor(String nodeid) {
+		RootNode root = BeanData.getFor(myclass).getViewTree(this.layers);
+		Node gennode = root.findById(nodeid);
+		return labelFor(gennode);
+	}
+	
+	protected String labelFor(Node gennode) {
+		if (!(gennode instanceof FieldNode)) return "NA";
+		FieldNode node = (FieldNode) gennode;
+		return new LocalizableString(node.getProperty().getViewSettings().getLabel()).toString();
+	}
+	
+	public final String contentFor(MagmaBeanSupport bean, String nodeid) {
+		RootNode root = BeanData.getFor(myclass).getViewTree(this.layers);
+		Node gennode = root.findById(nodeid);
+		return contentFor(bean, gennode);
+	}
+	
+	protected String contentFor(MagmaBeanSupport bean, Node gennode) {
+		if (!(gennode instanceof FieldNode)) return "NA";
+		FieldNode node = (FieldNode) gennode;
+		
+		// TODO move this part to PropertyInfo?
+		Object value = ViewUtils.getNodeValue(node, bean);
+		PropertyInfo prop = node.getProperty();
+		String valueString = prop.toUser(value);
+		if (valueString != null && valueString.length() > 0) {
+			valueString = valueString.trim();
+			if (prop.getType().equals(String.class)) {
+				valueString = StringEscapeUtils.escapeHtml(valueString);
+			}
+			return valueString;			
+		}
+		return "";
+	}
+
+	public Collection<?> getList() {
+		return this.list;
+	}
 	
 }

Modified: labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/SmartForm.java
URL: http://svn.apache.org/viewvc/labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/SmartForm.java?rev=833033&r1=833032&r2=833033&view=diff
==============================================================================
--- labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/SmartForm.java (original)
+++ labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/SmartForm.java Thu Nov  5 12:02:43 2009
@@ -53,7 +53,7 @@
 	private HtmlProducer prodFooter = null;
 	
 	protected Map<String, String[]> allParams = null;
-	private String paramMagmaWorkingButton = null;
+	protected String paramMagmaWorkingButton = null;
  	
 	String[] layers = null;
 	
@@ -61,6 +61,8 @@
 	Map<String, String> binding = new HashMap<String, String>();
 	List<LocalizableStringWithSubject> errors = new ArrayList<LocalizableStringWithSubject>();
     HashMap<MagmaBeanSupport, BeanHandler> handlers;
+
+	protected BeanStyle beanStyle;
 	
 	public SmartForm(Object bean, String next) {
 		this.bean = (MagmaBeanSupport) bean;
@@ -117,6 +119,7 @@
 		BeanFormProducer producer = new BeanFormProducer(this.bean, errors, getMyCode(), this.layers);
 		producer.setActions(this.actions);
 		producer.setLists(this.lists);
+		producer.setBeanStyle(this.beanStyle);
 		producer.compoundWith(prodHeader, CompoundType.BEFORE);
 		producer.compoundWith(prodFooter, CompoundType.AFTER);
 		return producer;
@@ -288,5 +291,16 @@
 	public List<FormAction> getActions() {
 		return actions;
 	}
+	
+	public SmartForm useTables() {
+		this.beanStyle = new BeanStyleTable();
+		return this;
+	}
+	
+	public SmartForm usePlainDivs() {
+		this.beanStyle = new BeanStylePlainDivs();
+		return this;
+	}
+	
 
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@labs.apache.org
For additional commands, e-mail: commits-help@labs.apache.org


Mime
View raw message