incubator-isis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmatth...@apache.org
Subject svn commit: r1090803 - in /incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view: debug/Diagnostics.java display/AbstractTableView.java display/TableBuilder.java display/TableView.java
Date Sun, 10 Apr 2011 13:53:54 GMT
Author: rmatthews
Date: Sun Apr 10 13:53:54 2011
New Revision: 1090803

URL: http://svn.apache.org/viewvc?rev=1090803&view=rev
Log:
Added classes to table and thead generated by tablebuilder

Modified:
    incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/debug/Diagnostics.java
    incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/display/AbstractTableView.java
    incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/display/TableBuilder.java
    incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/display/TableView.java

Modified: incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/debug/Diagnostics.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/debug/Diagnostics.java?rev=1090803&r1=1090802&r2=1090803&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/debug/Diagnostics.java
(original)
+++ incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/debug/Diagnostics.java
Sun Apr 10 13:53:54 2011
@@ -57,6 +57,7 @@ public class Diagnostics extends Abstrac
                 RequestContext context = request.getContext();
                 DebugHtmlString debug = new DebugHtmlString();
                 context.append(debug, "variables");
+                request.appendHtml(debug.toString());
             } else  if ("processing".equals(type)) {
                 request.appendHtml(request.getContext().getDebugTrace());      
             } else {

Modified: incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/display/AbstractTableView.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/display/AbstractTableView.java?rev=1090803&r1=1090802&r2=1090803&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/display/AbstractTableView.java
(original)
+++ incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/display/AbstractTableView.java
Sun Apr 10 13:53:54 2011
@@ -48,7 +48,8 @@ public abstract class AbstractTableView 
         String parentObjectId = null;
         boolean isFieldEditable = false;
         String field = request.getOptionalProperty(FIELD);
-        ObjectSpecification elementSpec;
+        String tableClass = request.getOptionalProperty(CLASS);
+         ObjectSpecification elementSpec;
         if (field != null) {
             String objectId = request.getOptionalProperty(OBJECT);
             ObjectAdapter object = context.getMappedObjectOrResult(objectId);
@@ -81,7 +82,7 @@ public abstract class AbstractTableView 
         List<ObjectAssociation> allFields = elementSpec.getAssociations(
                 ObjectAssociationFilters.STATICALLY_VISIBLE_ASSOCIATIONS);
         TableContentWriter rowBuilder = createRowBuilder(request, context, isFieldEditable
? parentObjectId : null, allFields, collection);
-        write(request, collection, summary, rowBuilder, rowClasses);
+        write(request, collection, summary, rowBuilder, tableClass, rowClasses);
 
     }
 
@@ -95,10 +96,12 @@ public abstract class AbstractTableView 
             final String parent,
             final List<ObjectAssociation> allFields, ObjectAdapter collection);
 
-    public static void write(Request request, ObjectAdapter collection, String summary, TableContentWriter
rowBuilder, String[] rowClasses) {
+    public static void write(Request request, ObjectAdapter collection, String summary, TableContentWriter
rowBuilder, String tableClass, String[] rowClasses) {
         RequestContext context = request.getContext();
 
-        request.appendHtml("<table summary=\"" + summary + "\">");
+        String summarySegment = " summary=\"" + summary + "\"";
+        String classSegment = tableClass == null ? "" : (" class=\"" + tableClass + "\"");
+        request.appendHtml("<table" + classSegment + summarySegment + ">");
         rowBuilder.writeHeaders(request);
         rowBuilder.writeFooters(request);
 

Modified: incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/display/TableBuilder.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/display/TableBuilder.java?rev=1090803&r1=1090802&r2=1090803&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/display/TableBuilder.java
(original)
+++ incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/display/TableBuilder.java
Sun Apr 10 13:53:54 2011
@@ -42,6 +42,7 @@ public class TableBuilder extends Abstra
             ObjectAdapter collection) {
 
         final String variable = request.getOptionalProperty(ELEMENT_NAME, ELEMENT);
+        final String headerClass = request.getOptionalProperty("head-" + CLASS);
 
         final TableBlock block = new TableBlock();
         block.setCollection(collection);
@@ -57,7 +58,8 @@ public class TableBuilder extends Abstra
 
             @Override
             public void writeHeaders(PageWriter writer) {
-                writer.appendHtml("<thead>");
+                String headerSegment = headerClass == null ? "" : (" class=\"" + headerClass
+ "\"");
+                writer.appendHtml("<thead" + headerSegment + ">");
                 writer.appendHtml(headers);
                 writer.appendHtml("</thead>");
             }

Modified: incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/display/TableView.java
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/display/TableView.java?rev=1090803&r1=1090802&r2=1090803&view=diff
==============================================================================
--- incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/display/TableView.java
(original)
+++ incubator/isis/trunk/viewer/scimpi/dispatcher/src/main/java/org/apache/isis/viewer/scimpi/dispatcher/view/display/TableView.java
Sun Apr 10 13:53:54 2011
@@ -272,7 +272,7 @@ public class TableView extends AbstractT
         }
         RequestContext context = request.getContext();
         TableContentWriter rowBuilder = rowBuilder(request, context, context.mapObject(object,
Scope.REQUEST), field.getId(), fields);
-        write(request, collection, summary, rowBuilder, null);
+        write(request, collection, summary, rowBuilder, null, null);
     }
 
     @Override



Mime
View raw message