labs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From simo...@apache.org
Subject svn commit: r747430 - in /labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview: BeanFormProducer.java ShowList.java SmartListProducer.java
Date Tue, 24 Feb 2009 17:00:30 GMT
Author: simoneg
Date: Tue Feb 24 17:00:28 2009
New Revision: 747430

URL: http://svn.apache.org/viewvc?rev=747430&view=rev
Log:
LABS-303 : small fixes to generated XHTML

Modified:
    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/ShowList.java
    labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/SmartListProducer.java

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=747430&r1=747429&r2=747430&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
Tue Feb 24 17:00:28 2009
@@ -67,7 +67,7 @@
 	@Override
 	public void produce(Writer out) throws IOException {
 		try {
-			out.write("<form action=\"filled\" method=\"POST\" accept-charset=\"utf-8\"><div>");
+			out.write("<form action=\"filled\" method=\"post\" accept-charset=\"utf-8\"><div>");
 			out.write("<input type=\"submit\" class=\"DefaultHiddenSubmit\" value=\"-\"/>");
 			out.flush();
 			super.produce(out);
@@ -116,12 +116,15 @@
 			out.append("<span class=\"NotNullableSign\">*</span>");
 		}
 		if (errs.size() > 0) {
-			createErrorsOutput(node, out, errs);
+			createInlineErrorsOutput(node, out, errs);
 		}
 		out.append("</label>");
+		if (errs.size() > 0) {
+			createBlockErrorsOutput(node, out, errs);
+		}
 	}
 
-	private void createErrorsOutput(LabelNode node, Writer out, List<LocalizableString>
errs) throws IOException {
+	private void createInlineErrorsOutput(LabelNode node, Writer out, List<LocalizableString>
errs) throws IOException {
 		StringBuilder sb = new StringBuilder();
 		for (LocalizableString err : errs) {
 			sb.append(err.toString());
@@ -130,11 +133,19 @@
 		out.append("<a href=\"#\" class=\"ErrorsSign\" title=\"");
 		out.append(sb);
 		out.append("\">!</a>");
+	}
+
+	private void createBlockErrorsOutput(LabelNode node, Writer out, List<LocalizableString>
errs) throws IOException {
+		StringBuilder sb = new StringBuilder();
+		for (LocalizableString err : errs) {
+			sb.append(err.toString());
+			sb.append("\n");
+		}		
 		out.append("<div class=\"ErrorsZone\">");
 		out.append(sb);
-		out.append("</div>");
-		
+		out.append("</div>");		
 	}
+
 	
 	protected List<LocalizableString> findErrors(PropertyInfo property) {
 		List<LocalizableString> errs = new ArrayList<LocalizableString>();
@@ -357,7 +368,7 @@
 			out.append(Integer.toString(maxSize));			
 			out.append('\"');
 		}
-		out.append("\"/>");		
+		out.append("/>");		
 	}
 
 

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=747430&r1=747429&r2=747430&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
Tue Feb 24 17:00:28 2009
@@ -54,6 +54,7 @@
 	protected Converter converter;
 	protected String caption;
 	protected String summary;
+	protected String gototitle;
 	
 	public <T> ShowList(Class<T> myclass, Collection<? extends T> list, ViewCustomizer
filter, String link) {
 		this.list = list;
@@ -81,6 +82,7 @@
 	
 	@Override
 	public void produce(Writer tables) throws IOException {
+		this.gototitle = new LocalizableString("Show element").toString();		
 		if (this.link != null) {
 			GenericClass gc = GenericClass.forClass(getCreatingHandler().getClass());
 			List<MethodDef> methods = gc.findMethods(this.link, new Class<?>[] { this.myclass
});
@@ -147,7 +149,7 @@
 		if (this.linkUrl != null) {
 			tables.write("<a href=\"");
 			tables.write(createUrlFor(fldn, bean));
-			tables.write("\">");
+			tables.write("\" title=\"" + gototitle + "\">");		
 		}
 		Object value = ViewUtils.getNodeValue(fldn, bean);
 		String string = fldn.getProperty().toUser(value);
@@ -204,7 +206,7 @@
 	}
 
 	protected void openOuterTable(Node root, Writer tables) throws IOException {
-		tables.write("<table id=\"ShowList-" + this.myclass.getSimpleName() +"\" class=\"MagmaList
ShowList\"");
+		tables.write("<table class=\"MagmaList ShowList\"");
 		if (summary != null) {
 			tables.write(" summary=\"");
 			tables.write(summary);

Modified: labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/SmartListProducer.java
URL: http://svn.apache.org/viewvc/labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/SmartListProducer.java?rev=747430&r1=747429&r2=747430&view=diff
==============================================================================
--- labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/SmartListProducer.java
(original)
+++ labs/magma/trunk/website-beansview/src/main/java/org/apache/magma/website/beansview/SmartListProducer.java
Tue Feb 24 17:00:28 2009
@@ -108,6 +108,7 @@
 	
 	
 	String createPagination() {
+		String gototitle = new LocalizableString("Go to page").toString();		
 		int currentpage = start / len;
 		int totalpage = count == -1 ? -1 : count / len;
 		
@@ -132,7 +133,7 @@
 				ret.append(Integer.toString(currentpage + 1));
 				ret.append("</strong> ");
 			} else {
-				ret.append(" <a href=\"start" + WebHandler.paramSeparator + Math.max(0, start + (len
* po)) + "\">");
+				ret.append(" <a href=\"start" + WebHandler.paramSeparator + Math.max(0, start + (len
* po)) + "\"  title=\"" + gototitle + "\">");
 				ret.append(Integer.toString(currentpage + po + 1));
 				ret.append("</a> ");
 			}



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


Mime
View raw message