You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by cb...@apache.org on 2011/08/12 20:40:26 UTC

svn commit: r1157209 - in /pivot/trunk/wtk/src/org/apache/pivot/wtk: Component.java ComponentStyleListener.java

Author: cbartlett
Date: Fri Aug 12 18:40:25 2011
New Revision: 1157209

URL: http://svn.apache.org/viewvc?rev=1157209&view=rev
Log:
Updated javadocs to clarify the 'previousValue' of the ComponentStyleListener#styleUpdated event

Modified:
    pivot/trunk/wtk/src/org/apache/pivot/wtk/Component.java
    pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentStyleListener.java

Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/Component.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/Component.java?rev=1157209&r1=1157208&r2=1157209&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/Component.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/Component.java Fri Aug 12 18:40:25 2011
@@ -58,6 +58,26 @@ public abstract class Component implemen
             return styles.get(key);
         }
 
+        /**
+         * Stores the supplied value for the specified style.</br></br>
+         *
+         * <strong>NOTE</strong> The current implementation always returns
+         * <code>null</code> due to the use of BeanAdapter to set the the new
+         * value. (BeanAdapter does not look up the previous value for
+         * performance reasons)</br></br>
+         *
+         * This also means that the logic determining whether to fire the the
+         * event differs from other Pivot event firing code.  The event will be
+         * fired each time this method is executed, regardless of whether the
+         * new value differs from the old value or not.</br></br>
+         *
+         * This behaviour may change in the future so should not be relied upon.
+         *
+         * @param key Style whose value will be overwritten
+         * @param value Value to be stored
+         * @return The previous value of the specified style (See note above)
+         * @see BeanAdapter#put(String, Object)
+         */
         @Override
         public Object put(String key, Object value) {
             Object previousValue = null;

Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentStyleListener.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentStyleListener.java?rev=1157209&r1=1157208&r2=1157209&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentStyleListener.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentStyleListener.java Fri Aug 12 18:40:25 2011
@@ -23,9 +23,11 @@ public interface ComponentStyleListener 
     /**
      * Called when a component style has been updated.
      *
-     * @param component
-     * @param styleKey
-     * @param previousValue
+     * @param component Component the style belongs to
+     * @param styleKey The name of the style
+     * @param previousValue The previous value for this style
+     *
+     * @see org.apache.pivot.wtk.Component.StyleDictionary#put(String, Object)
      */
     public void styleUpdated(Component component, String styleKey, Object previousValue);
 }