You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by gb...@apache.org on 2010/02/24 17:11:35 UTC

svn commit: r915844 - /pivot/trunk/tutorials/www/stock-tracker.ui.xml

Author: gbrown
Date: Wed Feb 24 16:11:34 2010
New Revision: 915844

URL: http://svn.apache.org/viewvc?rev=915844&view=rev
Log:
Remove old references to TableView.SortHandler.

Modified:
    pivot/trunk/tutorials/www/stock-tracker.ui.xml

Modified: pivot/trunk/tutorials/www/stock-tracker.ui.xml
URL: http://svn.apache.org/viewvc/pivot/trunk/tutorials/www/stock-tracker.ui.xml?rev=915844&r1=915843&r2=915844&view=diff
==============================================================================
--- pivot/trunk/tutorials/www/stock-tracker.ui.xml (original)
+++ pivot/trunk/tutorials/www/stock-tracker.ui.xml Wed Feb 24 16:11:34 2010
@@ -348,11 +348,7 @@
 
         <source type="xml">
             <![CDATA[
-            <TableViewHeader tableView="$stocksTableView">
-                <tableViewHeaderPressListeners>
-                    <TableView.SortHandler/>
-                </tableViewHeaderPressListeners>
-            </TableViewHeader>
+            <TableViewHeader tableView="$stocksTableView" sortMode="single_column"/>
             ]]>
         </source>
 
@@ -363,11 +359,24 @@
         </p>
 
         <p>
-            Note that an instance of <tt>TableView.SortHandler</tt> is added as a header press
-            listener on the table view header. This class can be used to provide default sorting
-            behavior in response to a column header click.
+            Note that <tt>TableViewHeader</tt> does not automatically perform sorting. Sorting
+            is implemented in response to a <tt>sortChanged()</tt> event fired by the
+            <tt>TableView</tt> itself. An example is shown below:
         </p>
 
+        <source type="java">
+            <![CDATA[
+            stocksTableView.getTableViewSortListeners().add(new TableViewSortListener.Adapter() {
+                @Override
+                @SuppressWarnings("unchecked")
+                public void sortChanged(TableView tableView) {
+                    List<Object> tableData = (List<Object>)tableView.getTableData();
+                    tableData.setComparator(new TableViewRowComparator(tableView));
+                }
+            });
+            ]]>
+        </source>
+
         <h3>ScrollPane</h3>
 
         <p>