JBoss Rich Faces SVN: r9854 - trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/html.
by richfaces-svn-commits@lists.jboss.org
Author: pgolawski
Date: 2008-08-01 02:20:33 -0400 (Fri, 01 Aug 2008)
New Revision: 9854
Modified:
trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/html/TableDragDropRenderer.java
Log:
fix xml format
Modified: trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/html/TableDragDropRenderer.java
===================================================================
--- trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/html/TableDragDropRenderer.java 2008-07-31 16:42:30 UTC (rev 9853)
+++ trunk/sandbox/ui/extendedDataTable/src/main/java/org/richfaces/renderkit/html/TableDragDropRenderer.java 2008-08-01 06:20:33 UTC (rev 9854)
@@ -12,6 +12,7 @@
import javax.faces.context.FacesContext;
import javax.faces.context.ResponseWriter;
+import org.ajax4jsf.javascript.JSEncoder;
import org.ajax4jsf.javascript.JSFunction;
import org.ajax4jsf.javascript.JSFunctionDefinition;
import org.ajax4jsf.org.w3c.tidy.EntityTable;
@@ -90,6 +91,27 @@
responseWriter.write(getPredefinedMarker(context, REJECT));
responseWriter.write("\";\n");
}
+
+ protected String getPredefinedMarker(FacesContext context, Object facetName) {
+ if (MARKERS_PREDEFINED.contains(facetName)) {
+ StringBuffer buff = new StringBuffer();
+ JSEncoder encoder = new JSEncoder();
+ String source = "<img alt='' border='0' width='16' height='16' src='" +
+ getResource("/org/richfaces/renderkit/html/images/" + facetName + ".gif").getUri(context, null) +"' />";
+ char chars[] = source.toString().toCharArray();
+ for (int i = 0; i < chars.length; i++) {
+ char c = chars[i];
+ if (!encoder.compile(c)) {
+ buff.append(encoder.encode(c));
+ } else {
+ buff.append(c);
+ }
+ }
+ return buff.toString();
+ }
+
+ throw new IllegalArgumentException("No predefined marker with [" + facetName + "] name exists!");
+ }
}.encodeChildScripts(context, component);
}
16 years, 4 months