You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by tv...@apache.org on 2010/03/25 20:13:21 UTC

svn commit: r927546 - in /pivot/trunk/demos/src/org/apache/pivot/demos/roweditor: RowEditorDemo.java RowEditorDemo.json demo.wtkx

Author: tvolkert
Date: Thu Mar 25 19:13:21 2010
New Revision: 927546

URL: http://svn.apache.org/viewvc?rev=927546&view=rev
Log:
PIVOT-350 :: Change row editor demo to use Resources class, which is guaranteed to use UTF8 as the resources encoding.

Added:
    pivot/trunk/demos/src/org/apache/pivot/demos/roweditor/RowEditorDemo.json
Modified:
    pivot/trunk/demos/src/org/apache/pivot/demos/roweditor/RowEditorDemo.java
    pivot/trunk/demos/src/org/apache/pivot/demos/roweditor/demo.wtkx

Modified: pivot/trunk/demos/src/org/apache/pivot/demos/roweditor/RowEditorDemo.java
URL: http://svn.apache.org/viewvc/pivot/trunk/demos/src/org/apache/pivot/demos/roweditor/RowEditorDemo.java?rev=927546&r1=927545&r2=927546&view=diff
==============================================================================
--- pivot/trunk/demos/src/org/apache/pivot/demos/roweditor/RowEditorDemo.java (original)
+++ pivot/trunk/demos/src/org/apache/pivot/demos/roweditor/RowEditorDemo.java Thu Mar 25 19:13:21 2010
@@ -18,6 +18,7 @@ package org.apache.pivot.demos.roweditor
 
 import org.apache.pivot.collections.Map;
 import org.apache.pivot.collections.EnumList;
+import org.apache.pivot.util.Resources;
 import org.apache.pivot.wtk.Application;
 import org.apache.pivot.wtk.DesktopApplicationContext;
 import org.apache.pivot.wtk.Display;
@@ -41,7 +42,8 @@ public class RowEditorDemo implements Ap
     @Override
     public void startup(Display display, Map<String, String> properties)
         throws Exception {
-        WTKXSerializer wtkxSerializer = new WTKXSerializer();
+        Resources resources = new Resources(getClass().getName());
+        WTKXSerializer wtkxSerializer = new WTKXSerializer(resources);
         window = (Window)wtkxSerializer.readObject(this, "demo.wtkx");
         tableView = (TableView)wtkxSerializer.get("tableView");
 

Added: pivot/trunk/demos/src/org/apache/pivot/demos/roweditor/RowEditorDemo.json
URL: http://svn.apache.org/viewvc/pivot/trunk/demos/src/org/apache/pivot/demos/roweditor/RowEditorDemo.json?rev=927546&view=auto
==============================================================================
--- pivot/trunk/demos/src/org/apache/pivot/demos/roweditor/RowEditorDemo.json (added)
+++ pivot/trunk/demos/src/org/apache/pivot/demos/roweditor/RowEditorDemo.json Thu Mar 25 19:13:21 2010
@@ -0,0 +1,30 @@
+/*
+ * 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.
+ */
+{
+    title: "Row Editor Demo",
+
+    headers: {
+        date: "Date",
+        type: "Type",
+        amount: "Amount",
+        description: "Description"
+    },
+
+    formats: {
+        currency: "¤#,##0.00"
+    }
+}

Modified: pivot/trunk/demos/src/org/apache/pivot/demos/roweditor/demo.wtkx
URL: http://svn.apache.org/viewvc/pivot/trunk/demos/src/org/apache/pivot/demos/roweditor/demo.wtkx?rev=927546&r1=927545&r2=927546&view=diff
==============================================================================
--- pivot/trunk/demos/src/org/apache/pivot/demos/roweditor/demo.wtkx (original)
+++ pivot/trunk/demos/src/org/apache/pivot/demos/roweditor/demo.wtkx Thu Mar 25 19:13:21 2010
@@ -16,7 +16,7 @@ See the License for the specific languag
 limitations under the License.
 -->
 
-<Window title="Row Editor Demo"
+<Window title="%title"
     maximized="true"
     xmlns:wtkx="http://pivot.apache.org/wtkx"
     xmlns:collections="org.apache.pivot.collections"
@@ -30,14 +30,14 @@ limitations under the License.
                     <view>
                         <TableView wtkx:id="tableView" selectMode="single">
                             <columns>
-                                <TableView.Column name="date" width="87" headerData="Date"/>
-                                <TableView.Column name="type" width="125" headerData="Type"/>
-                                <TableView.Column name="amount" width="75" headerData="Amount">
+                                <TableView.Column name="date" width="87" headerData="%headers.date"/>
+                                <TableView.Column name="type" width="125" headerData="%headers.type"/>
+                                <TableView.Column name="amount" width="75" headerData="%headers.amount">
                                     <cellRenderer>
-                                        <content:TableViewNumberCellRenderer numberFormat="&#36;#,##0.00"/>
+                                        <content:TableViewNumberCellRenderer numberFormat="%formats.currency"/>
                                     </cellRenderer>
                                 </TableView.Column>
-                                <TableView.Column name="description" width="1*" headerData="Description" minimumWidth="150"/>
+                                <TableView.Column name="description" width="1*" headerData="%headers.description" minimumWidth="150"/>
                             </columns>
                             <tableData>
                                 <collections:ArrayList>