Author: gbrown
Date: Thu May 19 22:37:41 2011
New Revision: 1125147

URL: http://svn.apache.org/viewvc?rev=1125147&view=rev
Log:
Apply patch for issue PIVOT-746.

Modified:
    pivot/trunk/build.xml
    pivot/trunk/tests/src/org/apache/pivot/tests/issues/pivot_734.bxml
    pivot/trunk/tests/src/org/apache/pivot/tests/multiple_selection_table.bxml
    pivot/trunk/wtk/src/org/apache/pivot/wtk/ApplicationContext.java

Modified: pivot/trunk/build.xml
URL: 
http://svn.apache.org/viewvc/pivot/trunk/build.xml?rev=1125147&r1=1125146&r2=1125147&view=diff
==============================================================================
--- pivot/trunk/build.xml (original)
+++ pivot/trunk/build.xml Thu May 19 22:37:41 2011
@@ -221,6 +221,9 @@ limitations under the License.
                     <exclude name="**/*.java"/>
                     <exclude name="**/package.html"/>
                 </fileset>
+                <fileset dir=".">
+                    <include name="build.properties"/>
+                </fileset>
             </jar>
         </sequential>
     </macrodef>

Modified: pivot/trunk/tests/src/org/apache/pivot/tests/issues/pivot_734.bxml
URL: 
http://svn.apache.org/viewvc/pivot/trunk/tests/src/org/apache/pivot/tests/issues/pivot_734.bxml?rev=1125147&r1=1125146&r2=1125147&view=diff
==============================================================================
--- pivot/trunk/tests/src/org/apache/pivot/tests/issues/pivot_734.bxml 
(original)
+++ pivot/trunk/tests/src/org/apache/pivot/tests/issues/pivot_734.bxml Thu May 
19 22:37:41 2011
@@ -26,10 +26,10 @@ limitations under the License.
 
       <BoxPane orientation="horizontal">
         <BoxPane orientation="vertical">
-             <BoxPane orientation="horizontal">
-             <PushButton bxml:id="treeButtonAdd"    buttonData="add"/>
-                 <PushButton bxml:id="treeButtonRemove" buttonData="remove"/>
-                 </BoxPane>
+          <BoxPane orientation="horizontal">
+              <PushButton bxml:id="treeButtonAdd"    buttonData="add"/>
+              <PushButton bxml:id="treeButtonRemove" buttonData="remove"/>
+          </BoxPane>
           <ScrollPane horizontalScrollBarPolicy="fill_to_capacity">
               <!--
               <TreeView bxml:id="tree" styles="{}">

Modified: 
pivot/trunk/tests/src/org/apache/pivot/tests/multiple_selection_table.bxml
URL: 
http://svn.apache.org/viewvc/pivot/trunk/tests/src/org/apache/pivot/tests/multiple_selection_table.bxml?rev=1125147&r1=1125146&r2=1125147&view=diff
==============================================================================
--- pivot/trunk/tests/src/org/apache/pivot/tests/multiple_selection_table.bxml 
(original)
+++ pivot/trunk/tests/src/org/apache/pivot/tests/multiple_selection_table.bxml 
Thu May 19 22:37:41 2011
@@ -37,41 +37,41 @@ limitations under the License.
         <TablePane.Row height="1*">
             <Border styles="{color:10}">
                 <ScrollPane horizontalScrollBarPolicy="fill_to_capacity">
