You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2011/02/15 14:56:22 UTC

svn commit: r1070900 - in /myfaces/tobago/trunk/tobago-example: tobago-example-data/src/main/java/org/apache/myfaces/tobago/example/data/ tobago-example-demo/src/main/webapp/WEB-INF/ tobago-example-demo/src/main/webapp/overview/ tobago-example-demo/src...

Author: lofwyr
Date: Tue Feb 15 13:56:22 2011
New Revision: 1070900

URL: http://svn.apache.org/viewvc?rev=1070900&view=rev
Log:
Example for markup in a sheet

Added:
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/style/
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/style/style.css
Modified:
    myfaces/tobago/trunk/tobago-example/tobago-example-data/src/main/java/org/apache/myfaces/tobago/example/data/SolarObject.java
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/tobago-config.xml
    myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/overview/sheet.xhtml

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-data/src/main/java/org/apache/myfaces/tobago/example/data/SolarObject.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-data/src/main/java/org/apache/myfaces/tobago/example/data/SolarObject.java?rev=1070900&r1=1070899&r2=1070900&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-data/src/main/java/org/apache/myfaces/tobago/example/data/SolarObject.java (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-data/src/main/java/org/apache/myfaces/tobago/example/data/SolarObject.java Tue Feb 15 13:56:22 2011
@@ -65,6 +65,18 @@ public class SolarObject {
     this.name = name;
   }
 
+  public String getMarkup() {
+    if (name.equals("Sun")) {
+      return "sun";
+    } else {
+      if (orbit.equals("Sun")) {
+        return "planet";
+      } else {
+        return "moon";
+      }
+    }
+  }
+
   public String getNumber() {
     return number;
   }

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/tobago-config.xml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/tobago-config.xml?rev=1070900&r1=1070899&r2=1070900&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/tobago-config.xml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/WEB-INF/tobago-config.xml Tue Feb 15 13:56:22 2011
@@ -33,6 +33,33 @@
   <resource-dir>tobago-resource</resource-dir>
 
   <renderers>
+
+    <renderer>
+      <name>Sheet</name>
+      <supported-markup>
+        <markup>sun</markup>
+        <markup>planet</markup>
+        <markup>moon</markup>
+        <!--
+         XXX this is here, because in the moment, the list will be replaced and not be added.
+         XXX this may change in the future. -->
+        <!-- internal: for the paging buttons -->
+        <markup>disabled</markup>
+        <!-- internal: for the header -->
+        <markup>resizable</markup>
+        <!-- for the rows -->
+        <markup>odd</markup>
+        <markup>even</markup>
+        <!-- for the cells -->
+        <markup>clickable</markup>
+        <markup>first</markup>
+        <!-- internal: for the paging fields -->
+        <markup>left</markup>
+        <markup>center</markup>
+        <markup>right</markup>
+      </supported-markup>
+    </renderer>
+
     <renderer>
       <name>SelectOneChoice</name>
       <supported-markup>
@@ -43,5 +70,7 @@
         <markup>error</markup>
       </supported-markup>
     </renderer>
+
   </renderers>
+
 </tobago-config>

Modified: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/overview/sheet.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/overview/sheet.xhtml?rev=1070900&r1=1070899&r2=1070900&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/overview/sheet.xhtml (original)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/overview/sheet.xhtml Tue Feb 15 13:56:22 2011
@@ -144,7 +144,7 @@
         <tc:reload frequency="2000" />
       </f:facet>
 -->
-      <tc:column label="#{overviewBundle.solarArrayName}" id="name" sortable="true">
+      <tc:column label="#{overviewBundle.solarArrayName}" id="name" sortable="true" markup="#{luminary.markup}">
         <tc:out value="#{luminary.name}" id="t_name"/>
       </tc:column>
       <tc:column label="#{overviewBundle.solarArrayNumber}" id="number" sortable="false" resizable="false"

Added: myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/style/style.css
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/style/style.css?rev=1070900&view=auto
==============================================================================
--- myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/style/style.css (added)
+++ myfaces/tobago/trunk/tobago-example/tobago-example-demo/src/main/webapp/style/style.css Tue Feb 15 13:56:22 2011
@@ -0,0 +1,28 @@
+/*
+ * 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.
+ */
+
+.tobago-sheet-cell-markup-sun {
+  background-color: #fffacd;
+}
+
+.tobago-sheet-cell-markup-planet {
+  background-color: #ffb6c1;
+}
+
+.tobago-sheet-cell-markup-moon {
+  background-color: #6495ed;
+}