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/08/11 20:21:16 UTC

svn commit: r984512 - in /pivot/trunk: wtk-terra/src/org/apache/pivot/wtk/skin/terra/ wtk/src/org/apache/pivot/wtk/skin/

Author: gbrown
Date: Wed Aug 11 18:21:15 2010
New Revision: 984512

URL: http://svn.apache.org/viewvc?rev=984512&view=rev
Log:
Additional minor fixes/optimizations related to PIVOT-548.

Modified:
    pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraSpinnerSkin.java
    pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraSuggestionPopupSkin.java
    pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme.java
    pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/ListButtonSkin.java

Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraSpinnerSkin.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraSpinnerSkin.java?rev=984512&r1=984511&r2=984512&view=diff
==============================================================================
--- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraSpinnerSkin.java (original)
+++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraSpinnerSkin.java Wed Aug 11 18:21:15 2010
@@ -858,6 +858,11 @@ public class TerraSpinnerSkin extends Co
     // SpinnerSelectionListener methods
     @Override
     public void selectedIndexChanged(Spinner spinner, int previousSelectedIndex) {
-        invalidateContent();
+        int selectedIndex = spinner.getSelectedIndex();
+
+        if (selectedIndex != previousSelectedIndex) {
+            // This was not an indirect selection change
+            invalidateContent();
+        }
     }
 }

Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraSuggestionPopupSkin.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraSuggestionPopupSkin.java?rev=984512&r1=984511&r2=984512&view=diff
==============================================================================
--- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraSuggestionPopupSkin.java (original)
+++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraSuggestionPopupSkin.java Wed Aug 11 18:21:15 2010
@@ -302,14 +302,18 @@ public class TerraSuggestionPopupSkin ex
     }
 
     @Override
-    public void selectedIndexChanged(SuggestionPopup suggestionPopup,
-        int previousSelectedIndex) {
-        TextInput textInput = suggestionPopup.getTextInput();
+    public void selectedIndexChanged(SuggestionPopup suggestionPopup, int previousSelectedIndex) {
+        int selectedIndex = suggestionPopup.getSelectedIndex();
 
-        Object suggestion = suggestionPopup.getSelectedSuggestion();
-        if (suggestion != null) {
-            ListView.ItemRenderer suggestionRenderer = suggestionPopup.getSuggestionRenderer();
-            textInput.setText(suggestionRenderer.toString(suggestion));
+        if (selectedIndex != previousSelectedIndex) {
+            // This was not an indirect selection change
+            TextInput textInput = suggestionPopup.getTextInput();
+
+            Object suggestion = suggestionPopup.getSelectedSuggestion();
+            if (suggestion != null) {
+                ListView.ItemRenderer suggestionRenderer = suggestionPopup.getSuggestionRenderer();
+                textInput.setText(suggestionRenderer.toString(suggestion));
+            }
         }
     }
 

Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme.java?rev=984512&r1=984511&r2=984512&view=diff
==============================================================================
--- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme.java (original)
+++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTheme.java Wed Aug 11 18:21:15 2010
@@ -168,7 +168,8 @@ public final class TerraTheme extends Th
         // Load the color scheme
         String location = null;
         try {
-            location = System.getProperty(LOCATION_PROPERTY);
+            String locationKey = getClass().getPackage().getName() + "." + LOCATION_PROPERTY;
+            location = System.getProperty(locationKey);
         } catch (SecurityException exception) {
             // No-op
         }

Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/ListButtonSkin.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/ListButtonSkin.java?rev=984512&r1=984511&r2=984512&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/ListButtonSkin.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/ListButtonSkin.java Wed Aug 11 18:21:15 2010
@@ -358,12 +358,14 @@ public abstract class ListButtonSkin ext
     // List button selection events
     @Override
     public void selectedIndexChanged(ListButton listButton, int previousSelectedIndex) {
-        // Set the selected item as the button data
         int selectedIndex = listButton.getSelectedIndex();
 
-        Object buttonData = (selectedIndex == -1) ? null : listButton.getListData().get(selectedIndex);
-        listButton.setButtonData(buttonData);
+        if (selectedIndex != previousSelectedIndex) {
+            // This was not an indirect selection change
+            Object buttonData = (selectedIndex == -1) ? null : listButton.getListData().get(selectedIndex);
+            listButton.setButtonData(buttonData);
 
-        listView.setSelectedIndex(selectedIndex);
+            listView.setSelectedIndex(selectedIndex);
+        }
     }
 }