myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lof...@apache.org
Subject svn commit: r929432 - in /myfaces/tobago/trunk/example: data/src/main/java/org/apache/myfaces/tobago/example/data/ test/src/main/java/org/apache/myfaces/tobago/example/test/ test/src/main/webapp/tc/sheet/
Date Wed, 31 Mar 2010 08:43:18 GMT
Author: lofwyr
Date: Wed Mar 31 08:43:18 2010
New Revision: 929432

URL: http://svn.apache.org/viewvc?rev=929432&view=rev
Log:
Sample data for Sheet

Added:
    myfaces/tobago/trunk/example/data/src/main/java/org/apache/myfaces/tobago/example/data/LocaleEntry.java
    myfaces/tobago/trunk/example/data/src/main/java/org/apache/myfaces/tobago/example/data/LocaleList.java
    myfaces/tobago/trunk/example/test/src/main/webapp/tc/sheet/sheet-large.xhtml
      - copied, changed from r929063, myfaces/tobago/trunk/example/test/src/main/webapp/tc/sheet/sheet-simple.xhtml
Modified:
    myfaces/tobago/trunk/example/test/src/main/java/org/apache/myfaces/tobago/example/test/SheetController.java
    myfaces/tobago/trunk/example/test/src/main/webapp/tc/sheet/sheet-simple.xhtml

Added: myfaces/tobago/trunk/example/data/src/main/java/org/apache/myfaces/tobago/example/data/LocaleEntry.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/data/src/main/java/org/apache/myfaces/tobago/example/data/LocaleEntry.java?rev=929432&view=auto
==============================================================================
--- myfaces/tobago/trunk/example/data/src/main/java/org/apache/myfaces/tobago/example/data/LocaleEntry.java
(added)
+++ myfaces/tobago/trunk/example/data/src/main/java/org/apache/myfaces/tobago/example/data/LocaleEntry.java
Wed Mar 31 08:43:18 2010
@@ -0,0 +1,67 @@
+package org.apache.myfaces.tobago.example.data;
+
+/*
+ * 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.
+ */
+
+import java.util.Locale;
+
+public class LocaleEntry {
+
+  private Locale locale;
+  private Locale displayLocale;
+  private String country;
+  private String language;
+
+  public LocaleEntry(Locale locale, Locale displayLocale) {
+    this.locale = locale;
+    this.displayLocale = displayLocale;
+    country = locale.getDisplayCountry(displayLocale);
+    language = locale.getDisplayLanguage(displayLocale);
+  }
+
+  public Locale getLocale() {
+    return locale;
+  }
+
+  public void setLocale(Locale locale) {
+    this.locale = locale;
+  }
+
+  public Locale getDisplayLocale() {
+    return displayLocale;
+  }
+
+  public void setDisplayLocale(Locale displayLocale) {
+    this.displayLocale = displayLocale;
+  }
+
+  public String getCountry() {
+    return country;
+  }
+
+  public void setCountry(String country) {
+    this.country = country;
+  }
+
+  public String getLanguage() {
+    return language;
+  }
+
+  public void setLanguage(String language) {
+    this.language = language;
+  }
+}

Added: myfaces/tobago/trunk/example/data/src/main/java/org/apache/myfaces/tobago/example/data/LocaleList.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/data/src/main/java/org/apache/myfaces/tobago/example/data/LocaleList.java?rev=929432&view=auto
==============================================================================
--- myfaces/tobago/trunk/example/data/src/main/java/org/apache/myfaces/tobago/example/data/LocaleList.java
(added)
+++ myfaces/tobago/trunk/example/data/src/main/java/org/apache/myfaces/tobago/example/data/LocaleList.java
Wed Mar 31 08:43:18 2010
@@ -0,0 +1,32 @@
+package org.apache.myfaces.tobago.example.data;
+
+/*
+ * 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.
+ */
+
+import java.util.ArrayList;
+import java.util.Locale;
+
+public class LocaleList extends ArrayList<LocaleEntry> {
+
+  {
+    for (Locale displayLocale : Locale.getAvailableLocales()) {
+      for (Locale locale : Locale.getAvailableLocales()) {
+        add(new LocaleEntry(locale, displayLocale));
+      }
+    }
+  }
+}

Modified: myfaces/tobago/trunk/example/test/src/main/java/org/apache/myfaces/tobago/example/test/SheetController.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/test/src/main/java/org/apache/myfaces/tobago/example/test/SheetController.java?rev=929432&r1=929431&r2=929432&view=diff
==============================================================================
--- myfaces/tobago/trunk/example/test/src/main/java/org/apache/myfaces/tobago/example/test/SheetController.java
(original)
+++ myfaces/tobago/trunk/example/test/src/main/java/org/apache/myfaces/tobago/example/test/SheetController.java
Wed Mar 31 08:43:18 2010
@@ -17,13 +17,20 @@ package org.apache.myfaces.tobago.exampl
  * limitations under the License.
  */
 