-                                       <TableView bxml:id="dataTableView" 
selectMode="multi">
-                                           <columns>
-                                               <TableView.Column name="i" 
width="75"/>
-                                               <TableView.Column name="a" 
width="75"/>
-                                               <TableView.Column name="b" 
width="75"/>
-                                               <TableView.Column name="c" 
width="75"/>
-                                               <TableView.Column name="d" 
width="1*"/>
-                                           </columns>
-                                           <componentListeners>
-                                               <![CDATA[
-                                               
importClass(org.apache.pivot.collections.ArrayList);
-                                               
importClass(org.apache.pivot.collections.HashMap);
-                                       
-                                               function 
parentChanged(component, previousParent) {
-                                                   if (component.getParent() 
!= null) {
-                                                       var tableData = new 
ArrayList();
-                                       
-                                                       for (var i = 0; i < 20; 
i++) {
-                                                           var row = new 
HashMap();
-                                                           row.put("i", new 
String(i));
-                                                           row.put("a", new 
String(Math.floor(Math.random() * 100)));
-                                                           row.put("b", new 
String(Math.floor(Math.random() * 1000)));
-                                                           row.put("c", new 
String(Math.floor(Math.random() * 10000)));
-                                                           tableData.add(row);
-                                                       }
-                                       
-                                                       
component.setTableData(tableData);
-                                                   }
-                                               }
+                    <TableView bxml:id="dataTableView" selectMode="multi">
+                        <columns>
+                            <TableView.Column name="i" width="75"/>
+                            <TableView.Column name="a" width="75"/>
+                            <TableView.Column name="b" width="75"/>
+                            <TableView.Column name="c" width="75"/>
+                            <TableView.Column name="d" width="1*"/>
+                        </columns>
+                        <componentListeners>
+                            <![CDATA[
+                            
importClass(org.apache.pivot.collections.ArrayList);
+                            importClass(org.apache.pivot.collections.HashMap);
 
-                               function selectedRangesChanged(viewComponent, 
previousSelectedElements) {
-                                   selectionListView.listData = new 
ArrayList(viewComponent.selectedRanges);
-                               }
-                                               ]]>
-                                           </componentListeners>
+                            function parentChanged(component, previousParent) {
+                                if (component.getParent() != null) {
+                                    var tableData = new ArrayList();
+
+                                    for (var i = 0; i < 20; i++) {
+                                        var row = new HashMap();
+                                        row.put("i", new String(i));
+                                        row.put("a", new 
String(Math.floor(Math.random() * 100)));
+                                        row.put("b", new 
String(Math.floor(Math.random() * 1000)));
+                                        row.put("c", new 
String(Math.floor(Math.random() * 10000)));
+                                        tableData.add(row);
+                                    }
+
+                                    component.setTableData(tableData);
+                                }
+                            }
+
+                            function selectedRangesChanged(viewComponent, 
previousSelectedElements) {
+                                selectionListView.listData = new 
ArrayList(viewComponent.selectedRanges);
+                            }
+                            ]]>
+                        </componentListeners>
 
                         <tableViewSelectionListeners>
                         importPackage(org.apache.pivot.collections);
@@ -79,7 +79,7 @@ limitations under the License.
                             selectionListView.listData = new 
ArrayList(viewComponent.selectedRanges);
                         }
                         </tableViewSelectionListeners>
-                                       </TableView>
+                    </TableView>
                 </ScrollPane>
             </Border>
             <Border styles="{color:10}">

Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/ApplicationContext.java
URL: 
http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/ApplicationContext.java?rev=1125147&r1=1125146&r2=1125147&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/ApplicationContext.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/ApplicationContext.java Thu May 19 
22:37:41 2011
@@ -49,6 +49,7 @@ import java.net.URI;
 import java.net.URISyntaxException;
 import java.net.URL;
 import java.util.Iterator;
+import java.util.Properties;
 import java.util.Random;
 import java.util.Timer;
 import java.util.TimerTask;
@@ -1508,9 +1509,18 @@ public abstract class ApplicationContext
     private static ResourceCacheDictionary resourceCacheDictionary = new 
ResourceCacheDictionary();
 
     private static Version jvmVersion = null;
+    private static Version pivotVersion = null;
 
     static {
         jvmVersion = Version.decode(System.getProperty("java.vm.version"));
+        try {
+            Properties buildProperties = new Properties();
+            
buildProperties.load(ApplicationContext.class.getClassLoader().getResourceAsStream("build.properties"));
+            pivotVersion = 
Version.decode(buildProperties.getProperty("version"));
+        }
+        catch (IOException ioe) {
+            throw new RuntimeException(ioe);
+        }
     }
 
     /**
@@ -1598,6 +1608,17 @@ public abstract class ApplicationContext
     }
 
     /**
+     * Returns the current Pivot version.
+     *
+     * @return
+     * The current Pivot version (determined at build time), or <tt>null</tt>
+     * if the version can't be determined.
+     */
+    public static Version getPivotVersion() {
+        return pivotVersion;
+    }
+
+    /**
      * Schedules a task for one-time execution. The task will be executed on
      * the UI thread.
      *


Reply via email to