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/08 21:47:30 UTC

svn commit: r907786 - in /pivot/trunk: tutorials/src/org/apache/pivot/tutorials/lists.wtkx wtk/src/org/apache/pivot/wtk/TableView.java wtk/src/org/apache/pivot/wtk/content/ListButtonDataRenderer.java

Author: gbrown
Date: Mon Feb  8 20:47:30 2010
New Revision: 907786

URL: http://svn.apache.org/viewvc?rev=907786&view=rev
Log:
Revert earlier addition of TableView#setColumns() (breaks WTKXSerializer as "columns" was no longer a read-only sequence); update ListButtonDataRenderer to paint non-selected data in gray.

Modified:
    pivot/trunk/tutorials/src/org/apache/pivot/tutorials/lists.wtkx
    pivot/trunk/wtk/src/org/apache/pivot/wtk/TableView.java
    pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ListButtonDataRenderer.java

Modified: pivot/trunk/tutorials/src/org/apache/pivot/tutorials/lists.wtkx
URL: http://svn.apache.org/viewvc/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/lists.wtkx?rev=907786&r1=907785&r2=907786&view=diff
==============================================================================
--- pivot/trunk/tutorials/src/org/apache/pivot/tutorials/lists.wtkx (original)
+++ pivot/trunk/tutorials/src/org/apache/pivot/tutorials/lists.wtkx Mon Feb  8 20:47:30 2010
@@ -123,7 +123,7 @@
                 <Form styles="{showFlagIcons:false, padding:0}">
                     <sections>
                         <Form.Section>
-                            <ListButton Form.label="Basic" selectedIndex="0">
+                            <ListButton Form.label="Basic" buttonData="Color">
                                 <listData>
                                     <collections:ArrayList>
                                         <content:ListItem text="Red"/>

Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/TableView.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/TableView.java?rev=907786&r1=907785&r2=907786&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/TableView.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/TableView.java Mon Feb  8 20:47:30 2010
@@ -1249,20 +1249,6 @@
     }
 
     /**
-     * Replaces the current set of columns with the given column sequence.
-     *
-     * @param columns
-     */
-    public void setColumns(Sequence<Column> columns) {
-        columnSequence.remove(0, columnSequence.getLength());
-
-        for (int i = 0, n = columns.getLength(); i < n; i++) {
-            Column column = columns.get(i);
-            columnSequence.add(column);
-        }
-    }
-
-    /**
      * Returns the table data.
      *
      * @return

Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ListButtonDataRenderer.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ListButtonDataRenderer.java?rev=907786&r1=907785&r2=907786&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ListButtonDataRenderer.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ListButtonDataRenderer.java Mon Feb  8 20:47:30 2010
@@ -18,6 +18,7 @@
 
 import org.apache.pivot.wtk.Button;
 import org.apache.pivot.wtk.HorizontalAlignment;
+import org.apache.pivot.wtk.ListButton;
 
 /**
  * Default list button data renderer.
@@ -42,5 +43,10 @@
         }
 
         super.render(data, button, highlight);
+
+        ListButton listButton = (ListButton)button;
+        if (listButton.getSelectedIndex() == -1) {
+            label.getStyles().put("color", button.getStyles().get("borderColor"));
+        }
     }
 }