+import org.apache.myfaces.tobago.example.data.LocaleList;
 import org.apache.myfaces.tobago.example.data.SolarObject;
 
 public class SheetController {
   
   private SolarObject[] solarArray = SolarObject.getArray();
 
+  private LocaleList localeList = new LocaleList();
+
   public SolarObject[] getSolarArray() {
     return solarArray;
   }
+
+  public LocaleList getLocaleList() {
+    return localeList;
+  }
 }

Copied: myfaces/tobago/trunk/example/test/src/main/webapp/tc/sheet/sheet-large.xhtml (from
r929063, myfaces/tobago/trunk/example/test/src/main/webapp/tc/sheet/sheet-simple.xhtml)
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/test/src/main/webapp/tc/sheet/sheet-large.xhtml?p2=myfaces/tobago/trunk/example/test/src/main/webapp/tc/sheet/sheet-large.xhtml&p1=myfaces/tobago/trunk/example/test/src/main/webapp/tc/sheet/sheet-simple.xhtml&r1=929063&r2=929432&rev=929432&view=diff
==============================================================================
--- myfaces/tobago/trunk/example/test/src/main/webapp/tc/sheet/sheet-simple.xhtml (original)
+++ myfaces/tobago/trunk/example/test/src/main/webapp/tc/sheet/sheet-large.xhtml Wed Mar 31
08:43:18 2010
@@ -10,19 +10,25 @@
   <tc:page>
     <tc:gridLayoutConstraint width="600px" height="600px"/>
 
-    <tc:sheet value="#{sheet.solarArray}" id="sheet" columns="*;*" var="luminary" rows="5"
+    <tc:sheet value="#{sheet.localeList}" id="sheet" columns="*;*;*;*" var="entry" rows="600"
         showRowRange="left" showPageRange="right" showDirectLinks="center">
-      <tc:column label="Name" id="name">
-        <tc:out value="#{luminary.name}"/>
+      <tc:column label="Locale" id="l" sortable="true">
+        <tc:out value="#{entry.locale}"/>
       </tc:column>
-      <tc:column label="Orbit Of" id="orbit">
-        <tc:out value="#{luminary.orbit}"/>
+      <tc:column label="Display Locale" id="d" sortable="true">
+        <tc:out value="#{entry.displayLocale}"/>
+      </tc:column>
+      <tc:column label="Country" id="c" sortable="true">
+        <tc:out value="#{entry.country}"/>
+      </tc:column>
+      <tc:column label="Language" id="a" sortable="true">
+        <tc:out value="#{entry.language}"/>
       </tc:column>
     </tc:sheet>
 
     <tc:script file="script/test-utils.js"/>
     <!--todo-->
-    <tc:script onload="checkLayout('page:todo', 0, 0, 600, 14);"/>
+    <!--<tc:script onload="checkLayout('page:todo', 0, 0, 600, 14);"/>-->
 
   </tc:page>
 </f:view>

Modified: myfaces/tobago/trunk/example/test/src/main/webapp/tc/sheet/sheet-simple.xhtml
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/example/test/src/main/webapp/tc/sheet/sheet-simple.xhtml?rev=929432&r1=929431&r2=929432&view=diff
==============================================================================
--- myfaces/tobago/trunk/example/test/src/main/webapp/tc/sheet/sheet-simple.xhtml (original)
+++ myfaces/tobago/trunk/example/test/src/main/webapp/tc/sheet/sheet-simple.xhtml Wed Mar
31 08:43:18 2010
@@ -12,7 +12,7 @@
 
     <tc:sheet value="#{sheet.solarArray}" id="sheet" columns="*;*" var="luminary" rows="5"
         showRowRange="left" showPageRange="right" showDirectLinks="center">
-      <tc:column label="Name" id="name">
+      <tc:column label="Name" id="name" sortable="true">
         <tc:out value="#{luminary.name}"/>
       </tc:column>
       <tc:column label="Orbit Of" id="orbit">
@@ -22,7 +22,7 @@
 
     <tc:script file="script/test-utils.js"/>
     <!--todo-->
-    <tc:script onload="checkLayout('page:todo', 0, 0, 600, 14);"/>
+    <!--<tc:script onload="checkLayout('page:todo', 0, 0, 600, 14);"/>-->
 
   </tc:page>
 </f:view>



Mime
View raw message