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 2010/09/24 21:43:56 UTC

svn commit: r1001051 - /pivot/trunk/wtk/src/org/apache/pivot/wtk/Component.java

Author: cbartlett
Date: Fri Sep 24 19:43:55 2010
New Revision: 1001051

URL: http://svn.apache.org/viewvc?rev=1001051&view=rev
Log:
PIVOT-607 - Reverted changes as discussed on dev mailing list

Modified:
    pivot/trunk/wtk/src/org/apache/pivot/wtk/Component.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=1001051&r1=1001050&r2=1001051&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/Component.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/Component.java Fri Sep 24 19:43:55 2010
@@ -676,28 +676,6 @@ public abstract class Component implemen
     // The component that currently has the focus
     private static Component focusedComponent = null;
 
-    // Decorator to apply to the focused component
-    private static Decorator focusDecorator = null;
-
-    // Focus change listener to manage adding & removing of focusDecorator
-    private static final ComponentClassListener FOCUS_CHANGE_LISTENER = new ComponentClassListener() {
-        @Override
-        public void focusedComponentChanged(Component previousFocusedComponent) {
-            Decorator decorator = Component.getFocusDecorator();
-            if (decorator != null) {
-                if (previousFocusedComponent != null
-                    && previousFocusedComponent.getDecorators().indexOf(decorator) > -1) {
-                    previousFocusedComponent.getDecorators().remove(decorator);
-                }
-                Component focusedComponent = Component.getFocusedComponent();
-                if (focusedComponent != null
-                    && focusedComponent.getDecorators().indexOf(decorator) == -1) {
-                    focusedComponent.getDecorators().add(decorator);
-                }
-            }
-        }
-    };
-
     // Typed and named styles
     private static HashMap<Class<? extends Component>, Map<String, ?>> typedStyles =
         new HashMap<Class<? extends Component>, Map<String,?>>();
@@ -2452,40 +2430,6 @@ public abstract class Component implemen
     }
 
     /**
-     * Returns the Decorator which is applied to all focused Components.
-     *
-     * @return The Decorator, or <tt>null</tt> if no Decorator has been set.
-     */
-    public static Decorator getFocusDecorator() {
-        return focusDecorator;
-    }
-
-    /**
-     * Set the Decorator to be applied to all focused Components.
-     *
-     * @param focusDecorator
-     */
-    public static void setFocusDecorator(Decorator focusDecorator) {
-        Component focusedComponent = getFocusedComponent();
-        Decorator previousFocusDecorator = Component.focusDecorator;
-        Component.focusDecorator = focusDecorator;
-        if (focusedComponent != null) {
-            if (previousFocusDecorator != null) {
-                focusedComponent.getDecorators().remove(previousFocusDecorator);
-            }
-            if (focusDecorator != null) {
-                focusedComponent.getDecorators().add(focusDecorator);
-            }
-        }
-        if (focusDecorator == null && previousFocusDecorator != null) {
-            Component.getComponentClassListeners().remove(FOCUS_CHANGE_LISTENER);
-        }
-        if (focusDecorator != null && previousFocusDecorator == null) {
-            Component.getComponentClassListeners().add(FOCUS_CHANGE_LISTENER);
-        }
-    }
-
-    /**
      * Copies bound values from the bind context to the component. This
      * functionality must be provided by the subclass; the base implementation
      * is a no-op.