You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by Noel Grandin <no...@gmail.com> on 2009/08/06 13:16:58 UTC

reducing container APIs

Hi

I've always felt uncomfortable with the degree of access that user code
has to a Container's child Components.

So I borrowed a trick from the Object Capability guys and came up with
the following patch.

Basically, what it does it to hand a special object to the Skin class so
that it has privileged access to the Container's children.

In this way, Container subclasses can decide for themselves what degree
of access they wish to permit to user code.

Comments?

Regards, Noel.

Re: reducing container APIs

Posted by Greg Brown <gk...@mac.com>.
I definitely see the argument for it. But we actually went down a  
similar path a long time ago and decided that it just wasn't worth the  
additional effort. Bottom line is, if you didn't add a component to a  
container, you probably shouldn't remove it.

On Aug 6, 2009, at 8:26 AM, Noel Grandin wrote:

> Hi
>
> Yeah, but it's also a design principle to only expose what you WANT to
> expose and are prepared to support.
>
> For myself, I frequently design custom Swing components where I  
> override
> addImpl() and setLayout() to prevent anyone from messing with my  
> components.
> Very important when your code is used by a variety of people who do
> crazy stuff (often unintentionally).
>
> With the code I posted, people could still subclass stuff and get at  
> the
> internals, but that way, they are more obviously at fault when  
> something
> goes wrong.
>
> Anyhow, just another idea, I'm not worried about it being rejected :-)
>
> Regards, Noel.
>
> Greg Brown wrote:
>> It's an interesting idea for sure. But, to me, it seems just a bit
>> over-designed. There are lots of different ways a careless developer
>> might shoot himself in the foot. We can't protect developers from
>> absolutely every potential for code misuse.
>>
>> We also try not to impose too many restrictions on developers. Yes,  
>> it
>> incurs more potential for error, but it also maximizes flexibility.  
>> So
>> I would not be in favor of this change.
>>
>> G
>>
>>
>> On Aug 6, 2009, at 7:16 AM, Noel Grandin wrote:
>>
>>> Hi
>>>
>>> I've always felt uncomfortable with the degree of access that user
>>> code has to a Container's child Components.
>>>
>>> So I borrowed a trick from the Object Capability guys and came up
>>> with the following patch.
>>>
>>> Basically, what it does it to hand a special object to the Skin  
>>> class
>>> so that it has privileged access to the Container's children.
>>>
>>> In this way, Container subclasses can decide for themselves what
>>> degree of access they wish to permit to user code.
>>>
>>> Comments?
>>>
>>> Regards, Noel.
>>>
>>> Property changes on: .
>>> ___________________________________________________________________
>>> Added: svn:ignore
>>>  + .classpath
>>> .project
>>> baseline.june8.2.patch
>>> baseline.june8.patch
>>> baseline.june9.2.patch
>>> baseline.june9.patch
>>> .settings
>>>
>>>
>>> Index:
>>> tutorials/src/org/apache/pivot/tutorials/transition/Transitions.java
>>> ===================================================================
>>> ---
>>> tutorials/src/org/apache/pivot/tutorials/transition/Transitions.java
>>> (revision 801535)
>>> +++
>>> tutorials/src/org/apache/pivot/tutorials/transition/Transitions.java
>>> (working copy)
>>> @@ -18,6 +18,7 @@
>>>
>>> import org.apache.pivot.collections.Map;
>>> import org.apache.pivot.wtk.Application;
>>> +import org.apache.pivot.wtk.BoxPane;
>>> import org.apache.pivot.wtk.Button;
>>> import org.apache.pivot.wtk.ButtonPressListener;
>>> import org.apache.pivot.wtk.Component;
>>> @@ -61,7 +62,7 @@
>>>
>>>                            if (!transition.isReversed()) {
>>>                                Component component =
>>> collapseTransition.getComponent();
>>> -
>>> component.getParent().remove(component);
>>> +
>>> ((BoxPane)component.getParent()).remove(component);
>>>                            }
>>>
>>>                            Transitions.this.collapseTransition =  
>>> null;
>>> Index: wtk/src/org/apache/pivot/wtk/BoxPane.java
>>> ===================================================================
>>> --- wtk/src/org/apache/pivot/wtk/BoxPane.java    (revision 801535)
>>> +++ wtk/src/org/apache/pivot/wtk/BoxPane.java    (working copy)
>>> @@ -24,7 +24,7 @@
>>> *
>>> * @author gbrown
>>> */
>>> -public class BoxPane extends Container {
>>> +public class BoxPane extends SequenceContainer {
>>>    private static class BoxPaneListenerList extends
>>> ListenerList<BoxPaneListener>
>>>        implements BoxPaneListener {
>>>        public void orientationChanged(BoxPane boxPane) {
>>> Index: wtk/src/org/apache/pivot/wtk/CardPane.java
>>> ===================================================================
>>> --- wtk/src/org/apache/pivot/wtk/CardPane.java    (revision 801535)
>>> +++ wtk/src/org/apache/pivot/wtk/CardPane.java    (working copy)
>>> @@ -27,7 +27,7 @@
>>> *
>>> * @author gbrown
>>> */
>>> -public class CardPane extends Container {
>>> +public class CardPane extends SequenceContainer {
>>>    private static class CardPaneListenerList extends
>>> ListenerList<CardPaneListener>
>>>        implements CardPaneListener {
>>>        public Vote previewSelectedIndexChange(CardPane cardPane, int
>>> selectedIndex) {
>>> Index: wtk/src/org/apache/pivot/wtk/Container.java
>>> ===================================================================
>>> --- wtk/src/org/apache/pivot/wtk/Container.java    (revision 801535)
>>> +++ wtk/src/org/apache/pivot/wtk/Container.java    (working copy)
>>> @@ -46,8 +46,55 @@
>>> *
>>> * @author gbrown
>>> */
>>> -public abstract class Container extends Component
>>> -    implements Sequence<Component>, Iterable<Component> {
>>> +public abstract class Container extends Component {
>>> +
>>> +    /**
>>> +     * This class is used to give privileged access to the children
>>> of the container to the skin class.
>>> +     * (an example of the Object Capability pattern).
>>> +     *
>>> +     * Subclasses of container normally want finer control over how
>>> they expose their children, so they
>>> +     * can define more specific methods for setting/modifying  
>>> children.
>>> +     *
>>> +     * @author Noel Grandin
>>> +     */
>>> +    public final class ContainerChildAccess implements
>>> Sequence<Component>, Iterable<Component> {
>>> +        public Component update(int index, Component component) {
>>> +            return Container.this.update(index, component);
>>> +        }
>>> +
>>> +        public int indexOf(Component component) {
>>> +            return Container.this.indexOf(component);
>>> +        }
>>> +
>>> +        public final int remove(Component component) {
>>> +            return Container.this.remove(component);
>>> +        }
>>> +
>>> +        public Sequence<Component> remove(int index, int count) {
>>> +            return Container.this.remove(index, count);
>>> +        }
>>> +
>>> +        public int getLength() {
>>> +            return Container.this.getLength();
>>> +        }
>>> +
>>> +        public final int add(Component component) {
>>> +            return Container.this.add(component);
>>> +        }
>>> +
>>> +        public Component get(int index) {
>>> +            return Container.this.get(index);
>>> +        }
>>> +
>>> +        public void insert(Component component, int index) {
>>> +            Container.this.insert(component, index);
>>> +        }
>>> +
>>> +        public Iterator<Component> iterator() {
>>> +            return Container.this.iterator();
>>> +        }
>>> +    }
>>> +
>>>    private static class ContainerListenerList extends
>>> ListenerList<ContainerListener>
>>>        implements ContainerListener {
>>>        public void componentInserted(Container container, int  
>>> index) {
>>> @@ -134,15 +181,31 @@
>>>
>>>    private ContainerListenerList containerListeners = new
>>> ContainerListenerList();
>>>    private ContainerMouseListenerList containerMouseListeners = new
>>> ContainerMouseListenerList();
>>> +    private final ContainerChildAccess containerChildAccess = new
>>> ContainerChildAccess();
>>> +
>>> +    /**
>>> +     * Sets the skin, replacing any previous skin.
>>> +     *
>>> +     * @param skin
>>> +     * The new skin.
>>> +     */
>>> +    protected final void
>>> setSkin(org.apache.pivot.wtk.skin.ContainerSkin skin) {
>>> +        super.setSkin(skin);
>>> +
>>> +        skin.install(this, containerChildAccess);
>>>
>>> -    public final int add(Component component) {
>>> +        invalidate();
>>> +        repaint();
>>> +    }
>>> +
>>> +    protected int add(Component component) {
>>>        int i = getLength();
>>>        insert(component, i);
>>>
>>>        return i;
>>>    }
>>>
>>> -    public void insert(Component component, int index) {
>>> +    protected void insert(Component component, int index) {
>>>        if (component == null) {
>>>            throw new IllegalArgumentException("component is null.");
>>>        }
>>> @@ -167,11 +230,11 @@
>>>        containerListeners.componentInserted(Container.this, index);
>>>    }
>>>
>>> -    public Component update(int index, Component component) {
>>> +    protected Component update(int index, Component component) {
>>>        throw new UnsupportedOperationException();
>>>    }
>>>
>>> -    public final int remove(Component component) {
>>> +    protected int remove(Component component) {
>>>        int index = indexOf(component);
>>>        if (index != -1) {
>>>            remove(index, 1);
>>> @@ -180,7 +243,7 @@
>>>        return index;
>>>    }
>>>
>>> -    public Sequence<Component> remove(int index, int count) {
>>> +    protected Sequence<Component> remove(int index, int count) {
>>>        Sequence<Component> removed = components.remove(index,  
>>> count);
>>>
>>>        // Set the removed components' parent to null and repaint the
>>> area
>>> @@ -208,7 +271,7 @@
>>>        return removed;
>>>    }
>>>
>>> -    public final Sequence<Component> removeAll() {
>>> +    protected final Sequence<Component> removeAll() {
>>>        return remove(0, getLength());
>>>    }
>>>
>>> @@ -221,7 +284,7 @@
>>>     * @param from
>>>     * @param to
>>>     */
>>> -    protected void move(int from, int to) {
>>> +    protected final void move(int from, int to) {
>>>        if (from != to) {
>>>            Sequence<Component> removed = components.remove(from, 1);
>>>            Component component = removed.get(0);
>>> @@ -232,19 +295,19 @@
>>>        }
>>>    }
>>>
>>> -    public Component get(int index) {
>>> +    protected Component get(int index) {
>>>        return components.get(index);
>>>    }
>>>
>>> -    public int indexOf(Component component) {
>>> +    protected int indexOf(Component component) {
>>>        return components.indexOf(component);
>>>    }
>>>
>>> -    public int getLength() {
>>> +    protected int getLength() {
>>>        return components.getLength();
>>>    }
>>>
>>> -    public Iterator<Component> iterator() {
>>> +    protected Iterator<Component> iterator() {
>>>        return new  
>>> ImmutableIterator<Component>(components.iterator());
>>>    }
>>>
>>> Index: wtk/src/org/apache/pivot/wtk/FlowPane.java
>>> ===================================================================
>>> --- wtk/src/org/apache/pivot/wtk/FlowPane.java    (revision 801535)
>>> +++ wtk/src/org/apache/pivot/wtk/FlowPane.java    (working copy)
>>> @@ -22,7 +22,7 @@
>>> *
>>> * @author gbrown
>>> */
>>> -public class FlowPane extends Container {
>>> +public class FlowPane extends SequenceContainer {
>>>    public FlowPane() {
>>>        installSkin(FlowPane.class);
>>>    }
>>> Index: wtk/src/org/apache/pivot/wtk/SequenceContainer.java
>>> ===================================================================
>>> --- wtk/src/org/apache/pivot/wtk/SequenceContainer.java     
>>> (revision 0)
>>> +++ wtk/src/org/apache/pivot/wtk/SequenceContainer.java     
>>> (revision 0)
>>> @@ -0,0 +1,81 @@
>>> +package org.apache.pivot.wtk;
>>> +
>>> +import java.util.Iterator;
>>> +
>>> +import org.apache.pivot.collections.Sequence;
>>> +
>>> +/**
>>> + * Utility base class for those Container subclasses which want to
>>> expose their children in a straight-forward way.
>>> + *
>>> + * @author Noel Grandin
>>> + */
>>> +public class SequenceContainer extends Container implements
>>> Sequence<Component>, Iterable<Component> {
>>> +
>>> +    public Component update(int index, Component component) {
>>> +        throw new UnsupportedOperationException();
>>> +    }
>>> +
>>> +    /**
>>> +     * override and make public
>>> +     */
>>> +    @Override
>>> +    public int indexOf(Component component) {
>>> +        return super.indexOf(component);
>>> +    }
>>> +
>>> +    /**
>>> +     * override and make public
>>> +     */
>>> +    @Override
>>> +    public final int remove(Component component) {
>>> +        return super.remove(component);
>>> +    }
>>> +
>>> +    /**
>>> +     * override and make public
>>> +     */
>>> +    @Override
>>> +    public Sequence<Component> remove(int index, int count) {
>>> +        return super.remove(index, count);
>>> +    }
>>> +
>>> +    /**
>>> +     * override and make public
>>> +     */
>>> +    @Override
>>> +    public int getLength() {
>>> +        return super.getLength();
>>> +    }
>>> +
>>> +    /**
>>> +     * override and make public
>>> +     */
>>> +    @Override
>>> +    public final int add(Component component) {
>>> +        return super.add(component);
>>> +    }
>>> +
>>> +    /**
>>> +     * override and make public
>>> +     */
>>> +    @Override
>>> +    public Component get(int index) {
>>> +        return super.get(index);
>>> +    }
>>> +
>>> +    /**
>>> +     * override and make public
>>> +     */
>>> +    @Override
>>> +    public void insert(Component component, int index) {
>>> +        super.insert(component, index);
>>> +    }
>>> +
>>> +    /**
>>> +     * override and make public
>>> +     */
>>> +    @Override
>>> +    public final Iterator<Component> iterator() {
>>> +        return super.iterator();
>>> +    }
>>> +}
>>> Index: wtk/src/org/apache/pivot/wtk/skin/BorderSkin.java
>>> ===================================================================
>>> --- wtk/src/org/apache/pivot/wtk/skin/BorderSkin.java    (revision
>>> 801535)
>>> +++ wtk/src/org/apache/pivot/wtk/skin/BorderSkin.java    (working  
>>> copy)
>>> @@ -31,12 +31,14 @@
>>> import org.apache.pivot.wtk.Border;
>>> import org.apache.pivot.wtk.BorderListener;
>>> import org.apache.pivot.wtk.Component;
>>> +import org.apache.pivot.wtk.Container;
>>> import org.apache.pivot.wtk.CornerRadii;
>>> import org.apache.pivot.wtk.Dimensions;
>>> import org.apache.pivot.wtk.GraphicsUtilities;
>>> import org.apache.pivot.wtk.Insets;
>>> import org.apache.pivot.wtk.Platform;
>>> import org.apache.pivot.wtk.Theme;
>>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>>>
>>>
>>> /**
>>> @@ -71,10 +73,11 @@
>>>    }
>>>
>>>    @Override
>>> -    public void install(Component component) {
>>> -        super.install(component);
>>> +    public void install(Container container,
>>> +            ContainerChildAccess containerChildAccess) {
>>> +        super.install(container, containerChildAccess);
>>>
>>> -        Border border = (Border)component;
>>> +        Border border = (Border)container;
>>>        border.getBorderListeners().add(this);
>>>    }
>>>
>>> Index: wtk/src/org/apache/pivot/wtk/skin/BoxPaneSkin.java
>>> ===================================================================
>>> --- wtk/src/org/apache/pivot/wtk/skin/BoxPaneSkin.java    (revision
>>> 801535)
>>> +++ wtk/src/org/apache/pivot/wtk/skin/BoxPaneSkin.java    (working  
>>> copy)
>>> @@ -18,6 +18,7 @@
>>>
>>> import org.apache.pivot.collections.Dictionary;
>>> import org.apache.pivot.wtk.Component;
>>> +import org.apache.pivot.wtk.Container;
>>> import org.apache.pivot.wtk.Dimensions;
>>> import org.apache.pivot.wtk.BoxPane;
>>> import org.apache.pivot.wtk.BoxPaneListener;
>>> @@ -25,6 +26,7 @@
>>> import org.apache.pivot.wtk.Insets;
>>> import org.apache.pivot.wtk.Orientation;
>>> import org.apache.pivot.wtk.VerticalAlignment;
>>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>>>
>>> /**
>>> * Box pane skin.
>>> @@ -43,10 +45,11 @@
>>>    private boolean fill = false;
>>>
>>>    @Override
>>> -    public void install(Component component) {
>>> -        super.install(component);
>>> +    public void install(Container container,
>>> +            ContainerChildAccess containerChildAccess) {
>>> +        super.install(container, containerChildAccess);
>>>
>>> -        BoxPane boxPane = (BoxPane)component;
>>> +        BoxPane boxPane = (BoxPane)container;
>>>        boxPane.getBoxPaneListeners().add(this);
>>>    }
>>>
>>> Index: wtk/src/org/apache/pivot/wtk/skin/CalendarSkin.java
>>> ===================================================================
>>> --- wtk/src/org/apache/pivot/wtk/skin/CalendarSkin.java    (revision
>>> 801535)
>>> +++ wtk/src/org/apache/pivot/wtk/skin/CalendarSkin.java    (working
>>> copy)
>>> @@ -19,8 +19,8 @@
>>> import org.apache.pivot.wtk.Calendar;
>>> import org.apache.pivot.wtk.CalendarListener;
>>> import org.apache.pivot.wtk.CalendarSelectionListener;
>>> -import org.apache.pivot.wtk.Component;
>>> -import org.apache.pivot.wtk.skin.ContainerSkin;
>>> +import org.apache.pivot.wtk.Container;
>>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>>>
>>> /**
>>> * Abstract base class for calendar skins.
>>> @@ -30,10 +30,11 @@
>>> public abstract class CalendarSkin extends ContainerSkin
>>>    implements CalendarListener, CalendarSelectionListener {
>>>    @Override
>>> -    public void install(Component component) {
>>> -        super.install(component);
>>> +    public void install(Container container,
>>> +            ContainerChildAccess containerChildAccess) {
>>> +        super.install(container, containerChildAccess);
>>>
>>> -        Calendar calendar = (Calendar)component;
>>> +        Calendar calendar = (Calendar)container;
>>>        calendar.getCalendarListeners().add(this);
>>>        calendar.getCalendarSelectionListeners().add(this);
>>>    }
>>> Index: wtk/src/org/apache/pivot/wtk/skin/CardPaneSkin.java
>>> ===================================================================
>>> --- wtk/src/org/apache/pivot/wtk/skin/CardPaneSkin.java    (revision
>>> 801535)
>>> +++ wtk/src/org/apache/pivot/wtk/skin/CardPaneSkin.java    (working
>>> copy)
>>> @@ -26,6 +26,7 @@
>>> import org.apache.pivot.wtk.Dimensions;
>>> import org.apache.pivot.wtk.Insets;
>>> import org.apache.pivot.wtk.Orientation;
>>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>>> import org.apache.pivot.wtk.effects.FadeDecorator;
>>> import org.apache.pivot.wtk.effects.ScaleDecorator;
>>> import org.apache.pivot.wtk.effects.Transition;
>>> @@ -74,9 +75,8 @@
>>>            this.from = from;
>>>            this.to = to;
>>>
>>> -            CardPane cardPane = (CardPane)getComponent();
>>> -            fromCard = (from == -1) ? null : cardPane.get(from);
>>> -            toCard = (to == -1) ? null : cardPane.get(to);
>>> +            fromCard = (from == -1) ? null :
>>> containerChildAccess.get(from);
>>> +            toCard = (to == -1) ? null :  
>>> containerChildAccess.get(to);
>>>        }
>>>    }
>>>
>>> @@ -305,10 +305,11 @@
>>>    public static final int SELECTION_CHANGE_RATE = 30;
>>>
>>>    @Override
>>> -    public void install(Component component) {
>>> -        super.install(component);
>>> +    public void install(Container container,
>>> +            ContainerChildAccess containerChildAccess) {
>>> +        super.install(container, containerChildAccess);
>>>
>>> -        CardPane cardPane = (CardPane)component;
>>> +        CardPane cardPane = (CardPane)container;
>>>        cardPane.getCardPaneListeners().add(this);
>>>    }
>>>
>>> @@ -328,8 +329,7 @@
>>>            Dimensions preferredSize = getPreferredSize();
>>>            preferredWidth = preferredSize.width;
>>>        } else {
>>> -            CardPane cardPane = (CardPane)getComponent();
>>> -            for (Component card : cardPane) {
>>> +            for (Component card : containerChildAccess) {
>>>                preferredWidth = Math.max(preferredWidth,
>>> card.getPreferredWidth(height));
>>>            }
>>>
>>> @@ -347,8 +347,7 @@
>>>            Dimensions preferredSize = getPreferredSize();
>>>            preferredHeight = preferredSize.height;
>>>        } else {
>>> -            CardPane cardPane = (CardPane)getComponent();
>>> -            for (Component card : cardPane) {
>>> +            for (Component card : containerChildAccess) {
>>>                preferredHeight = Math.max(preferredHeight,
>>> card.getPreferredHeight(width));
>>>            }
>>>
>>> @@ -402,7 +401,7 @@
>>>                preferredHeight = previousHeight + (int)((height -
>>> previousHeight) * percentComplete);
>>>            }
>>>        } else {
>>> -            for (Component card : cardPane) {
>>> +            for (Component card : containerChildAccess) {
>>>                Dimensions cardSize = card.getPreferredSize();
>>>
>>>                preferredWidth = Math.max(cardSize.width,
>>> preferredWidth);
>>> @@ -419,11 +418,10 @@
>>>    public void layout() {
>>>        // Set the size of all components to match the size of the
>>> stack pane,
>>>        // minus padding
>>> -        CardPane cardPane = (CardPane)getComponent();
>>>        int width = getWidth() - (padding.left + padding.right);
>>>        int height = getHeight() - (padding.top + padding.bottom);
>>>
>>> -        for (Component card : cardPane) {
>>> +        for (Component card : containerChildAccess) {
>>>            card.setLocation(padding.left, padding.top);
>>>            card.setSize(width, height);
>>>        }
>>> @@ -512,10 +510,10 @@
>>>        super.componentInserted(container, index);
>>>
>>>        CardPane cardPane = (CardPane)container;
>>> -        Component card = cardPane.get(index);
>>> +        Component card = containerChildAccess.get(index);
>>>        card.setVisible(false);
>>>
>>> -        if (cardPane.getLength() == 1) {
>>> +        if (containerChildAccess.getLength() == 1) {
>>>            cardPane.setSelectedIndex(0);
>>>        }
>>>
>>> @@ -596,7 +594,7 @@
>>>                        SelectionChangeTransition
>>> selectionChangeTransition =
>>>                            (SelectionChangeTransition)transition;
>>>
>>> -                        int selectedIndex =
>>> cardPane.indexOf(selectionChangeTransition.toCard);
>>> +                        int selectedIndex =
>>> containerChildAccess.indexOf(selectionChangeTransition.toCard);
>>>                        cardPane.setSelectedIndex(selectedIndex);
>>>                        CardPaneSkin.this.selectionChangeTransition =
>>> null;
>>>                    }
>>> @@ -632,12 +630,12 @@
>>>    public void selectedIndexChanged(CardPane cardPane, int
>>> previousSelectedIndex) {
>>>        int selectedIndex = cardPane.getSelectedIndex();
>>>        if (selectedIndex != -1) {
>>> -            Component selectedCard = cardPane.get(selectedIndex);
>>> +            Component selectedCard =
>>> containerChildAccess.get(selectedIndex);
>>>            selectedCard.setVisible(true);
>>>        }
>>>
>>>        if (previousSelectedIndex != -1) {
>>> -            Component previousSelectedCard =
>>> cardPane.get(previousSelectedIndex);
>>> +            Component previousSelectedCard =
>>> containerChildAccess.get(previousSelectedIndex);
>>>            previousSelectedCard.setVisible(false);
>>>        }
>>>
>>> Index: wtk/src/org/apache/pivot/wtk/skin/ContainerSkin.java
>>> ===================================================================
>>> --- wtk/src/org/apache/pivot/wtk/skin/ContainerSkin.java     
>>> (revision
>>> 801535)
>>> +++ wtk/src/org/apache/pivot/wtk/skin/ContainerSkin.java    (working
>>> copy)
>>> @@ -38,13 +38,16 @@
>>> */
>>> public abstract class ContainerSkin extends ComponentSkin
>>>    implements ContainerListener {
>>> +
>>> +    protected Container.ContainerChildAccess containerChildAccess;
>>> +
>>>    /**
>>>     * Focus traversal policy that determines traversal order based
>>> on the order
>>>     * of components in the container's component sequence.
>>>     *
>>>     * @author gbrown
>>>     */
>>> -    public static class IndexFocusTraversalPolicy implements
>>> FocusTraversalPolicy {
>>> +    public class IndexFocusTraversalPolicy implements
>>> FocusTraversalPolicy {
>>>        private boolean wrap;
>>>
>>>        public IndexFocusTraversalPolicy() {
>>> @@ -59,6 +62,9 @@
>>>            if (container == null) {
>>>                throw new IllegalArgumentException("container is
>>> null.");
>>>            }
>>> +            if (container != ContainerSkin.this.getComponent()) {
>>> +                throw new IllegalArgumentException("wrong  
>>> container.");
>>> +            }
>>>
>>>            if (direction == null) {
>>>                throw new IllegalArgumentException("direction is
>>> null.");
>>> @@ -66,26 +72,26 @@
>>>
>>>            Component nextComponent = null;
>>>
>>> -            int n = container.getLength();
>>> +            int n = containerChildAccess.getLength();
>>>            if (n > 0) {
>>>                switch (direction) {
>>>                    case FORWARD: {
>>>                        if (component == null) {
>>>                            // Return the first component in the
>>> sequence
>>> -                            nextComponent = container.get(0);
>>> +                            nextComponent =
>>> containerChildAccess.get(0);
>>>                        } else {
>>>                            // Return the next component in the  
>>> sequence
>>> -                            int index =  
>>> container.indexOf(component);
>>> +                            int index =
>>> containerChildAccess.indexOf(component);
>>>                            if (index == -1) {
>>>                                throw new IllegalArgumentException();
>>>                            }
>>>
>>>                            if (index < n - 1) {
>>> -                                nextComponent = container.get(index
>>> + 1);
>>> +                                nextComponent =
>>> containerChildAccess.get(index + 1);
>>>                            } else {
>>>                                if (wrap
>>>                                    && container.containsFocus()) {
>>> -                                    nextComponent =  
>>> container.get(0);
>>> +                                    nextComponent =
>>> containerChildAccess.get(0);
>>>                                }
>>>                            }
>>>                        }
>>> @@ -96,20 +102,20 @@
>>>                    case BACKWARD: {
>>>                        if (component == null) {
>>>                            // Return the last component in the  
>>> sequence
>>> -                            nextComponent = container.get(n - 1);
>>> +                            nextComponent =
>>> containerChildAccess.get(n - 1);
>>>                        } else {
>>>                            // Return the previous component in the
>>> sequence
>>> -                            int index =  
>>> container.indexOf(component);
>>> +                            int index =
>>> containerChildAccess.indexOf(component);
>>>                            if (index == -1) {
>>>                                throw new IllegalArgumentException();
>>>                            }
>>>
>>>                            if (index > 0) {
>>> -                                nextComponent = container.get(index
>>> - 1);
>>> +                                nextComponent =
>>> containerChildAccess.get(index - 1);
>>>                            } else {
>>>                                if (wrap
>>>                                    && container.containsFocus()) {
>>> -                                    nextComponent = container.get(n
>>> - 1);
>>> +                                    nextComponent =
>>> containerChildAccess.get(n - 1);
>>>                                }
>>>                            }
>>>                        }
>>> @@ -125,12 +131,21 @@
>>>
>>>    private Paint backgroundPaint = null;
>>>
>>> +    /**
>>> +     * Make this final so that none of the subclasses can  
>>> override it.
>>> +     * They need to override the other install() method.
>>> +     */
>>>    @Override
>>> -    public void install(Component component) {
>>> +    public final void install(Component component) {
>>> +        //check that none of the subclasses is accidentally  
>>> calling me.
>>> +        if (this.containerChildAccess!=null) throw new
>>> IllegalStateException("wrong calling sequence");
>>> +
>>>        super.install(component);
>>> -
>>> -        Container container = (Container)component;
>>> -
>>> +    }
>>> +
>>> +    public void install(Container container,
>>> Container.ContainerChildAccess containerChildAccess) {
>>> +        this.containerChildAccess = containerChildAccess;
>>> +
>>>        // Add this as a container listener
>>>        container.getContainerListeners().add(this);
>>>
>>> Index: wtk/src/org/apache/pivot/wtk/skin/DisplaySkin.java
>>> ===================================================================
>>> --- wtk/src/org/apache/pivot/wtk/skin/DisplaySkin.java    (revision
>>> 801535)
>>> +++ wtk/src/org/apache/pivot/wtk/skin/DisplaySkin.java    (working  
>>> copy)
>>> @@ -19,9 +19,11 @@
>>> import java.awt.Color;
>>>
>>> import org.apache.pivot.wtk.Component;
>>> +import org.apache.pivot.wtk.Container;
>>> import org.apache.pivot.wtk.Dimensions;
>>> import org.apache.pivot.wtk.Display;
>>> import org.apache.pivot.wtk.Window;
>>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>>>
>>> /**
>>> * Display skin.
>>> @@ -38,19 +40,20 @@
>>>    }
>>>
>>>    @Override
>>> -    public void install(Component component) {
>>> -        if (!(component instanceof Display)) {
>>> +    public void install(Container container,
>>> +            ContainerChildAccess containerChildAccess) {
>>> +        if (!(container instanceof Display)) {
>>>            throw new IllegalArgumentException("DisplaySkin can only
>>> be installed on instances of Display.");
>>>        }
>>>
>>> -        super.install(component);
>>> +        super.install(container, containerChildAccess);
>>>    }
>>>
>>>    public void layout() {
>>>        Display display = (Display)getComponent();
>>>
>>>        // Set all components to their preferred sizes
>>> -        for (Component component : display) {
>>> +        for (Component component : containerChildAccess) {
>>>            Window window = (Window)component;
>>>
>>>            if (window.isDisplayable()) {
>>> Index: wtk/src/org/apache/pivot/wtk/skin/ExpanderSkin.java
>>> ===================================================================
>>> --- wtk/src/org/apache/pivot/wtk/skin/ExpanderSkin.java    (revision
>>> 801535)
>>> +++ wtk/src/org/apache/pivot/wtk/skin/ExpanderSkin.java    (working
>>> copy)
>>> @@ -18,8 +18,10 @@
>>>
>>> import org.apache.pivot.util.Vote;
>>> import org.apache.pivot.wtk.Component;
>>> +import org.apache.pivot.wtk.Container;
>>> import org.apache.pivot.wtk.Expander;
>>> import org.apache.pivot.wtk.ExpanderListener;
>>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>>>
>>> /**
>>> * Abstract base class for expander skins.
>>> @@ -29,10 +31,11 @@
>>> public abstract class ExpanderSkin extends ContainerSkin
>>>    implements ExpanderListener {
>>>    @Override
>>> -    public void install(Component component) {
>>> -        super.install(component);
>>> +    public void install(Container container,
>>> +            ContainerChildAccess containerChildAccess) {
>>> +        super.install(container, containerChildAccess);
>>>
>>> -        Expander expander = (Expander)component;
>>> +        Expander expander = (Expander)container;
>>>        expander.getExpanderListeners().add(this);
>>>    }
>>>
>>> Index: wtk/src/org/apache/pivot/wtk/skin/FileBrowserSkin.java
>>> ===================================================================
>>> --- wtk/src/org/apache/pivot/wtk/skin/FileBrowserSkin.java
>>> (revision 801535)
>>> +++ wtk/src/org/apache/pivot/wtk/skin/FileBrowserSkin.java
>>> (working copy)
>>> @@ -17,8 +17,10 @@
>>> package org.apache.pivot.wtk.skin;
>>>
>>> import org.apache.pivot.wtk.Component;
>>> +import org.apache.pivot.wtk.Container;
>>> import org.apache.pivot.wtk.FileBrowser;
>>> import org.apache.pivot.wtk.FileBrowserListener;
>>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>>> import org.apache.pivot.wtk.skin.ContainerSkin;
>>>
>>> /**
>>> @@ -28,10 +30,11 @@
>>> */
>>> public abstract class FileBrowserSkin extends ContainerSkin
>>> implements FileBrowserListener {
>>>    @Override
>>> -    public void install(Component component) {
>>> -        super.install(component);
>>> +    public void install(Container container,
>>> +            ContainerChildAccess containerChildAccess) {
>>> +        super.install(container, containerChildAccess);
>>>
>>> -        FileBrowser fileBrowser = (FileBrowser)component;
>>> +        FileBrowser fileBrowser = (FileBrowser)container;
>>>        fileBrowser.getFileBrowserListeners().add(this);
>>>    }
>>>
>>> Index: wtk/src/org/apache/pivot/wtk/skin/FlowPaneSkin.java
>>> ===================================================================
>>> --- wtk/src/org/apache/pivot/wtk/skin/FlowPaneSkin.java    (revision
>>> 801535)
>>> +++ wtk/src/org/apache/pivot/wtk/skin/FlowPaneSkin.java    (working
>>> copy)
>>> @@ -19,10 +19,12 @@
>>> import org.apache.pivot.collections.ArrayList;
>>> import org.apache.pivot.collections.Dictionary;
>>> import org.apache.pivot.wtk.Component;
>>> +import org.apache.pivot.wtk.Container;
>>> import org.apache.pivot.wtk.Dimensions;
>>> import org.apache.pivot.wtk.FlowPane;
>>> import org.apache.pivot.wtk.HorizontalAlignment;
>>> import org.apache.pivot.wtk.Insets;
>>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>>>
>>> public class FlowPaneSkin extends ContainerSkin {
>>>    private HorizontalAlignment alignment = HorizontalAlignment.LEFT;
>>> @@ -32,8 +34,9 @@
>>>    private boolean alignToBaseline = false;
>>>
>>>    @Override
>>> -    public void install(Component component) {
>>> -        super.install(component);
>>> +    public void install(Container container,
>>> +            ContainerChildAccess containerChildAccess) {
>>> +        super.install(container, containerChildAccess);
>>>    }
>>>
>>>    @Override
>>> Index: wtk/src/org/apache/pivot/wtk/skin/RollupSkin.java
>>> ===================================================================
>>> --- wtk/src/org/apache/pivot/wtk/skin/RollupSkin.java    (revision
>>> 801535)
>>> +++ wtk/src/org/apache/pivot/wtk/skin/RollupSkin.java    (working  
>>> copy)
>>> @@ -18,9 +18,11 @@
>>>
>>> import org.apache.pivot.util.Vote;
>>> import org.apache.pivot.wtk.Component;
>>> +import org.apache.pivot.wtk.Container;
>>> import org.apache.pivot.wtk.Rollup;
>>> import org.apache.pivot.wtk.RollupListener;
>>> import org.apache.pivot.wtk.RollupStateListener;
>>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>>>
>>>
>>> /**
>>> @@ -31,10 +33,11 @@
>>> public abstract class RollupSkin extends ContainerSkin
>>>    implements RollupListener, RollupStateListener {
>>>    @Override
>>> -    public void install(Component component) {
>>> -        super.install(component);
>>> +    public void install(Container container,
>>> +            ContainerChildAccess containerChildAccess) {
>>> +        super.install(container, containerChildAccess);
>>>
>>> -        Rollup rollup = (Rollup)component;
>>> +        Rollup rollup = (Rollup)container;
>>>        rollup.getRollupListeners().add(this);
>>>        rollup.getRollupStateListeners().add(this);
>>>    }
>>> Index: wtk/src/org/apache/pivot/wtk/skin/ScrollPaneSkin.java
>>> ===================================================================
>>> --- wtk/src/org/apache/pivot/wtk/skin/ScrollPaneSkin.java
>>> (revision 801535)
>>> +++ wtk/src/org/apache/pivot/wtk/skin/ScrollPaneSkin.java     
>>> (working
>>> copy)
>>> @@ -24,6 +24,7 @@
>>> import org.apache.pivot.wtk.ApplicationContext;
>>> import org.apache.pivot.wtk.Bounds;
>>> import org.apache.pivot.wtk.Component;
>>> +import org.apache.pivot.wtk.Container;
>>> import org.apache.pivot.wtk.DesktopApplicationContext;
>>> import org.apache.pivot.wtk.Dimensions;
>>> import org.apache.pivot.wtk.Keyboard;
>>> @@ -35,6 +36,7 @@
>>> import org.apache.pivot.wtk.ScrollPaneListener;
>>> import org.apache.pivot.wtk.Viewport;
>>> import org.apache.pivot.wtk.ViewportListener;
>>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>>> import org.apache.pivot.wtk.ScrollPane.Corner;
>>> import org.apache.pivot.wtk.ScrollPane.ScrollBarPolicy;
>>>
>>> @@ -75,20 +77,21 @@
>>>    }
>>>
>>>    @Override
>>> -    public void install(Component component) {
>>> -        super.install(component);
>>> +    public void install(Container container,
>>> +            ContainerChildAccess containerChildAccess) {
>>> +        super.install(container, containerChildAccess);
>>>
>>> -        ScrollPane scrollPane = (ScrollPane)component;
>>> +        ScrollPane scrollPane = (ScrollPane)container;
>>>        scrollPane.getViewportListeners().add(this);
>>>        scrollPane.getScrollPaneListeners().add(this);
>>>
>>> -        scrollPane.add(horizontalScrollBar);
>>> -        scrollPane.add(verticalScrollBar);
>>> +        containerChildAccess.add(horizontalScrollBar);
>>> +        containerChildAccess.add(verticalScrollBar);
>>>
>>> -        scrollPane.add(topLeftCorner);
>>> -        scrollPane.add(bottomLeftCorner);
>>> -        scrollPane.add(bottomRightCorner);
>>> -        scrollPane.add(topRightCorner);
>>> +        containerChildAccess.add(topLeftCorner);
>>> +        containerChildAccess.add(bottomLeftCorner);
>>> +        containerChildAccess.add(bottomRightCorner);
>>> +        containerChildAccess.add(topRightCorner);
>>>
>>>        horizontalScrollBar.getScrollBarValueListeners().add(this);
>>>        verticalScrollBar.getScrollBarValueListeners().add(this);
>>> @@ -100,13 +103,13 @@
>>>        scrollPane.getViewportListeners().remove(this);
>>>        scrollPane.getScrollPaneListeners().remove(this);
>>>
>>> -        scrollPane.remove(horizontalScrollBar);
>>> -        scrollPane.remove(verticalScrollBar);
>>> +        containerChildAccess.remove(horizontalScrollBar);
>>> +        containerChildAccess.remove(verticalScrollBar);
>>>
>>> -        scrollPane.remove(topLeftCorner);
>>> -        scrollPane.remove(bottomLeftCorner);
>>> -        scrollPane.remove(bottomRightCorner);
>>> -        scrollPane.remove(topRightCorner);
>>> +        containerChildAccess.remove(topLeftCorner);
>>> +        containerChildAccess.remove(bottomLeftCorner);
>>> +        containerChildAccess.remove(bottomRightCorner);
>>> +        containerChildAccess.remove(topRightCorner);
>>>
>>>         
>>> horizontalScrollBar.getScrollBarValueListeners().remove(this);
>>>        verticalScrollBar.getScrollBarValueListeners().remove(this);
>>> Index: wtk/src/org/apache/pivot/wtk/skin/SliderSkin.java
>>> ===================================================================
>>> --- wtk/src/org/apache/pivot/wtk/skin/SliderSkin.java    (revision
>>> 801535)
>>> +++ wtk/src/org/apache/pivot/wtk/skin/SliderSkin.java    (working  
>>> copy)
>>> @@ -17,9 +17,11 @@
>>> package org.apache.pivot.wtk.skin;
>>>
>>> import org.apache.pivot.wtk.Component;
>>> +import org.apache.pivot.wtk.Container;
>>> import org.apache.pivot.wtk.Slider;
>>> import org.apache.pivot.wtk.SliderListener;
>>> import org.apache.pivot.wtk.SliderValueListener;
>>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>>>
>>> /**
>>> * Abstract base class for slider skins.
>>> @@ -29,10 +31,11 @@
>>> public abstract class SliderSkin extends ContainerSkin
>>>    implements SliderListener, SliderValueListener {
>>>    @Override
>>> -    public void install(Component component) {
>>> -        super.install(component);
>>> +    public void install(Container container,
>>> +            ContainerChildAccess containerChildAccess) {
>>> +        super.install(container, containerChildAccess);
>>>
>>> -        Slider slider = (Slider)component;
>>> +        Slider slider = (Slider)container;
>>>        slider.getSliderListeners().add(this);
>>>        slider.getSliderValueListeners().add(this);
>>>    }
>>> Index: wtk/src/org/apache/pivot/wtk/skin/StackPaneSkin.java
>>> ===================================================================
>>> --- wtk/src/org/apache/pivot/wtk/skin/StackPaneSkin.java     
>>> (revision
>>> 801535)
>>> +++ wtk/src/org/apache/pivot/wtk/skin/StackPaneSkin.java    (working
>>> copy)
>>> @@ -20,7 +20,6 @@
>>> import org.apache.pivot.wtk.Component;
>>> import org.apache.pivot.wtk.Dimensions;
>>> import org.apache.pivot.wtk.Insets;
>>> -import org.apache.pivot.wtk.StackPane;
>>>
>>> /**
>>> * Stack pane skin.
>>> @@ -32,9 +31,8 @@
>>>
>>>    public int getPreferredWidth(int height) {
>>>        int preferredWidth = 0;
>>> -        StackPane stackPane = (StackPane)getComponent();
>>>
>>> -        for (Component component : stackPane) {
>>> +        for (Component component : containerChildAccess) {
>>>            preferredWidth = Math.max(preferredWidth,
>>>                component.getPreferredWidth(height));
>>>        }
>>> @@ -46,9 +44,8 @@
>>>
>>>    public int getPreferredHeight(int width) {
>>>        int preferredHeight = 0;
>>> -        StackPane stackPane = (StackPane)getComponent();
>>>
>>> -        for (Component component : stackPane) {
>>> +        for (Component component : containerChildAccess) {
>>>            preferredHeight = Math.max(preferredHeight,
>>>                component.getPreferredHeight(width));
>>>        }
>>> @@ -62,9 +59,7 @@
>>>        int preferredWidth = 0;
>>>        int preferredHeight = 0;
>>>
>>> -        StackPane stackPane = (StackPane)getComponent();
>>> -
>>> -        for (Component component : stackPane) {
>>> +        for (Component component : containerChildAccess) {
>>>            Dimensions preferredCardSize =  
>>> component.getPreferredSize();
>>>
>>>            preferredWidth = Math.max(preferredWidth,
>>> @@ -83,12 +78,10 @@
>>>    public void layout() {
>>>        // Set the size of all components to match the size of the
>>> stack pane,
>>>        // minus padding
>>> -        StackPane stackPane = (StackPane)getComponent();
>>> -
>>>        int width = getWidth() - (padding.left + padding.right);
>>>        int height = getHeight() - (padding.top + padding.bottom);
>>>
>>> -        for (Component component : stackPane) {
>>> +        for (Component component : containerChildAccess) {
>>>            component.setLocation(padding.left, padding.top);
>>>            component.setSize(width, height);
>>>        }
>>> Index: wtk/src/org/apache/pivot/wtk/skin/TablePaneSkin.java
>>> ===================================================================
>>> --- wtk/src/org/apache/pivot/wtk/skin/TablePaneSkin.java     
>>> (revision
>>> 801535)
>>> +++ wtk/src/org/apache/pivot/wtk/skin/TablePaneSkin.java    (working
>>> copy)
>>> @@ -27,6 +27,7 @@
>>> import org.apache.pivot.collections.Sequence;
>>> import org.apache.pivot.wtk.Bounds;
>>> import org.apache.pivot.wtk.Component;
>>> +import org.apache.pivot.wtk.Container;
>>> import org.apache.pivot.wtk.Dimensions;
>>> import org.apache.pivot.wtk.GraphicsUtilities;
>>> import org.apache.pivot.wtk.Insets;
>>> @@ -34,6 +35,7 @@
>>> import org.apache.pivot.wtk.TablePane;
>>> import org.apache.pivot.wtk.TablePaneAttributeListener;
>>> import org.apache.pivot.wtk.TablePaneListener;
>>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>>>
>>>
>>> /**
>>> @@ -57,10 +59,11 @@
>>>    private int[] rowHeights = null;
>>>
>>>    @Override
>>> -    public void install(Component component) {
>>> -        super.install(component);
>>> +    public void install(Container container,
>>> +            ContainerChildAccess containerChildAccess) {
>>> +        super.install(container, containerChildAccess);
>>>
>>> -        TablePane tablePane = (TablePane)component;
>>> +        TablePane tablePane = (TablePane)container;
>>>        tablePane.getTablePaneListeners().add(this);
>>>        tablePane.getTablePaneAttributeListeners().add(this);
>>>    }
>>> Index: wtk/src/org/apache/pivot/wtk/skin/WindowSkin.java
>>> ===================================================================
>>> --- wtk/src/org/apache/pivot/wtk/skin/WindowSkin.java    (revision
>>> 801535)
>>> +++ wtk/src/org/apache/pivot/wtk/skin/WindowSkin.java    (working  
>>> copy)
>>> @@ -28,6 +28,7 @@
>>> import org.apache.pivot.wtk.Window;
>>> import org.apache.pivot.wtk.WindowListener;
>>> import org.apache.pivot.wtk.WindowStateListener;
>>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>>> import org.apache.pivot.wtk.media.Image;
>>>
>>> /**
>>> @@ -66,8 +67,9 @@
>>>    }
>>>
>>>    @Override
>>> -    public void install(Component component) {
>>> -        super.install(component);
>>> +    public void install(Container component,
>>> +            ContainerChildAccess containerChildAccess) {
>>> +        super.install(component, containerChildAccess);
>>>
>>>        Window window = (Window)component;
>>>        window.getWindowListeners().add(this);
>>> Index: wtk/src/org/apache/pivot/wtk/skin/terra/ 
>>> TerraAccordionSkin.java
>>> ===================================================================
>>> ---
>>> wtk/src/org/apache/pivot/wtk/skin/terra/TerraAccordionSkin.java
>>> (revision 801535)
>>> +++
>>> wtk/src/org/apache/pivot/wtk/skin/terra/TerraAccordionSkin.java
>>> (working copy)
>>> @@ -32,6 +32,7 @@
>>> import org.apache.pivot.wtk.Button;
>>> import org.apache.pivot.wtk.Component;
>>> import org.apache.pivot.wtk.ComponentStateListener;
>>> +import org.apache.pivot.wtk.Container;
>>> import org.apache.pivot.wtk.Dimensions;
>>> import org.apache.pivot.wtk.GraphicsUtilities;
>>> import org.apache.pivot.wtk.HorizontalAlignment;
>>> @@ -39,6 +40,7 @@
>>> import org.apache.pivot.wtk.Mouse;
>>> import org.apache.pivot.wtk.Theme;
>>> import org.apache.pivot.wtk.Button.Group;
>>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>>> import org.apache.pivot.wtk.content.ButtonData;
>>> import org.apache.pivot.wtk.content.ButtonDataRenderer;
>>> import org.apache.pivot.wtk.effects.ClipDecorator;
>>> @@ -312,10 +314,12 @@
>>>        super.setSize(width, height);
>>>    }
>>>
>>> -    public void install(Component component) {
>>> -        super.install(component);
>>> +    @Override
>>> +    public void install(Container container,
>>> +            ContainerChildAccess containerChildAccess) {
>>> +        super.install(container, containerChildAccess);
>>>
>>> -        Accordion accordion = (Accordion)component;
>>> +        Accordion accordion = (Accordion)container;
>>>
>>>        // Add this as a listener on the accordion
>>>        accordion.getAccordionListeners().add(this);
>>> @@ -327,7 +331,7 @@
>>>            PanelHeader panelHeader = new PanelHeader(panel);
>>>            panelHeader.setGroup(panelHeaderGroup);
>>>            panelHeaders.add(panelHeader);
>>> -            accordion.add(panelHeader);
>>> +            containerChildAccess.add(panelHeader);
>>>
>>>            // Listen for state changes on the panel
>>>            panelHeader.setEnabled(panel.isEnabled());
>>> @@ -349,7 +353,7 @@
>>>
>>> panel.getComponentStateListeners().remove(panelStateListener);
>>>
>>>            // Remove the header
>>> -            accordion.remove(panelHeader);
>>> +            containerChildAccess.remove(panelHeader);
>>>        }
>>>
>>>        super.uninstall();
>>> @@ -656,7 +660,7 @@
>>>        PanelHeader panelHeader = new PanelHeader(panel);
>>>        panelHeader.setGroup(panelHeaderGroup);
>>>        panelHeaders.insert(panelHeader, index);
>>> -        accordion.add(panelHeader);
>>> +        containerChildAccess.add(panelHeader);
>>>
>>>        // Listen for state changes on the panel
>>>        panelHeader.setEnabled(panel.isEnabled());
>>> @@ -687,7 +691,7 @@
>>>
>>> panel.getComponentStateListeners().remove(panelStateListener);
>>>
>>>            // Remove the header
>>> -            accordion.remove(panelHeader);
>>> +            containerChildAccess.remove(panelHeader);
>>>        }
>>>
>>>        invalidateComponent();
>>> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraAlertSkin.java
>>> ===================================================================
>>> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraAlertSkin.java
>>> (revision 801535)
>>> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraAlertSkin.java
>>> (working copy)
>>> @@ -24,11 +24,13 @@
>>> import org.apache.pivot.wtk.ButtonPressListener;
>>> import org.apache.pivot.wtk.Component;
>>> import org.apache.pivot.wtk.BoxPane;
>>> +import org.apache.pivot.wtk.Container;
>>> import org.apache.pivot.wtk.ImageView;
>>> import org.apache.pivot.wtk.Label;
>>> import org.apache.pivot.wtk.PushButton;
>>> import org.apache.pivot.wtk.Theme;
>>> import org.apache.pivot.wtk.Window;
>>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>>> import org.apache.pivot.wtkx.WTKXSerializer;
>>>
>>>
>>> @@ -50,8 +52,9 @@
>>>    }
>>>
>>>    @Override
>>> -    public void install(Component component) {
>>> -        super.install(component);
>>> +    public void install(Container component,
>>> +            ContainerChildAccess containerChildAccess) {
>>> +        super.install(component, containerChildAccess);
>>>
>>>        Alert alert = (Alert)component;
>>>        alert.getAlertListeners().add(this);
>>> Index: wtk/src/org/apache/pivot/wtk/skin/terra/ 
>>> TerraCalendarSkin.java
>>> ===================================================================
>>> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraCalendarSkin.java
>>> (revision 801535)
>>> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraCalendarSkin.java
>>> (working copy)
>>> @@ -33,6 +33,7 @@
>>> import org.apache.pivot.wtk.CalendarSelectionListener;
>>> import org.apache.pivot.wtk.Component;
>>> import org.apache.pivot.wtk.ComponentMouseButtonListener;
>>> +import org.apache.pivot.wtk.Container;
>>> import org.apache.pivot.wtk.Cursor;
>>> import org.apache.pivot.wtk.Dimensions;
>>> import org.apache.pivot.wtk.GraphicsUtilities;
>>> @@ -47,6 +48,7 @@
>>> import org.apache.pivot.wtk.TablePane;
>>> import org.apache.pivot.wtk.Theme;
>>> import org.apache.pivot.wtk.Button.Group;
>>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>>> import org.apache.pivot.wtk.content.ButtonDataRenderer;
>>> import org.apache.pivot.wtk.content.NumericSpinnerData;
>>> import org.apache.pivot.wtk.content.SpinnerItemRenderer;
>>> @@ -500,11 +502,12 @@
>>>    }
>>>
>>>    @Override
>>> -    public void install(Component component) {
>>> -        super.install(component);
>>> +    public void install(Container container,
>>> +            ContainerChildAccess containerChildAccess) {
>>> +        super.install(container, containerChildAccess);
>>>
>>> -        Calendar calendar = (Calendar)component;
>>> -        calendar.add(calendarTablePane);
>>> +        Calendar calendar = (Calendar)container;
>>> +        containerChildAccess.add(calendarTablePane);
>>>
>>>        yearSpinner.setSelectedIndex(calendar.getYear());
>>>        monthSpinner.setSelectedIndex(calendar.getMonth());
>>> @@ -514,8 +517,7 @@
>>>
>>>    @Override
>>>    public void uninstall() {
>>> -        Calendar calendar = (Calendar)getComponent();
>>> -        calendar.remove(calendarTablePane);
>>> +        containerChildAccess.remove(calendarTablePane);
>>>
>>>        super.uninstall();
>>>    }
>>> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraDialogSkin.java
>>> ===================================================================
>>> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraDialogSkin.java
>>> (revision 801535)
>>> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraDialogSkin.java
>>> (working copy)
>>> @@ -24,6 +24,7 @@
>>> import org.apache.pivot.wtk.DialogStateListener;
>>> import org.apache.pivot.wtk.Keyboard;
>>> import org.apache.pivot.wtk.Window;
>>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>>>
>>>
>>> /**
>>> @@ -54,8 +55,9 @@
>>>    }
>>>
>>>    @Override
>>> -    public void install(Component component) {
>>> -        super.install(component);
>>> +    public void install(Container component,
>>> +            ContainerChildAccess containerChildAccess) {
>>> +        super.install(component, containerChildAccess);
>>>
>>>        Dialog dialog = (Dialog)component;
>>>        dialog.getDialogStateListeners().add(this);
>>> Index: wtk/src/org/apache/pivot/wtk/skin/terra/ 
>>> TerraExpanderSkin.java
>>> ===================================================================
>>> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraExpanderSkin.java
>>> (revision 801535)
>>> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraExpanderSkin.java
>>> (working copy)
>>> @@ -29,6 +29,7 @@
>>> import org.apache.pivot.wtk.ButtonPressListener;
>>> import org.apache.pivot.wtk.Component;
>>> import org.apache.pivot.wtk.ComponentMouseButtonListener;
>>> +import org.apache.pivot.wtk.Container;
>>> import org.apache.pivot.wtk.Dimensions;
>>> import org.apache.pivot.wtk.Expander;
>>> import org.apache.pivot.wtk.BoxPane;
>>> @@ -41,6 +42,7 @@
>>> import org.apache.pivot.wtk.Orientation;
>>> import org.apache.pivot.wtk.TablePane;
>>> import org.apache.pivot.wtk.Theme;
>>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>>> import org.apache.pivot.wtk.content.ButtonDataRenderer;
>>> import org.apache.pivot.wtk.effects.Transition;
>>> import org.apache.pivot.wtk.effects.TransitionListener;
>>> @@ -253,11 +255,12 @@
>>>    }
>>>
>>>    @Override
>>> -    public void install(Component component) {
>>> -        super.install(component);
>>> +    public void install(Container container,
>>> +            ContainerChildAccess containerChildAccess) {
>>> +        super.install(container, containerChildAccess);
>>>
>>> -        Expander expander = (Expander)component;
>>> -        expander.add(titleBarTablePane);
>>> +        Expander expander = (Expander)container;
>>> +        containerChildAccess.add(titleBarTablePane);
>>>
>>>        Image buttonData = expander.isExpanded() ? collapseImage :
>>> expandImage;
>>>        shadeButton = new ShadeButton(buttonData);
>>> @@ -270,8 +273,7 @@
>>>    }
>>>
>>>    public void uninstall() {
>>> -        Expander expander = (Expander)getComponent();
>>> -        expander.remove(titleBarTablePane);
>>> +        containerChildAccess.remove(titleBarTablePane);
>>>
>>>        shadeButton.getButtonPressListeners().remove(this);
>>>        buttonBoxPane.remove(shadeButton);
>>> Index:
>>> wtk/src/org/apache/pivot/wtk/skin/terra/ 
>>> TerraFileBrowserSheetSkin.java
>>> ===================================================================
>>> ---
>>> wtk/src/org/apache/pivot/wtk/skin/terra/ 
>>> TerraFileBrowserSheetSkin.java
>>> (revision 801535)
>>> +++
>>> wtk/src/org/apache/pivot/wtk/skin/terra/ 
>>> TerraFileBrowserSheetSkin.java
>>> (working copy)
>>> @@ -22,8 +22,10 @@
>>> import org.apache.pivot.io.Folder;
>>> import org.apache.pivot.util.Filter;
>>> import org.apache.pivot.wtk.Component;
>>> +import org.apache.pivot.wtk.Container;
>>> import org.apache.pivot.wtk.FileBrowserSheet;
>>> import org.apache.pivot.wtk.FileBrowserSheetListener;
>>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>>>
>>> /**
>>> * Terra file browser sheet skin.
>>> @@ -32,8 +34,9 @@
>>> */
>>> public class TerraFileBrowserSheetSkin extends TerraSheetSkin
>>> implements FileBrowserSheetListener {
>>>    @Override
>>> -    public void install(Component component) {
>>> -        super.install(component);
>>> +    public void install(Container component,
>>> +            ContainerChildAccess containerChildAccess) {
>>> +        super.install(component, containerChildAccess);
>>>
>>>        FileBrowserSheet fileBrowserSheet =  
>>> (FileBrowserSheet)component;
>>>        fileBrowserSheet.getFileBrowserSheetListeners().add(this);
>>> Index: wtk/src/org/apache/pivot/wtk/skin/terra/ 
>>> TerraFileBrowserSkin.java
>>> ===================================================================
>>> ---
>>> wtk/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSkin.java
>>> (revision 801535)
>>> +++
>>> wtk/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSkin.java
>>> (working copy)
>>> @@ -21,8 +21,9 @@
>>> import org.apache.pivot.collections.Sequence;
>>> import org.apache.pivot.io.Folder;
>>> import org.apache.pivot.util.Filter;
>>> -import org.apache.pivot.wtk.Component;
>>> +import org.apache.pivot.wtk.Container;
>>> import org.apache.pivot.wtk.FileBrowser;
>>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>>> import org.apache.pivot.wtk.skin.FileBrowserSkin;
>>>
>>> /**
>>> @@ -32,8 +33,9 @@
>>> */
>>> public class TerraFileBrowserSkin extends FileBrowserSkin {
>>>    @Override
>>> -    public void install(Component component) {
>>> -        super.install(component);
>>> +    public void install(Container container,
>>> +            ContainerChildAccess containerChildAccess) {
>>> +        super.install(container, containerChildAccess);
>>>
>>>        // TODO Add components
>>>    }
>>> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraFormSkin.java
>>> ===================================================================
>>> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraFormSkin.java
>>> (revision 801535)
>>> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraFormSkin.java
>>> (working copy)
>>> @@ -19,6 +19,7 @@
>>> import org.apache.pivot.collections.ArrayList;
>>> import org.apache.pivot.collections.Sequence;
>>> import org.apache.pivot.wtk.Component;
>>> +import org.apache.pivot.wtk.Container;
>>> import org.apache.pivot.wtk.Dimensions;
>>> import org.apache.pivot.wtk.Form;
>>> import org.apache.pivot.wtk.FormAttributeListener;
>>> @@ -28,6 +29,7 @@
>>> import org.apache.pivot.wtk.MessageType;
>>> import org.apache.pivot.wtk.Separator;
>>> import org.apache.pivot.wtk.Theme;
>>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>>> import org.apache.pivot.wtk.media.Image;
>>> import org.apache.pivot.wtk.skin.ContainerSkin;
>>>
>>> @@ -52,10 +54,10 @@
>>>    private static final int FLAG_IMAGE_SIZE = 16;
>>>
>>>    @Override
>>> -    public void install(Component component) {
>>> -        super.install(component);
>>> +    public void install(Container container,
>>> +            ContainerChildAccess containerChildAccess) {
>>>
>>> -        Form form = (Form)component;
>>> +        Form form = (Form)container;
>>>        form.getFormListeners().add(this);
>>>        form.getFormAttributeListeners().add(this);
>>>
>>> @@ -411,7 +413,7 @@
>>>        // Insert separator
>>>        Separator separator = new Separator(section.getHeading());
>>>        separators.insert(separator, index);
>>> -        form.add(separator);
>>> +        containerChildAccess.add(separator);
>>>
>>>        // Insert field label and flag image view lists
>>>        ArrayList<Label> sectionLabels = new ArrayList<Label>();
>>> @@ -445,7 +447,7 @@
>>>            // Remove separators
>>>            Sequence<Separator> removedSeparators =
>>> separators.remove(index, n);
>>>            for (int j = 0; j < n; j++) {
>>> -                form.remove(removedSeparators.get(j));
>>> +                 
>>> containerChildAccess.remove(removedSeparators.get(j));
>>>            }
>>>        }
>>>
>>> @@ -459,13 +461,13 @@
>>>        // Create the label
>>>        Label label = new Label();
>>>        labels.get(sectionIndex).insert(label, index);
>>> -        form.add(label);
>>> +        containerChildAccess.add(label);
>>>        updateFieldLabel(section, index);
>>>
>>>        // Create the flag image view
>>>        ImageView flagImageView = new ImageView();
>>>        flagImageViews.get(sectionIndex).insert(flagImageView,  
>>> index);
>>> -        form.add(flagImageView);
>>> +        containerChildAccess.add(flagImageView);
>>>        updateFieldFlag(section, index);
>>>
>>>        invalidateComponent();
>>> @@ -478,13 +480,13 @@
>>>        // Remove the labels
>>>        Sequence<Label> removedLabels =
>>> labels.get(sectionIndex).remove(index, count);
>>>        for (int i = 0; i < count; i++) {
>>> -            form.remove(removedLabels.get(i));
>>> +            containerChildAccess.remove(removedLabels.get(i));
>>>        }
>>>
>>>        // Remove the flag image views
>>>        Sequence<ImageView> removedFlagImageViews =
>>> flagImageViews.get(sectionIndex).remove(index, count);
>>>        for (int i = 0; i < count; i++) {
>>> -            form.remove(removedFlagImageViews.get(i));
>>> +             
>>> containerChildAccess.remove(removedFlagImageViews.get(i));
>>>        }
>>>
>>>        invalidateComponent();
>>> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraFrameSkin.java
>>> ===================================================================
>>> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraFrameSkin.java
>>> (revision 801535)
>>> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraFrameSkin.java
>>> (working copy)
>>> @@ -28,6 +28,7 @@
>>> import org.apache.pivot.wtk.Button;
>>> import org.apache.pivot.wtk.ButtonPressListener;
>>> import org.apache.pivot.wtk.Component;
>>> +import org.apache.pivot.wtk.Container;
>>> import org.apache.pivot.wtk.Cursor;
>>> import org.apache.pivot.wtk.Dimensions;
>>> import org.apache.pivot.wtk.Display;
>>> @@ -45,6 +46,7 @@
>>> import org.apache.pivot.wtk.Theme;
>>> import org.apache.pivot.wtk.VerticalAlignment;
>>> import org.apache.pivot.wtk.Window;
>>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>>> import org.apache.pivot.wtk.effects.DropShadowDecorator;
>>> import org.apache.pivot.wtk.media.Image;
>>> import org.apache.pivot.wtk.skin.WindowSkin;
>>> @@ -296,8 +298,9 @@
>>>    }
>>>
>>>    @Override
>>> -    public void install(Component component) {
>>> -        super.install(component);
>>> +    public void install(Container component,
>>> +            ContainerChildAccess containerChildAccess) {
>>> +        super.install(component, containerChildAccess);
>>>
>>>        Window window = (Window)component;
>>>
>>> @@ -305,7 +308,7 @@
>>>        dropShadowDecorator = new DropShadowDecorator();
>>>        window.getDecorators().add(dropShadowDecorator);
>>>
>>> -        window.add(titleBarTablePane);
>>> +        containerChildAccess.add(titleBarTablePane);
>>>
>>>        // Create the frame buttons
>>>        minimizeButton = new FrameButton(minimizeImage);
>>> @@ -334,7 +337,7 @@
>>>
>>> maximizeButton.getButtonPressListeners().add(buttonPressListener);
>>>         
>>> closeButton.getButtonPressListeners().add(buttonPressListener);
>>>
>>> -        window.add(resizeHandle);
>>> +        containerChildAccess.add(resizeHandle);
>>>
>>>        iconChanged(window, null);
>>>        titleChanged(window, null);
>>> @@ -351,7 +354,7 @@
>>>        window.getDecorators().remove(dropShadowDecorator);
>>>        dropShadowDecorator = null;
>>>
>>> -        window.remove(titleBarTablePane);
>>> +        containerChildAccess.remove(titleBarTablePane);
>>>
>>>        buttonBoxPane.remove(minimizeButton);
>>>        buttonBoxPane.remove(maximizeButton);
>>> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraMenuBarSkin.java
>>> ===================================================================
>>> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraMenuBarSkin.java
>>> (revision 801535)
>>> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraMenuBarSkin.java
>>> (working copy)
>>> @@ -20,12 +20,13 @@
>>> import java.awt.Font;
>>>
>>> import org.apache.pivot.collections.Sequence;
>>> -import org.apache.pivot.wtk.Component;
>>> +import org.apache.pivot.wtk.Container;
>>> import org.apache.pivot.wtk.Dimensions;
>>> import org.apache.pivot.wtk.GraphicsUtilities;
>>> import org.apache.pivot.wtk.MenuBar;
>>> import org.apache.pivot.wtk.MenuBarListener;
>>> import org.apache.pivot.wtk.Theme;
>>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>>> import org.apache.pivot.wtk.skin.ContainerSkin;
>>>
>>>
>>> @@ -54,10 +55,12 @@
>>>        spacing = 2;
>>>    }
>>>
>>> -    public void install(Component component) {
>>> -        super.install(component);
>>> +    @Override
>>> +    public void install(Container container,
>>> +            ContainerChildAccess containerChildAccess) {
>>> +        super.install(container, containerChildAccess);
>>>
>>> -        MenuBar menuBar = (MenuBar)component;
>>> +        MenuBar menuBar = (MenuBar)container;
>>>        menuBar.getMenuBarListeners().add(this);
>>>
>>>        menuBar.setFocusTraversalPolicy(new
>>> IndexFocusTraversalPolicy(true));
>>> Index: wtk/src/org/apache/pivot/wtk/skin/terra/ 
>>> TerraMenuPopupSkin.java
>>> ===================================================================
>>> ---
>>> wtk/src/org/apache/pivot/wtk/skin/terra/TerraMenuPopupSkin.java
>>> (revision 801535)
>>> +++
>>> wtk/src/org/apache/pivot/wtk/skin/terra/TerraMenuPopupSkin.java
>>> (working copy)
>>> @@ -34,6 +34,7 @@
>>> import org.apache.pivot.wtk.Panorama;
>>> import org.apache.pivot.wtk.Theme;
>>> import org.apache.pivot.wtk.Window;
>>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>>> import org.apache.pivot.wtk.effects.DropShadowDecorator;
>>> import org.apache.pivot.wtk.effects.Transition;
>>> import org.apache.pivot.wtk.effects.TransitionListener;
>>> @@ -124,8 +125,9 @@
>>>    }
>>>
>>>    @Override
>>> -    public void install(Component component) {
>>> -        super.install(component);
>>> +    public void install(Container component,
>>> +            ContainerChildAccess containerChildAccess) {
>>> +        super.install(component, containerChildAccess);
>>>
>>>        MenuPopup menuPopup = (MenuPopup)component;
>>>        menuPopup.getMenuPopupListeners().add(this);
>>> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraMenuSkin.java
>>> ===================================================================
>>> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraMenuSkin.java
>>> (revision 801535)
>>> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraMenuSkin.java
>>> (working copy)
>>> @@ -22,11 +22,13 @@
>>>
>>> import org.apache.pivot.collections.Sequence;
>>> import org.apache.pivot.wtk.Component;
>>> +import org.apache.pivot.wtk.Container;
>>> import org.apache.pivot.wtk.Dimensions;
>>> import org.apache.pivot.wtk.GraphicsUtilities;
>>> import org.apache.pivot.wtk.Menu;
>>> import org.apache.pivot.wtk.MenuListener;
>>> import org.apache.pivot.wtk.Theme;
>>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>>> import org.apache.pivot.wtk.skin.ContainerSkin;
>>>
>>>
>>> @@ -68,8 +70,10 @@
>>>        showKeyboardShortcuts = true;
>>>    }
>>>
>>> -    public void install(Component component) {
>>> -        super.install(component);
>>> +    @Override
>>> +    public void install(Container component,
>>> +            ContainerChildAccess containerChildAccess) {
>>> +        super.install(component, containerChildAccess);
>>>
>>>        Menu menu = (Menu)component;
>>>        menu.getMenuListeners().add(this);
>>> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraPaletteSkin.java
>>> ===================================================================
>>> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraPaletteSkin.java
>>> (revision 801535)
>>> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraPaletteSkin.java
>>> (working copy)
>>> @@ -30,6 +30,7 @@
>>> import org.apache.pivot.wtk.ButtonPressListener;
>>> import org.apache.pivot.wtk.Component;
>>> import org.apache.pivot.wtk.ComponentMouseButtonListener;
>>> +import org.apache.pivot.wtk.Container;
>>> import org.apache.pivot.wtk.Dimensions;
>>> import org.apache.pivot.wtk.Display;
>>> import org.apache.pivot.wtk.BoxPane;
>>> @@ -47,6 +48,7 @@
>>> import org.apache.pivot.wtk.VerticalAlignment;
>>> import org.apache.pivot.wtk.Window;
>>> import org.apache.pivot.wtk.WindowListener;
>>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>>> import org.apache.pivot.wtk.effects.DropShadowDecorator;
>>> import org.apache.pivot.wtk.media.Image;
>>> import org.apache.pivot.wtk.skin.WindowSkin;
>>> @@ -172,11 +174,12 @@
>>>    }
>>>
>>>    @Override
>>> -    public void install(Component component) {
>>> -        super.install(component);
>>> +    public void install(Container component,
>>> +            ContainerChildAccess containerChildAccess) {
>>> +        super.install(component, containerChildAccess);
>>>
>>>        Palette palette = (Palette)component;
>>> -        palette.add(titleBarTablePane);
>>> +        containerChildAccess.add(titleBarTablePane);
>>>
>>>        // Attach the drop-shadow decorator
>>>        dropShadowDecorator = new DropShadowDecorator(3, 3, 3);
>>> @@ -189,7 +192,7 @@
>>>    @Override
>>>    public void uninstall() {
>>>        Palette palette = (Palette)getComponent();
>>> -        palette.remove(titleBarTablePane);
>>> +        containerChildAccess.remove(titleBarTablePane);
>>>
>>>        // Detach the drop shadow decorator
>>>        palette.getDecorators().remove(dropShadowDecorator);
>>> Index: wtk/src/org/apache/pivot/wtk/skin/terra/ 
>>> TerraPanoramaSkin.java
>>> ===================================================================
>>> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraPanoramaSkin.java
>>> (revision 801535)
>>> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraPanoramaSkin.java
>>> (working copy)
>>> @@ -26,6 +26,7 @@
>>> import org.apache.pivot.wtk.Button;
>>> import org.apache.pivot.wtk.Component;
>>> import org.apache.pivot.wtk.ComponentMouseListener;
>>> +import org.apache.pivot.wtk.Container;
>>> import org.apache.pivot.wtk.Dimensions;
>>> import org.apache.pivot.wtk.GraphicsUtilities;
>>> import org.apache.pivot.wtk.Keyboard;
>>> @@ -34,6 +35,7 @@
>>> import org.apache.pivot.wtk.Theme;
>>> import org.apache.pivot.wtk.Viewport;
>>> import org.apache.pivot.wtk.ViewportListener;
>>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>>> import org.apache.pivot.wtk.content.ButtonDataRenderer;
>>> import org.apache.pivot.wtk.media.Image;
>>> import org.apache.pivot.wtk.skin.ButtonSkin;
>>> @@ -278,8 +280,9 @@
>>>    private static final int BUTTON_SIZE = 7;
>>>
>>>    @Override
>>> -    public void install(Component component) {
>>> -        super.install(component);
>>> +    public void install(Container component,
>>> +            ContainerChildAccess containerChildAccess) {
>>> +        super.install(component, containerChildAccess);
>>>
>>>        Panorama panorama = (Panorama)component;
>>>        panorama.getViewportListeners().add(this);
>>> @@ -287,16 +290,16 @@
>>>        // Add scroll arrow link buttons and attach mouse listeners
>>>        // to them; the mouse handlers should call setScrollTop() and
>>>        // setScrollLeft() on the panorama as appropriate
>>> -        panorama.add(northButton);
>>> +        containerChildAccess.add(northButton);
>>>
>>> northButton.getComponentMouseListeners().add(buttonMouseListener);
>>>
>>> -        panorama.add(southButton);
>>> +        containerChildAccess.add(southButton);
>>>
>>> southButton.getComponentMouseListeners().add(buttonMouseListener);
>>>
>>> -        panorama.add(eastButton);
>>> +        containerChildAccess.add(eastButton);
>>>
>>> eastButton.getComponentMouseListeners().add(buttonMouseListener);
>>>
>>> -        panorama.add(westButton);
>>> +        containerChildAccess.add(westButton);
>>>
>>> westButton.getComponentMouseListeners().add(buttonMouseListener);
>>>
>>>        updateScrollButtonVisibility();
>>> @@ -308,10 +311,10 @@
>>>        panorama.getViewportListeners().remove(this);
>>>
>>>        // Remove scroll arrow link buttons
>>> -        panorama.remove(northButton);
>>> -        panorama.remove(southButton);
>>> -        panorama.remove(eastButton);
>>> -        panorama.remove(westButton);
>>> +        containerChildAccess.remove(northButton);
>>> +        containerChildAccess.remove(southButton);
>>> +        containerChildAccess.remove(eastButton);
>>> +        containerChildAccess.remove(westButton);
>>>    }
>>>
>>>    @Override
>>> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraPromptSkin.java
>>> ===================================================================
>>> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraPromptSkin.java
>>> (revision 801535)
>>> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraPromptSkin.java
>>> (working copy)
>>> @@ -22,6 +22,7 @@
>>> import org.apache.pivot.wtk.ButtonPressListener;
>>> import org.apache.pivot.wtk.Component;
>>> import org.apache.pivot.wtk.BoxPane;
>>> +import org.apache.pivot.wtk.Container;
>>> import org.apache.pivot.wtk.ImageView;
>>> import org.apache.pivot.wtk.Label;
>>> import org.apache.pivot.wtk.Prompt;
>>> @@ -29,6 +30,7 @@
>>> import org.apache.pivot.wtk.PushButton;
>>> import org.apache.pivot.wtk.Theme;
>>> import org.apache.pivot.wtk.Window;
>>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>>> import org.apache.pivot.wtkx.WTKXSerializer;
>>>
>>>
>>> @@ -48,8 +50,9 @@
>>>    }
>>>
>>>    @Override
>>> -    public void install(Component component) {
>>> -        super.install(component);
>>> +    public void install(Container component,
>>> +            ContainerChildAccess containerChildAccess) {
>>> +        super.install(component, containerChildAccess);
>>>
>>>        Prompt prompt = (Prompt)component;
>>>        prompt.getPromptListeners().add(this);
>>> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraRollupSkin.java
>>> ===================================================================
>>> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraRollupSkin.java
>>> (revision 801535)
>>> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraRollupSkin.java
>>> (working copy)
>>> @@ -25,12 +25,14 @@
>>> import org.apache.pivot.util.Vote;
>>> import org.apache.pivot.wtk.Component;
>>> import org.apache.pivot.wtk.ComponentMouseButtonListener;
>>> +import org.apache.pivot.wtk.Container;
>>> import org.apache.pivot.wtk.Cursor;
>>> import org.apache.pivot.wtk.Dimensions;
>>> import org.apache.pivot.wtk.GraphicsUtilities;
>>> import org.apache.pivot.wtk.Mouse;
>>> import org.apache.pivot.wtk.Rollup;
>>> import org.apache.pivot.wtk.Theme;
>>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>>> import org.apache.pivot.wtk.effects.Transition;
>>> import org.apache.pivot.wtk.effects.TransitionListener;
>>> import org.apache.pivot.wtk.effects.easing.Easing;
>>> @@ -204,14 +206,15 @@
>>>    }
>>>
>>>    @Override
>>> -    public void install(Component component) {
>>> -        super.install(component);
>>> +    public void install(Container component,
>>> +            ContainerChildAccess containerChildAccess) {
>>> +        super.install(component, containerChildAccess);
>>>
>>>        Rollup rollup = (Rollup)component;
>>>
>>>        // Add the rollup button
>>>        rollupButton = new RollupButton();
>>> -        rollup.add(rollupButton);
>>> +        containerChildAccess.add(rollupButton);
>>>
>>>        // Initialize state
>>>        headingChanged(rollup, null);
>>> @@ -229,7 +232,7 @@
>>>        }
>>>
>>>        // Remove the rollup button
>>> -        rollup.remove(rollupButton);
>>> +        containerChildAccess.remove(rollupButton);
>>>        rollupButton = null;
>>>
>>>        super.uninstall();
>>> Index: wtk/src/org/apache/pivot/wtk/skin/terra/ 
>>> TerraScrollBarSkin.java
>>> ===================================================================
>>> ---
>>> wtk/src/org/apache/pivot/wtk/skin/terra/TerraScrollBarSkin.java
>>> (revision 801535)
>>> +++
>>> wtk/src/org/apache/pivot/wtk/skin/terra/TerraScrollBarSkin.java
>>> (working copy)
>>> @@ -25,6 +25,7 @@
>>>
>>> import org.apache.pivot.wtk.ApplicationContext;
>>> import org.apache.pivot.wtk.Component;
>>> +import org.apache.pivot.wtk.Container;
>>> import org.apache.pivot.wtk.Dimensions;
>>> import org.apache.pivot.wtk.GraphicsUtilities;
>>> import org.apache.pivot.wtk.Mouse;
>>> @@ -33,6 +34,7 @@
>>> import org.apache.pivot.wtk.ScrollBarListener;
>>> import org.apache.pivot.wtk.ScrollBarValueListener;
>>> import org.apache.pivot.wtk.Theme;
>>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>>> import org.apache.pivot.wtk.media.Image;
>>> import org.apache.pivot.wtk.skin.ComponentSkin;
>>> import org.apache.pivot.wtk.skin.ContainerSkin;
>>> @@ -602,16 +604,17 @@
>>>    }
>>>
>>>    @Override
>>> -    public void install(Component component) {
>>> -        super.install(component);
>>> +    public void install(Container component,
>>> +            ContainerChildAccess containerChildAccess) {
>>> +        super.install(component, containerChildAccess);
>>>
>>>        ScrollBar scrollBar = (ScrollBar)component;
>>>        scrollBar.getScrollBarListeners().add(this);
>>>        scrollBar.getScrollBarValueListeners().add(this);
>>>
>>> -        scrollBar.add(scrollUpButton);
>>> -        scrollBar.add(scrollDownButton);
>>> -        scrollBar.add(handle);
>>> +        containerChildAccess.add(scrollUpButton);
>>> +        containerChildAccess.add(scrollDownButton);
>>> +        containerChildAccess.add(handle);
>>>
>>>        setBackgroundColor(9);
>>>
>>> @@ -624,9 +627,9 @@
>>>        scrollBar.getScrollBarListeners().remove(this);
>>>        scrollBar.getScrollBarValueListeners().remove(this);
>>>
>>> -        scrollBar.remove(scrollUpButton);
>>> -        scrollBar.remove(scrollDownButton);
>>> -        scrollBar.remove(handle);
>>> +        containerChildAccess.remove(scrollUpButton);
>>> +        containerChildAccess.remove(scrollDownButton);
>>> +        containerChildAccess.remove(handle);
>>>
>>>        super.uninstall();
>>>    }
>>> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraSheetSkin.java
>>> ===================================================================
>>> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraSheetSkin.java
>>> (revision 801535)
>>> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraSheetSkin.java
>>> (working copy)
>>> @@ -23,6 +23,7 @@
>>> import org.apache.pivot.util.Vote;
>>> import org.apache.pivot.wtk.Component;
>>> import org.apache.pivot.wtk.ComponentListener;
>>> +import org.apache.pivot.wtk.Container;
>>> import org.apache.pivot.wtk.Dimensions;
>>> import org.apache.pivot.wtk.GraphicsUtilities;
>>> import org.apache.pivot.wtk.Insets;
>>> @@ -33,6 +34,7 @@
>>> import org.apache.pivot.wtk.SheetStateListener;
>>> import org.apache.pivot.wtk.Theme;
>>> import org.apache.pivot.wtk.Window;
>>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>>> import org.apache.pivot.wtk.effects.DropShadowDecorator;
>>> import org.apache.pivot.wtk.effects.Transition;
>>> import org.apache.pivot.wtk.effects.TransitionListener;
>>> @@ -104,8 +106,9 @@
>>>    }
>>>
>>>    @Override
>>> -    public void install(Component component) {
>>> -        super.install(component);
>>> +    public void install(Container component,
>>> +            ContainerChildAccess containerChildAccess) {
>>> +        super.install(component, containerChildAccess);
>>>
>>>        Sheet sheet = (Sheet)component;
>>>        sheet.getSheetStateListeners().add(this);
>>> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraSliderSkin.java
>>> ===================================================================
>>> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraSliderSkin.java
>>> (revision 801535)
>>> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraSliderSkin.java
>>> (working copy)
>>> @@ -22,6 +22,7 @@
>>> import java.awt.RenderingHints;
>>>
>>> import org.apache.pivot.wtk.Component;
>>> +import org.apache.pivot.wtk.Container;
>>> import org.apache.pivot.wtk.Dimensions;
>>> import org.apache.pivot.wtk.GraphicsUtilities;
>>> import org.apache.pivot.wtk.Mouse;
>>> @@ -29,6 +30,7 @@
>>> import org.apache.pivot.wtk.Point;
>>> import org.apache.pivot.wtk.Slider;
>>> import org.apache.pivot.wtk.Theme;
>>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>>> import org.apache.pivot.wtk.skin.ComponentSkin;
>>> import org.apache.pivot.wtk.skin.SliderSkin;
>>>
>>> @@ -211,16 +213,17 @@
>>>    }
>>>
>>>    @Override
>>> -    public void install(Component component) {
>>> -        super.install(component);
>>> +    public void install(Container component,
>>> +            ContainerChildAccess containerChildAccess) {
>>> +        super.install(component, containerChildAccess);
>>>
>>>        Slider slider = (Slider)component;
>>> -        slider.add(thumb);
>>> +        containerChildAccess.add(thumb);
>>>    }
>>>
>>>    public void uninstall() {
>>>        Slider slider = (Slider)getComponent();
>>> -        slider.remove(thumb);
>>> +        containerChildAccess.remove(thumb);
>>>
>>>        super.uninstall();
>>>    }
>>> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraSpinnerSkin.java
>>> ===================================================================
>>> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraSpinnerSkin.java
>>> (revision 801535)
>>> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraSpinnerSkin.java
>>> (working copy)
>>> @@ -28,6 +28,7 @@
>>> import org.apache.pivot.wtk.ApplicationContext;
>>> import org.apache.pivot.wtk.Bounds;
>>> import org.apache.pivot.wtk.Component;
>>> +import org.apache.pivot.wtk.Container;
>>> import org.apache.pivot.wtk.Dimensions;
>>> import org.apache.pivot.wtk.GraphicsUtilities;
>>> import org.apache.pivot.wtk.Keyboard;
>>> @@ -37,6 +38,7 @@
>>> import org.apache.pivot.wtk.SpinnerListener;
>>> import org.apache.pivot.wtk.SpinnerSelectionListener;
>>> import org.apache.pivot.wtk.Theme;
>>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>>> import org.apache.pivot.wtk.media.Image;
>>> import org.apache.pivot.wtk.skin.ComponentSkin;
>>> import org.apache.pivot.wtk.skin.ContainerSkin;
>>> @@ -512,16 +514,17 @@
>>>    }
>>>
>>>    @Override
>>> -    public void install(Component component) {
>>> -        super.install(component);
>>> +    public void install(Container component,
>>> +            ContainerChildAccess containerChildAccess) {
>>> +        super.install(component, containerChildAccess);
>>>
>>>        Spinner spinner = (Spinner)component;
>>>        spinner.getSpinnerListeners().add(this);
>>>        spinner.getSpinnerSelectionListeners().add(this);
>>>
>>> -        spinner.add(spinnerContent);
>>> -        spinner.add(upButton);
>>> -        spinner.add(downButton);
>>> +        containerChildAccess.add(spinnerContent);
>>> +        containerChildAccess.add(upButton);
>>> +        containerChildAccess.add(downButton);
>>>    }
>>>
>>>    @Override
>>> @@ -530,9 +533,9 @@
>>>        spinner.getSpinnerListeners().remove(this);
>>>        spinner.getSpinnerSelectionListeners().remove(this);
>>>
>>> -        spinner.remove(spinnerContent);
>>> -        spinner.remove(upButton);
>>> -        spinner.remove(downButton);
>>> +        containerChildAccess.remove(spinnerContent);
>>> +        containerChildAccess.remove(upButton);
>>> +        containerChildAccess.remove(downButton);
>>>
>>>        super.uninstall();
>>>    }
>>> Index: wtk/src/org/apache/pivot/wtk/skin/terra/ 
>>> TerraSplitPaneSkin.java
>>> ===================================================================
>>> ---
>>> wtk/src/org/apache/pivot/wtk/skin/terra/TerraSplitPaneSkin.java
>>> (revision 801535)
>>> +++
>>> wtk/src/org/apache/pivot/wtk/skin/terra/TerraSplitPaneSkin.java
>>> (working copy)
>>> @@ -21,6 +21,7 @@
>>> import java.awt.Graphics2D;
>>>
>>> import org.apache.pivot.wtk.Component;
>>> +import org.apache.pivot.wtk.Container;
>>> import org.apache.pivot.wtk.Cursor;
>>> import org.apache.pivot.wtk.Dimensions;
>>> import org.apache.pivot.wtk.GraphicsUtilities;
>>> @@ -30,6 +31,7 @@
>>> import org.apache.pivot.wtk.SplitPane;
>>> import org.apache.pivot.wtk.SplitPaneListener;
>>> import org.apache.pivot.wtk.Theme;
>>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>>> import org.apache.pivot.wtk.skin.ComponentSkin;
>>> import org.apache.pivot.wtk.skin.ContainerSkin;
>>>
>>> @@ -186,7 +188,7 @@
>>>                if (useShadow) {
>>>                    // Add the shadow to the split pane and lay it  
>>> out
>>>                    shadow = new SplitterShadow();
>>> -                    splitPane.add(shadow);
>>> +                    containerChildAccess.add(shadow);
>>>
>>>                    if (orientation == Orientation.HORIZONTAL) {
>>>                        shadow.setLocation(component.getX(), 0);
>>> @@ -224,7 +226,7 @@
>>>
>>>                    splitPane.setSplitLocation(splitLocation);
>>>
>>> -                    splitPane.remove(shadow);
>>> +                    containerChildAccess.remove(shadow);
>>>                    shadow = null;
>>>                }
>>>
>>> @@ -318,13 +320,14 @@
>>>    }
>>>
>>>    @Override
>>> -    public void install(Component component) {
>>> -        super.install(component);
>>> +    public void install(Container component,
>>> +            ContainerChildAccess containerChildAccess) {
>>> +        super.install(component, containerChildAccess);
>>>
>>>        SplitPane splitPane = (SplitPane)component;
>>>        splitPane.getSplitPaneListeners().add(this);
>>>
>>> -        splitPane.add(splitter);
>>> +        containerChildAccess.add(splitter);
>>>        updateSplitterCursor();
>>>    }
>>>
>>> @@ -333,7 +336,7 @@
>>>        SplitPane splitPane = (SplitPane)getComponent();
>>>        splitPane.getSplitPaneListeners().remove(this);
>>>
>>> -        splitPane.remove(splitter);
>>> +        containerChildAccess.remove(splitter);
>>>
>>>        super.uninstall();
>>>    }
>>> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraTabPaneSkin.java
>>> ===================================================================
>>> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraTabPaneSkin.java
>>> (revision 801535)
>>> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraTabPaneSkin.java
>>> (working copy)
>>> @@ -28,6 +28,7 @@
>>> import org.apache.pivot.wtk.Button;
>>> import org.apache.pivot.wtk.Component;
>>> import org.apache.pivot.wtk.ComponentStateListener;
>>> +import org.apache.pivot.wtk.Container;
>>> import org.apache.pivot.wtk.Dimensions;
>>> import org.apache.pivot.wtk.BoxPane;
>>> import org.apache.pivot.wtk.GraphicsUtilities;
>>> @@ -43,6 +44,7 @@
>>> import org.apache.pivot.wtk.Theme;
>>> import org.apache.pivot.wtk.VerticalAlignment;
>>> import org.apache.pivot.wtk.Button.Group;
>>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>>> import org.apache.pivot.wtk.content.ButtonData;
>>> import org.apache.pivot.wtk.content.ButtonDataRenderer;
>>> import org.apache.pivot.wtk.effects.Transition;
>>> @@ -409,8 +411,10 @@
>>>        setButtonSpacing(2);
>>>    }
>>>
>>> -    public void install(Component component) {
>>> -        super.install(component);
>>> +    @Override
>>> +    public void install(Container component,
>>> +            ContainerChildAccess containerChildAccess) {
>>> +        super.install(component, containerChildAccess);
>>>
>>>        TabPane tabPane = (TabPane)component;
>>>
>>> @@ -420,7 +424,7 @@
>>>        tabPane.getTabPaneAttributeListeners().add(this);
>>>
>>>        // Add the tab buttons
>>> -        tabPane.add(buttonPanorama);
>>> +        containerChildAccess.add(buttonPanorama);
>>>
>>>        Sequence<Component> tabs = tabPane.getTabs();
>>>        int selectedIndex = tabPane.getSelectedIndex();
>>> @@ -455,7 +459,7 @@
>>>        }
>>>
>>>        // Remove the tab buttons
>>> -        tabPane.remove(buttonPanorama);
>>> +        containerChildAccess.remove(buttonPanorama);
>>>
>>>        super.uninstall();
>>>    }
>>> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraTooltipSkin.java
>>> ===================================================================
>>> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraTooltipSkin.java
>>> (revision 801535)
>>> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraTooltipSkin.java
>>> (working copy)
>>> @@ -33,6 +33,7 @@
>>> import org.apache.pivot.wtk.Tooltip;
>>> import org.apache.pivot.wtk.TooltipListener;
>>> import org.apache.pivot.wtk.Window;
>>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>>> import org.apache.pivot.wtk.effects.DropShadowDecorator;
>>> import org.apache.pivot.wtk.effects.Transition;
>>> import org.apache.pivot.wtk.effects.TransitionListener;
>>> @@ -113,8 +114,9 @@
>>>    }
>>>
>>>    @Override
>>> -    public void install(Component component) {
>>> -        super.install(component);
>>> +    public void install(Container component,
>>> +            ContainerChildAccess containerChildAccess) {
>>> +        super.install(component, containerChildAccess);
>>>
>>>        Tooltip tooltip = (Tooltip)component;
>>>
>>> Index: wtk/test/org/apache/pivot/wtk/test/CardPaneTest.java
>>> ===================================================================
>>> --- wtk/test/org/apache/pivot/wtk/test/CardPaneTest.java     
>>> (revision
>>> 801535)
>>> +++ wtk/test/org/apache/pivot/wtk/test/CardPaneTest.java    (working
>>> copy)
>>> @@ -51,7 +51,7 @@
>>>        sizeGroup.getGroupListeners().add(new  
>>> Button.GroupListener() {
>>>            public void selectionChanged(Button.Group buttonGroup,
>>> Button previousSelection) {
>>>                final Button selection = buttonGroup.getSelection();
>>> -                int selectedIndex = selection == null ? -1 :
>>> selection.getParent().indexOf(selection);
>>> +                int selectedIndex = selection == null ? -1 :
>>> ((CardPane)selection.getParent()).indexOf(selection);
>>>
>>>                cardPane.getCardPaneListeners().add(new
>>> CardPaneListener.Adapter() {
>>>                    public Vote previewSelectedIndexChange(CardPane
>>> cardPane, int selectedIndex) {
>>
>>
>


Re: reducing container APIs

Posted by Noel Grandin <no...@gmail.com>.
Hi

Yeah, but it's also a design principle to only expose what you WANT to
expose and are prepared to support.

For myself, I frequently design custom Swing components where I override
addImpl() and setLayout() to prevent anyone from messing with my components.
Very important when your code is used by a variety of people who do
crazy stuff (often unintentionally).

With the code I posted, people could still subclass stuff and get at the
internals, but that way, they are more obviously at fault when something
goes wrong.

Anyhow, just another idea, I'm not worried about it being rejected :-)

Regards, Noel.

Greg Brown wrote:
> It's an interesting idea for sure. But, to me, it seems just a bit
> over-designed. There are lots of different ways a careless developer
> might shoot himself in the foot. We can't protect developers from
> absolutely every potential for code misuse.
>
> We also try not to impose too many restrictions on developers. Yes, it
> incurs more potential for error, but it also maximizes flexibility. So
> I would not be in favor of this change.
>
> G
>
>
> On Aug 6, 2009, at 7:16 AM, Noel Grandin wrote:
>
>> Hi
>>
>> I've always felt uncomfortable with the degree of access that user
>> code has to a Container's child Components.
>>
>> So I borrowed a trick from the Object Capability guys and came up
>> with the following patch.
>>
>> Basically, what it does it to hand a special object to the Skin class
>> so that it has privileged access to the Container's children.
>>
>> In this way, Container subclasses can decide for themselves what
>> degree of access they wish to permit to user code.
>>
>> Comments?
>>
>> Regards, Noel.
>>
>> Property changes on: .
>> ___________________________________________________________________
>> Added: svn:ignore
>>   + .classpath
>> .project
>> baseline.june8.2.patch
>> baseline.june8.patch
>> baseline.june9.2.patch
>> baseline.june9.patch
>> .settings
>>
>>
>> Index:
>> tutorials/src/org/apache/pivot/tutorials/transition/Transitions.java
>> ===================================================================
>> ---
>> tutorials/src/org/apache/pivot/tutorials/transition/Transitions.java   
>> (revision 801535)
>> +++
>> tutorials/src/org/apache/pivot/tutorials/transition/Transitions.java   
>> (working copy)
>> @@ -18,6 +18,7 @@
>>
>> import org.apache.pivot.collections.Map;
>> import org.apache.pivot.wtk.Application;
>> +import org.apache.pivot.wtk.BoxPane;
>> import org.apache.pivot.wtk.Button;
>> import org.apache.pivot.wtk.ButtonPressListener;
>> import org.apache.pivot.wtk.Component;
>> @@ -61,7 +62,7 @@
>>
>>                             if (!transition.isReversed()) {
>>                                 Component component =
>> collapseTransition.getComponent();
>> -                               
>> component.getParent().remove(component);
>> +                               
>> ((BoxPane)component.getParent()).remove(component);
>>                             }
>>
>>                             Transitions.this.collapseTransition = null;
>> Index: wtk/src/org/apache/pivot/wtk/BoxPane.java
>> ===================================================================
>> --- wtk/src/org/apache/pivot/wtk/BoxPane.java    (revision 801535)
>> +++ wtk/src/org/apache/pivot/wtk/BoxPane.java    (working copy)
>> @@ -24,7 +24,7 @@
>>  *
>>  * @author gbrown
>>  */
>> -public class BoxPane extends Container {
>> +public class BoxPane extends SequenceContainer {
>>     private static class BoxPaneListenerList extends
>> ListenerList<BoxPaneListener>
>>         implements BoxPaneListener {
>>         public void orientationChanged(BoxPane boxPane) {
>> Index: wtk/src/org/apache/pivot/wtk/CardPane.java
>> ===================================================================
>> --- wtk/src/org/apache/pivot/wtk/CardPane.java    (revision 801535)
>> +++ wtk/src/org/apache/pivot/wtk/CardPane.java    (working copy)
>> @@ -27,7 +27,7 @@
>>  *
>>  * @author gbrown
>>  */
>> -public class CardPane extends Container {
>> +public class CardPane extends SequenceContainer {
>>     private static class CardPaneListenerList extends
>> ListenerList<CardPaneListener>
>>         implements CardPaneListener {
>>         public Vote previewSelectedIndexChange(CardPane cardPane, int
>> selectedIndex) {
>> Index: wtk/src/org/apache/pivot/wtk/Container.java
>> ===================================================================
>> --- wtk/src/org/apache/pivot/wtk/Container.java    (revision 801535)
>> +++ wtk/src/org/apache/pivot/wtk/Container.java    (working copy)
>> @@ -46,8 +46,55 @@
>>  *
>>  * @author gbrown
>>  */
>> -public abstract class Container extends Component
>> -    implements Sequence<Component>, Iterable<Component> {
>> +public abstract class Container extends Component {
>> +
>> +    /**
>> +     * This class is used to give privileged access to the children
>> of the container to the skin class.
>> +     * (an example of the Object Capability pattern).
>> +     *
>> +     * Subclasses of container normally want finer control over how
>> they expose their children, so they
>> +     * can define more specific methods for setting/modifying children.
>> +     *
>> +     * @author Noel Grandin
>> +     */
>> +    public final class ContainerChildAccess implements
>> Sequence<Component>, Iterable<Component> {
>> +        public Component update(int index, Component component) {
>> +            return Container.this.update(index, component);
>> +        }
>> +
>> +        public int indexOf(Component component) {
>> +            return Container.this.indexOf(component);
>> +        }
>> +
>> +        public final int remove(Component component) {
>> +            return Container.this.remove(component);
>> +        }
>> +
>> +        public Sequence<Component> remove(int index, int count) {
>> +            return Container.this.remove(index, count);
>> +        }
>> +
>> +        public int getLength() {
>> +            return Container.this.getLength();
>> +        }
>> +
>> +        public final int add(Component component) {
>> +            return Container.this.add(component);
>> +        }
>> +
>> +        public Component get(int index) {
>> +            return Container.this.get(index);
>> +        }
>> +
>> +        public void insert(Component component, int index) {
>> +            Container.this.insert(component, index);
>> +        }
>> +
>> +        public Iterator<Component> iterator() {
>> +            return Container.this.iterator();
>> +        }
>> +    }
>> +
>>     private static class ContainerListenerList extends
>> ListenerList<ContainerListener>
>>         implements ContainerListener {
>>         public void componentInserted(Container container, int index) {
>> @@ -134,15 +181,31 @@
>>
>>     private ContainerListenerList containerListeners = new
>> ContainerListenerList();
>>     private ContainerMouseListenerList containerMouseListeners = new
>> ContainerMouseListenerList();
>> +    private final ContainerChildAccess containerChildAccess = new
>> ContainerChildAccess();
>> +
>> +    /**
>> +     * Sets the skin, replacing any previous skin.
>> +     *
>> +     * @param skin
>> +     * The new skin.
>> +     */
>> +    protected final void
>> setSkin(org.apache.pivot.wtk.skin.ContainerSkin skin) {
>> +        super.setSkin(skin);
>> +
>> +        skin.install(this, containerChildAccess);
>>
>> -    public final int add(Component component) {
>> +        invalidate();
>> +        repaint();
>> +    }
>> +
>> +    protected int add(Component component) {
>>         int i = getLength();
>>         insert(component, i);
>>
>>         return i;
>>     }
>>
>> -    public void insert(Component component, int index) {
>> +    protected void insert(Component component, int index) {
>>         if (component == null) {
>>             throw new IllegalArgumentException("component is null.");
>>         }
>> @@ -167,11 +230,11 @@
>>         containerListeners.componentInserted(Container.this, index);
>>     }
>>
>> -    public Component update(int index, Component component) {
>> +    protected Component update(int index, Component component) {
>>         throw new UnsupportedOperationException();
>>     }
>>
>> -    public final int remove(Component component) {
>> +    protected int remove(Component component) {
>>         int index = indexOf(component);
>>         if (index != -1) {
>>             remove(index, 1);
>> @@ -180,7 +243,7 @@
>>         return index;
>>     }
>>
>> -    public Sequence<Component> remove(int index, int count) {
>> +    protected Sequence<Component> remove(int index, int count) {
>>         Sequence<Component> removed = components.remove(index, count);
>>
>>         // Set the removed components' parent to null and repaint the
>> area
>> @@ -208,7 +271,7 @@
>>         return removed;
>>     }
>>
>> -    public final Sequence<Component> removeAll() {
>> +    protected final Sequence<Component> removeAll() {
>>         return remove(0, getLength());
>>     }
>>
>> @@ -221,7 +284,7 @@
>>      * @param from
>>      * @param to
>>      */
>> -    protected void move(int from, int to) {
>> +    protected final void move(int from, int to) {
>>         if (from != to) {
>>             Sequence<Component> removed = components.remove(from, 1);
>>             Component component = removed.get(0);
>> @@ -232,19 +295,19 @@
>>         }
>>     }
>>
>> -    public Component get(int index) {
>> +    protected Component get(int index) {
>>         return components.get(index);
>>     }
>>
>> -    public int indexOf(Component component) {
>> +    protected int indexOf(Component component) {
>>         return components.indexOf(component);
>>     }
>>
>> -    public int getLength() {
>> +    protected int getLength() {
>>         return components.getLength();
>>     }
>>
>> -    public Iterator<Component> iterator() {
>> +    protected Iterator<Component> iterator() {
>>         return new ImmutableIterator<Component>(components.iterator());
>>     }
>>
>> Index: wtk/src/org/apache/pivot/wtk/FlowPane.java
>> ===================================================================
>> --- wtk/src/org/apache/pivot/wtk/FlowPane.java    (revision 801535)
>> +++ wtk/src/org/apache/pivot/wtk/FlowPane.java    (working copy)
>> @@ -22,7 +22,7 @@
>>  *
>>  * @author gbrown
>>  */
>> -public class FlowPane extends Container {
>> +public class FlowPane extends SequenceContainer {
>>     public FlowPane() {
>>         installSkin(FlowPane.class);
>>     }
>> Index: wtk/src/org/apache/pivot/wtk/SequenceContainer.java
>> ===================================================================
>> --- wtk/src/org/apache/pivot/wtk/SequenceContainer.java    (revision 0)
>> +++ wtk/src/org/apache/pivot/wtk/SequenceContainer.java    (revision 0)
>> @@ -0,0 +1,81 @@
>> +package org.apache.pivot.wtk;
>> +
>> +import java.util.Iterator;
>> +
>> +import org.apache.pivot.collections.Sequence;
>> +
>> +/**
>> + * Utility base class for those Container subclasses which want to
>> expose their children in a straight-forward way.
>> + *
>> + * @author Noel Grandin
>> + */
>> +public class SequenceContainer extends Container implements
>> Sequence<Component>, Iterable<Component> {
>> +
>> +    public Component update(int index, Component component) {
>> +        throw new UnsupportedOperationException();
>> +    }
>> +
>> +    /**
>> +     * override and make public
>> +     */
>> +    @Override
>> +    public int indexOf(Component component) {
>> +        return super.indexOf(component);
>> +    }
>> +
>> +    /**
>> +     * override and make public
>> +     */
>> +    @Override
>> +    public final int remove(Component component) {
>> +        return super.remove(component);
>> +    }
>> +
>> +    /**
>> +     * override and make public
>> +     */
>> +    @Override
>> +    public Sequence<Component> remove(int index, int count) {
>> +        return super.remove(index, count);
>> +    }
>> +
>> +    /**
>> +     * override and make public
>> +     */
>> +    @Override
>> +    public int getLength() {
>> +        return super.getLength();
>> +    }
>> +
>> +    /**
>> +     * override and make public
>> +     */
>> +    @Override
>> +    public final int add(Component component) {
>> +        return super.add(component);
>> +    }
>> +
>> +    /**
>> +     * override and make public
>> +     */
>> +    @Override
>> +    public Component get(int index) {
>> +        return super.get(index);
>> +    }
>> +
>> +    /**
>> +     * override and make public
>> +     */
>> +    @Override
>> +    public void insert(Component component, int index) {
>> +        super.insert(component, index);
>> +    }
>> +
>> +    /**
>> +     * override and make public
>> +     */
>> +    @Override
>> +    public final Iterator<Component> iterator() {
>> +        return super.iterator();
>> +    }
>> +}
>> Index: wtk/src/org/apache/pivot/wtk/skin/BorderSkin.java
>> ===================================================================
>> --- wtk/src/org/apache/pivot/wtk/skin/BorderSkin.java    (revision
>> 801535)
>> +++ wtk/src/org/apache/pivot/wtk/skin/BorderSkin.java    (working copy)
>> @@ -31,12 +31,14 @@
>> import org.apache.pivot.wtk.Border;
>> import org.apache.pivot.wtk.BorderListener;
>> import org.apache.pivot.wtk.Component;
>> +import org.apache.pivot.wtk.Container;
>> import org.apache.pivot.wtk.CornerRadii;
>> import org.apache.pivot.wtk.Dimensions;
>> import org.apache.pivot.wtk.GraphicsUtilities;
>> import org.apache.pivot.wtk.Insets;
>> import org.apache.pivot.wtk.Platform;
>> import org.apache.pivot.wtk.Theme;
>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>>
>>
>> /**
>> @@ -71,10 +73,11 @@
>>     }
>>
>>     @Override
>> -    public void install(Component component) {
>> -        super.install(component);
>> +    public void install(Container container,
>> +            ContainerChildAccess containerChildAccess) {
>> +        super.install(container, containerChildAccess);
>>
>> -        Border border = (Border)component;
>> +        Border border = (Border)container;
>>         border.getBorderListeners().add(this);
>>     }
>>
>> Index: wtk/src/org/apache/pivot/wtk/skin/BoxPaneSkin.java
>> ===================================================================
>> --- wtk/src/org/apache/pivot/wtk/skin/BoxPaneSkin.java    (revision
>> 801535)
>> +++ wtk/src/org/apache/pivot/wtk/skin/BoxPaneSkin.java    (working copy)
>> @@ -18,6 +18,7 @@
>>
>> import org.apache.pivot.collections.Dictionary;
>> import org.apache.pivot.wtk.Component;
>> +import org.apache.pivot.wtk.Container;
>> import org.apache.pivot.wtk.Dimensions;
>> import org.apache.pivot.wtk.BoxPane;
>> import org.apache.pivot.wtk.BoxPaneListener;
>> @@ -25,6 +26,7 @@
>> import org.apache.pivot.wtk.Insets;
>> import org.apache.pivot.wtk.Orientation;
>> import org.apache.pivot.wtk.VerticalAlignment;
>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>>
>> /**
>>  * Box pane skin.
>> @@ -43,10 +45,11 @@
>>     private boolean fill = false;
>>
>>     @Override
>> -    public void install(Component component) {
>> -        super.install(component);
>> +    public void install(Container container,
>> +            ContainerChildAccess containerChildAccess) {
>> +        super.install(container, containerChildAccess);
>>
>> -        BoxPane boxPane = (BoxPane)component;
>> +        BoxPane boxPane = (BoxPane)container;
>>         boxPane.getBoxPaneListeners().add(this);
>>     }
>>
>> Index: wtk/src/org/apache/pivot/wtk/skin/CalendarSkin.java
>> ===================================================================
>> --- wtk/src/org/apache/pivot/wtk/skin/CalendarSkin.java    (revision
>> 801535)
>> +++ wtk/src/org/apache/pivot/wtk/skin/CalendarSkin.java    (working
>> copy)
>> @@ -19,8 +19,8 @@
>> import org.apache.pivot.wtk.Calendar;
>> import org.apache.pivot.wtk.CalendarListener;
>> import org.apache.pivot.wtk.CalendarSelectionListener;
>> -import org.apache.pivot.wtk.Component;
>> -import org.apache.pivot.wtk.skin.ContainerSkin;
>> +import org.apache.pivot.wtk.Container;
>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>>
>> /**
>>  * Abstract base class for calendar skins.
>> @@ -30,10 +30,11 @@
>> public abstract class CalendarSkin extends ContainerSkin
>>     implements CalendarListener, CalendarSelectionListener {
>>     @Override
>> -    public void install(Component component) {
>> -        super.install(component);
>> +    public void install(Container container,
>> +            ContainerChildAccess containerChildAccess) {
>> +        super.install(container, containerChildAccess);
>>
>> -        Calendar calendar = (Calendar)component;
>> +        Calendar calendar = (Calendar)container;
>>         calendar.getCalendarListeners().add(this);
>>         calendar.getCalendarSelectionListeners().add(this);
>>     }
>> Index: wtk/src/org/apache/pivot/wtk/skin/CardPaneSkin.java
>> ===================================================================
>> --- wtk/src/org/apache/pivot/wtk/skin/CardPaneSkin.java    (revision
>> 801535)
>> +++ wtk/src/org/apache/pivot/wtk/skin/CardPaneSkin.java    (working
>> copy)
>> @@ -26,6 +26,7 @@
>> import org.apache.pivot.wtk.Dimensions;
>> import org.apache.pivot.wtk.Insets;
>> import org.apache.pivot.wtk.Orientation;
>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>> import org.apache.pivot.wtk.effects.FadeDecorator;
>> import org.apache.pivot.wtk.effects.ScaleDecorator;
>> import org.apache.pivot.wtk.effects.Transition;
>> @@ -74,9 +75,8 @@
>>             this.from = from;
>>             this.to = to;
>>
>> -            CardPane cardPane = (CardPane)getComponent();
>> -            fromCard = (from == -1) ? null : cardPane.get(from);
>> -            toCard = (to == -1) ? null : cardPane.get(to);
>> +            fromCard = (from == -1) ? null :
>> containerChildAccess.get(from);
>> +            toCard = (to == -1) ? null : containerChildAccess.get(to);
>>         }
>>     }
>>
>> @@ -305,10 +305,11 @@
>>     public static final int SELECTION_CHANGE_RATE = 30;
>>
>>     @Override
>> -    public void install(Component component) {
>> -        super.install(component);
>> +    public void install(Container container,
>> +            ContainerChildAccess containerChildAccess) {
>> +        super.install(container, containerChildAccess);
>>
>> -        CardPane cardPane = (CardPane)component;
>> +        CardPane cardPane = (CardPane)container;
>>         cardPane.getCardPaneListeners().add(this);
>>     }
>>
>> @@ -328,8 +329,7 @@
>>             Dimensions preferredSize = getPreferredSize();
>>             preferredWidth = preferredSize.width;
>>         } else {
>> -            CardPane cardPane = (CardPane)getComponent();
>> -            for (Component card : cardPane) {
>> +            for (Component card : containerChildAccess) {
>>                 preferredWidth = Math.max(preferredWidth,
>> card.getPreferredWidth(height));
>>             }
>>
>> @@ -347,8 +347,7 @@
>>             Dimensions preferredSize = getPreferredSize();
>>             preferredHeight = preferredSize.height;
>>         } else {
>> -            CardPane cardPane = (CardPane)getComponent();
>> -            for (Component card : cardPane) {
>> +            for (Component card : containerChildAccess) {
>>                 preferredHeight = Math.max(preferredHeight,
>> card.getPreferredHeight(width));
>>             }
>>
>> @@ -402,7 +401,7 @@
>>                 preferredHeight = previousHeight + (int)((height -
>> previousHeight) * percentComplete);
>>             }
>>         } else {
>> -            for (Component card : cardPane) {
>> +            for (Component card : containerChildAccess) {
>>                 Dimensions cardSize = card.getPreferredSize();
>>
>>                 preferredWidth = Math.max(cardSize.width,
>> preferredWidth);
>> @@ -419,11 +418,10 @@
>>     public void layout() {
>>         // Set the size of all components to match the size of the
>> stack pane,
>>         // minus padding
>> -        CardPane cardPane = (CardPane)getComponent();
>>         int width = getWidth() - (padding.left + padding.right);
>>         int height = getHeight() - (padding.top + padding.bottom);
>>
>> -        for (Component card : cardPane) {
>> +        for (Component card : containerChildAccess) {
>>             card.setLocation(padding.left, padding.top);
>>             card.setSize(width, height);
>>         }
>> @@ -512,10 +510,10 @@
>>         super.componentInserted(container, index);
>>
>>         CardPane cardPane = (CardPane)container;
>> -        Component card = cardPane.get(index);
>> +        Component card = containerChildAccess.get(index);
>>         card.setVisible(false);
>>
>> -        if (cardPane.getLength() == 1) {
>> +        if (containerChildAccess.getLength() == 1) {
>>             cardPane.setSelectedIndex(0);
>>         }
>>
>> @@ -596,7 +594,7 @@
>>                         SelectionChangeTransition
>> selectionChangeTransition =
>>                             (SelectionChangeTransition)transition;
>>
>> -                        int selectedIndex =
>> cardPane.indexOf(selectionChangeTransition.toCard);
>> +                        int selectedIndex =
>> containerChildAccess.indexOf(selectionChangeTransition.toCard);
>>                         cardPane.setSelectedIndex(selectedIndex);
>>                         CardPaneSkin.this.selectionChangeTransition =
>> null;
>>                     }
>> @@ -632,12 +630,12 @@
>>     public void selectedIndexChanged(CardPane cardPane, int
>> previousSelectedIndex) {
>>         int selectedIndex = cardPane.getSelectedIndex();
>>         if (selectedIndex != -1) {
>> -            Component selectedCard = cardPane.get(selectedIndex);
>> +            Component selectedCard =
>> containerChildAccess.get(selectedIndex);
>>             selectedCard.setVisible(true);
>>         }
>>
>>         if (previousSelectedIndex != -1) {
>> -            Component previousSelectedCard =
>> cardPane.get(previousSelectedIndex);
>> +            Component previousSelectedCard =
>> containerChildAccess.get(previousSelectedIndex);
>>             previousSelectedCard.setVisible(false);
>>         }
>>
>> Index: wtk/src/org/apache/pivot/wtk/skin/ContainerSkin.java
>> ===================================================================
>> --- wtk/src/org/apache/pivot/wtk/skin/ContainerSkin.java    (revision
>> 801535)
>> +++ wtk/src/org/apache/pivot/wtk/skin/ContainerSkin.java    (working
>> copy)
>> @@ -38,13 +38,16 @@
>>  */
>> public abstract class ContainerSkin extends ComponentSkin
>>     implements ContainerListener {
>> +
>> +    protected Container.ContainerChildAccess containerChildAccess;
>> +
>>     /**
>>      * Focus traversal policy that determines traversal order based
>> on the order
>>      * of components in the container's component sequence.
>>      *
>>      * @author gbrown
>>      */
>> -    public static class IndexFocusTraversalPolicy implements
>> FocusTraversalPolicy {
>> +    public class IndexFocusTraversalPolicy implements
>> FocusTraversalPolicy {
>>         private boolean wrap;
>>
>>         public IndexFocusTraversalPolicy() {
>> @@ -59,6 +62,9 @@
>>             if (container == null) {
>>                 throw new IllegalArgumentException("container is
>> null.");
>>             }
>> +            if (container != ContainerSkin.this.getComponent()) {
>> +                throw new IllegalArgumentException("wrong container.");
>> +            }
>>
>>             if (direction == null) {
>>                 throw new IllegalArgumentException("direction is
>> null.");
>> @@ -66,26 +72,26 @@
>>
>>             Component nextComponent = null;
>>
>> -            int n = container.getLength();
>> +            int n = containerChildAccess.getLength();
>>             if (n > 0) {
>>                 switch (direction) {
>>                     case FORWARD: {
>>                         if (component == null) {
>>                             // Return the first component in the
>> sequence
>> -                            nextComponent = container.get(0);
>> +                            nextComponent =
>> containerChildAccess.get(0);
>>                         } else {
>>                             // Return the next component in the sequence
>> -                            int index = container.indexOf(component);
>> +                            int index =
>> containerChildAccess.indexOf(component);
>>                             if (index == -1) {
>>                                 throw new IllegalArgumentException();
>>                             }
>>
>>                             if (index < n - 1) {
>> -                                nextComponent = container.get(index
>> + 1);
>> +                                nextComponent =
>> containerChildAccess.get(index + 1);
>>                             } else {
>>                                 if (wrap
>>                                     && container.containsFocus()) {
>> -                                    nextComponent = container.get(0);
>> +                                    nextComponent =
>> containerChildAccess.get(0);
>>                                 }
>>                             }
>>                         }
>> @@ -96,20 +102,20 @@
>>                     case BACKWARD: {
>>                         if (component == null) {
>>                             // Return the last component in the sequence
>> -                            nextComponent = container.get(n - 1);
>> +                            nextComponent =
>> containerChildAccess.get(n - 1);
>>                         } else {
>>                             // Return the previous component in the
>> sequence
>> -                            int index = container.indexOf(component);
>> +                            int index =
>> containerChildAccess.indexOf(component);
>>                             if (index == -1) {
>>                                 throw new IllegalArgumentException();
>>                             }
>>
>>                             if (index > 0) {
>> -                                nextComponent = container.get(index
>> - 1);
>> +                                nextComponent =
>> containerChildAccess.get(index - 1);
>>                             } else {
>>                                 if (wrap
>>                                     && container.containsFocus()) {
>> -                                    nextComponent = container.get(n
>> - 1);
>> +                                    nextComponent =
>> containerChildAccess.get(n - 1);
>>                                 }
>>                             }
>>                         }
>> @@ -125,12 +131,21 @@
>>
>>     private Paint backgroundPaint = null;
>>
>> +    /**
>> +     * Make this final so that none of the subclasses can override it.
>> +     * They need to override the other install() method.
>> +     */
>>     @Override
>> -    public void install(Component component) {
>> +    public final void install(Component component) {
>> +        //check that none of the subclasses is accidentally calling me.
>> +        if (this.containerChildAccess!=null) throw new
>> IllegalStateException("wrong calling sequence");
>> +
>>         super.install(component);
>> -
>> -        Container container = (Container)component;
>> -
>> +    }
>> +
>> +    public void install(Container container,
>> Container.ContainerChildAccess containerChildAccess) {
>> +        this.containerChildAccess = containerChildAccess;
>> +
>>         // Add this as a container listener
>>         container.getContainerListeners().add(this);
>>
>> Index: wtk/src/org/apache/pivot/wtk/skin/DisplaySkin.java
>> ===================================================================
>> --- wtk/src/org/apache/pivot/wtk/skin/DisplaySkin.java    (revision
>> 801535)
>> +++ wtk/src/org/apache/pivot/wtk/skin/DisplaySkin.java    (working copy)
>> @@ -19,9 +19,11 @@
>> import java.awt.Color;
>>
>> import org.apache.pivot.wtk.Component;
>> +import org.apache.pivot.wtk.Container;
>> import org.apache.pivot.wtk.Dimensions;
>> import org.apache.pivot.wtk.Display;
>> import org.apache.pivot.wtk.Window;
>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>>
>> /**
>>  * Display skin.
>> @@ -38,19 +40,20 @@
>>     }
>>
>>     @Override
>> -    public void install(Component component) {
>> -        if (!(component instanceof Display)) {
>> +    public void install(Container container,
>> +            ContainerChildAccess containerChildAccess) {
>> +        if (!(container instanceof Display)) {
>>             throw new IllegalArgumentException("DisplaySkin can only
>> be installed on instances of Display.");
>>         }
>>
>> -        super.install(component);
>> +        super.install(container, containerChildAccess);
>>     }
>>
>>     public void layout() {
>>         Display display = (Display)getComponent();
>>
>>         // Set all components to their preferred sizes
>> -        for (Component component : display) {
>> +        for (Component component : containerChildAccess) {
>>             Window window = (Window)component;
>>
>>             if (window.isDisplayable()) {
>> Index: wtk/src/org/apache/pivot/wtk/skin/ExpanderSkin.java
>> ===================================================================
>> --- wtk/src/org/apache/pivot/wtk/skin/ExpanderSkin.java    (revision
>> 801535)
>> +++ wtk/src/org/apache/pivot/wtk/skin/ExpanderSkin.java    (working
>> copy)
>> @@ -18,8 +18,10 @@
>>
>> import org.apache.pivot.util.Vote;
>> import org.apache.pivot.wtk.Component;
>> +import org.apache.pivot.wtk.Container;
>> import org.apache.pivot.wtk.Expander;
>> import org.apache.pivot.wtk.ExpanderListener;
>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>>
>> /**
>>  * Abstract base class for expander skins.
>> @@ -29,10 +31,11 @@
>> public abstract class ExpanderSkin extends ContainerSkin
>>     implements ExpanderListener {
>>     @Override
>> -    public void install(Component component) {
>> -        super.install(component);
>> +    public void install(Container container,
>> +            ContainerChildAccess containerChildAccess) {
>> +        super.install(container, containerChildAccess);
>>
>> -        Expander expander = (Expander)component;
>> +        Expander expander = (Expander)container;
>>         expander.getExpanderListeners().add(this);
>>     }
>>
>> Index: wtk/src/org/apache/pivot/wtk/skin/FileBrowserSkin.java
>> ===================================================================
>> --- wtk/src/org/apache/pivot/wtk/skin/FileBrowserSkin.java   
>> (revision 801535)
>> +++ wtk/src/org/apache/pivot/wtk/skin/FileBrowserSkin.java   
>> (working copy)
>> @@ -17,8 +17,10 @@
>> package org.apache.pivot.wtk.skin;
>>
>> import org.apache.pivot.wtk.Component;
>> +import org.apache.pivot.wtk.Container;
>> import org.apache.pivot.wtk.FileBrowser;
>> import org.apache.pivot.wtk.FileBrowserListener;
>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>> import org.apache.pivot.wtk.skin.ContainerSkin;
>>
>> /**
>> @@ -28,10 +30,11 @@
>>  */
>> public abstract class FileBrowserSkin extends ContainerSkin
>> implements FileBrowserListener {
>>     @Override
>> -    public void install(Component component) {
>> -        super.install(component);
>> +    public void install(Container container,
>> +            ContainerChildAccess containerChildAccess) {
>> +        super.install(container, containerChildAccess);
>>
>> -        FileBrowser fileBrowser = (FileBrowser)component;
>> +        FileBrowser fileBrowser = (FileBrowser)container;
>>         fileBrowser.getFileBrowserListeners().add(this);
>>     }
>>
>> Index: wtk/src/org/apache/pivot/wtk/skin/FlowPaneSkin.java
>> ===================================================================
>> --- wtk/src/org/apache/pivot/wtk/skin/FlowPaneSkin.java    (revision
>> 801535)
>> +++ wtk/src/org/apache/pivot/wtk/skin/FlowPaneSkin.java    (working
>> copy)
>> @@ -19,10 +19,12 @@
>> import org.apache.pivot.collections.ArrayList;
>> import org.apache.pivot.collections.Dictionary;
>> import org.apache.pivot.wtk.Component;
>> +import org.apache.pivot.wtk.Container;
>> import org.apache.pivot.wtk.Dimensions;
>> import org.apache.pivot.wtk.FlowPane;
>> import org.apache.pivot.wtk.HorizontalAlignment;
>> import org.apache.pivot.wtk.Insets;
>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>>
>> public class FlowPaneSkin extends ContainerSkin {
>>     private HorizontalAlignment alignment = HorizontalAlignment.LEFT;
>> @@ -32,8 +34,9 @@
>>     private boolean alignToBaseline = false;
>>
>>     @Override
>> -    public void install(Component component) {
>> -        super.install(component);
>> +    public void install(Container container,
>> +            ContainerChildAccess containerChildAccess) {
>> +        super.install(container, containerChildAccess);
>>     }
>>
>>     @Override
>> Index: wtk/src/org/apache/pivot/wtk/skin/RollupSkin.java
>> ===================================================================
>> --- wtk/src/org/apache/pivot/wtk/skin/RollupSkin.java    (revision
>> 801535)
>> +++ wtk/src/org/apache/pivot/wtk/skin/RollupSkin.java    (working copy)
>> @@ -18,9 +18,11 @@
>>
>> import org.apache.pivot.util.Vote;
>> import org.apache.pivot.wtk.Component;
>> +import org.apache.pivot.wtk.Container;
>> import org.apache.pivot.wtk.Rollup;
>> import org.apache.pivot.wtk.RollupListener;
>> import org.apache.pivot.wtk.RollupStateListener;
>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>>
>>
>> /**
>> @@ -31,10 +33,11 @@
>> public abstract class RollupSkin extends ContainerSkin
>>     implements RollupListener, RollupStateListener {
>>     @Override
>> -    public void install(Component component) {
>> -        super.install(component);
>> +    public void install(Container container,
>> +            ContainerChildAccess containerChildAccess) {
>> +        super.install(container, containerChildAccess);
>>
>> -        Rollup rollup = (Rollup)component;
>> +        Rollup rollup = (Rollup)container;
>>         rollup.getRollupListeners().add(this);
>>         rollup.getRollupStateListeners().add(this);
>>     }
>> Index: wtk/src/org/apache/pivot/wtk/skin/ScrollPaneSkin.java
>> ===================================================================
>> --- wtk/src/org/apache/pivot/wtk/skin/ScrollPaneSkin.java   
>> (revision 801535)
>> +++ wtk/src/org/apache/pivot/wtk/skin/ScrollPaneSkin.java    (working
>> copy)
>> @@ -24,6 +24,7 @@
>> import org.apache.pivot.wtk.ApplicationContext;
>> import org.apache.pivot.wtk.Bounds;
>> import org.apache.pivot.wtk.Component;
>> +import org.apache.pivot.wtk.Container;
>> import org.apache.pivot.wtk.DesktopApplicationContext;
>> import org.apache.pivot.wtk.Dimensions;
>> import org.apache.pivot.wtk.Keyboard;
>> @@ -35,6 +36,7 @@
>> import org.apache.pivot.wtk.ScrollPaneListener;
>> import org.apache.pivot.wtk.Viewport;
>> import org.apache.pivot.wtk.ViewportListener;
>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>> import org.apache.pivot.wtk.ScrollPane.Corner;
>> import org.apache.pivot.wtk.ScrollPane.ScrollBarPolicy;
>>
>> @@ -75,20 +77,21 @@
>>     }
>>
>>     @Override
>> -    public void install(Component component) {
>> -        super.install(component);
>> +    public void install(Container container,
>> +            ContainerChildAccess containerChildAccess) {
>> +        super.install(container, containerChildAccess);
>>
>> -        ScrollPane scrollPane = (ScrollPane)component;
>> +        ScrollPane scrollPane = (ScrollPane)container;
>>         scrollPane.getViewportListeners().add(this);
>>         scrollPane.getScrollPaneListeners().add(this);
>>
>> -        scrollPane.add(horizontalScrollBar);
>> -        scrollPane.add(verticalScrollBar);
>> +        containerChildAccess.add(horizontalScrollBar);
>> +        containerChildAccess.add(verticalScrollBar);
>>
>> -        scrollPane.add(topLeftCorner);
>> -        scrollPane.add(bottomLeftCorner);
>> -        scrollPane.add(bottomRightCorner);
>> -        scrollPane.add(topRightCorner);
>> +        containerChildAccess.add(topLeftCorner);
>> +        containerChildAccess.add(bottomLeftCorner);
>> +        containerChildAccess.add(bottomRightCorner);
>> +        containerChildAccess.add(topRightCorner);
>>
>>         horizontalScrollBar.getScrollBarValueListeners().add(this);
>>         verticalScrollBar.getScrollBarValueListeners().add(this);
>> @@ -100,13 +103,13 @@
>>         scrollPane.getViewportListeners().remove(this);
>>         scrollPane.getScrollPaneListeners().remove(this);
>>
>> -        scrollPane.remove(horizontalScrollBar);
>> -        scrollPane.remove(verticalScrollBar);
>> +        containerChildAccess.remove(horizontalScrollBar);
>> +        containerChildAccess.remove(verticalScrollBar);
>>
>> -        scrollPane.remove(topLeftCorner);
>> -        scrollPane.remove(bottomLeftCorner);
>> -        scrollPane.remove(bottomRightCorner);
>> -        scrollPane.remove(topRightCorner);
>> +        containerChildAccess.remove(topLeftCorner);
>> +        containerChildAccess.remove(bottomLeftCorner);
>> +        containerChildAccess.remove(bottomRightCorner);
>> +        containerChildAccess.remove(topRightCorner);
>>
>>         horizontalScrollBar.getScrollBarValueListeners().remove(this);
>>         verticalScrollBar.getScrollBarValueListeners().remove(this);
>> Index: wtk/src/org/apache/pivot/wtk/skin/SliderSkin.java
>> ===================================================================
>> --- wtk/src/org/apache/pivot/wtk/skin/SliderSkin.java    (revision
>> 801535)
>> +++ wtk/src/org/apache/pivot/wtk/skin/SliderSkin.java    (working copy)
>> @@ -17,9 +17,11 @@
>> package org.apache.pivot.wtk.skin;
>>
>> import org.apache.pivot.wtk.Component;
>> +import org.apache.pivot.wtk.Container;
>> import org.apache.pivot.wtk.Slider;
>> import org.apache.pivot.wtk.SliderListener;
>> import org.apache.pivot.wtk.SliderValueListener;
>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>>
>> /**
>>  * Abstract base class for slider skins.
>> @@ -29,10 +31,11 @@
>> public abstract class SliderSkin extends ContainerSkin
>>     implements SliderListener, SliderValueListener {
>>     @Override
>> -    public void install(Component component) {
>> -        super.install(component);
>> +    public void install(Container container,
>> +            ContainerChildAccess containerChildAccess) {
>> +        super.install(container, containerChildAccess);
>>
>> -        Slider slider = (Slider)component;
>> +        Slider slider = (Slider)container;
>>         slider.getSliderListeners().add(this);
>>         slider.getSliderValueListeners().add(this);
>>     }
>> Index: wtk/src/org/apache/pivot/wtk/skin/StackPaneSkin.java
>> ===================================================================
>> --- wtk/src/org/apache/pivot/wtk/skin/StackPaneSkin.java    (revision
>> 801535)
>> +++ wtk/src/org/apache/pivot/wtk/skin/StackPaneSkin.java    (working
>> copy)
>> @@ -20,7 +20,6 @@
>> import org.apache.pivot.wtk.Component;
>> import org.apache.pivot.wtk.Dimensions;
>> import org.apache.pivot.wtk.Insets;
>> -import org.apache.pivot.wtk.StackPane;
>>
>> /**
>>  * Stack pane skin.
>> @@ -32,9 +31,8 @@
>>
>>     public int getPreferredWidth(int height) {
>>         int preferredWidth = 0;
>> -        StackPane stackPane = (StackPane)getComponent();
>>
>> -        for (Component component : stackPane) {
>> +        for (Component component : containerChildAccess) {
>>             preferredWidth = Math.max(preferredWidth,
>>                 component.getPreferredWidth(height));
>>         }
>> @@ -46,9 +44,8 @@
>>
>>     public int getPreferredHeight(int width) {
>>         int preferredHeight = 0;
>> -        StackPane stackPane = (StackPane)getComponent();
>>
>> -        for (Component component : stackPane) {
>> +        for (Component component : containerChildAccess) {
>>             preferredHeight = Math.max(preferredHeight,
>>                 component.getPreferredHeight(width));
>>         }
>> @@ -62,9 +59,7 @@
>>         int preferredWidth = 0;
>>         int preferredHeight = 0;
>>
>> -        StackPane stackPane = (StackPane)getComponent();
>> -
>> -        for (Component component : stackPane) {
>> +        for (Component component : containerChildAccess) {
>>             Dimensions preferredCardSize = component.getPreferredSize();
>>
>>             preferredWidth = Math.max(preferredWidth,
>> @@ -83,12 +78,10 @@
>>     public void layout() {
>>         // Set the size of all components to match the size of the
>> stack pane,
>>         // minus padding
>> -        StackPane stackPane = (StackPane)getComponent();
>> -
>>         int width = getWidth() - (padding.left + padding.right);
>>         int height = getHeight() - (padding.top + padding.bottom);
>>
>> -        for (Component component : stackPane) {
>> +        for (Component component : containerChildAccess) {
>>             component.setLocation(padding.left, padding.top);
>>             component.setSize(width, height);
>>         }
>> Index: wtk/src/org/apache/pivot/wtk/skin/TablePaneSkin.java
>> ===================================================================
>> --- wtk/src/org/apache/pivot/wtk/skin/TablePaneSkin.java    (revision
>> 801535)
>> +++ wtk/src/org/apache/pivot/wtk/skin/TablePaneSkin.java    (working
>> copy)
>> @@ -27,6 +27,7 @@
>> import org.apache.pivot.collections.Sequence;
>> import org.apache.pivot.wtk.Bounds;
>> import org.apache.pivot.wtk.Component;
>> +import org.apache.pivot.wtk.Container;
>> import org.apache.pivot.wtk.Dimensions;
>> import org.apache.pivot.wtk.GraphicsUtilities;
>> import org.apache.pivot.wtk.Insets;
>> @@ -34,6 +35,7 @@
>> import org.apache.pivot.wtk.TablePane;
>> import org.apache.pivot.wtk.TablePaneAttributeListener;
>> import org.apache.pivot.wtk.TablePaneListener;
>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>>
>>
>> /**
>> @@ -57,10 +59,11 @@
>>     private int[] rowHeights = null;
>>
>>     @Override
>> -    public void install(Component component) {
>> -        super.install(component);
>> +    public void install(Container container,
>> +            ContainerChildAccess containerChildAccess) {
>> +        super.install(container, containerChildAccess);
>>
>> -        TablePane tablePane = (TablePane)component;
>> +        TablePane tablePane = (TablePane)container;
>>         tablePane.getTablePaneListeners().add(this);
>>         tablePane.getTablePaneAttributeListeners().add(this);
>>     }
>> Index: wtk/src/org/apache/pivot/wtk/skin/WindowSkin.java
>> ===================================================================
>> --- wtk/src/org/apache/pivot/wtk/skin/WindowSkin.java    (revision
>> 801535)
>> +++ wtk/src/org/apache/pivot/wtk/skin/WindowSkin.java    (working copy)
>> @@ -28,6 +28,7 @@
>> import org.apache.pivot.wtk.Window;
>> import org.apache.pivot.wtk.WindowListener;
>> import org.apache.pivot.wtk.WindowStateListener;
>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>> import org.apache.pivot.wtk.media.Image;
>>
>> /**
>> @@ -66,8 +67,9 @@
>>     }
>>
>>     @Override
>> -    public void install(Component component) {
>> -        super.install(component);
>> +    public void install(Container component,
>> +            ContainerChildAccess containerChildAccess) {
>> +        super.install(component, containerChildAccess);
>>
>>         Window window = (Window)component;
>>         window.getWindowListeners().add(this);
>> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraAccordionSkin.java
>> ===================================================================
>> ---
>> wtk/src/org/apache/pivot/wtk/skin/terra/TerraAccordionSkin.java   
>> (revision 801535)
>> +++
>> wtk/src/org/apache/pivot/wtk/skin/terra/TerraAccordionSkin.java   
>> (working copy)
>> @@ -32,6 +32,7 @@
>> import org.apache.pivot.wtk.Button;
>> import org.apache.pivot.wtk.Component;
>> import org.apache.pivot.wtk.ComponentStateListener;
>> +import org.apache.pivot.wtk.Container;
>> import org.apache.pivot.wtk.Dimensions;
>> import org.apache.pivot.wtk.GraphicsUtilities;
>> import org.apache.pivot.wtk.HorizontalAlignment;
>> @@ -39,6 +40,7 @@
>> import org.apache.pivot.wtk.Mouse;
>> import org.apache.pivot.wtk.Theme;
>> import org.apache.pivot.wtk.Button.Group;
>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>> import org.apache.pivot.wtk.content.ButtonData;
>> import org.apache.pivot.wtk.content.ButtonDataRenderer;
>> import org.apache.pivot.wtk.effects.ClipDecorator;
>> @@ -312,10 +314,12 @@
>>         super.setSize(width, height);
>>     }
>>
>> -    public void install(Component component) {
>> -        super.install(component);
>> +    @Override
>> +    public void install(Container container,
>> +            ContainerChildAccess containerChildAccess) {
>> +        super.install(container, containerChildAccess);
>>
>> -        Accordion accordion = (Accordion)component;
>> +        Accordion accordion = (Accordion)container;
>>
>>         // Add this as a listener on the accordion
>>         accordion.getAccordionListeners().add(this);
>> @@ -327,7 +331,7 @@
>>             PanelHeader panelHeader = new PanelHeader(panel);
>>             panelHeader.setGroup(panelHeaderGroup);
>>             panelHeaders.add(panelHeader);
>> -            accordion.add(panelHeader);
>> +            containerChildAccess.add(panelHeader);
>>
>>             // Listen for state changes on the panel
>>             panelHeader.setEnabled(panel.isEnabled());
>> @@ -349,7 +353,7 @@
>>            
>> panel.getComponentStateListeners().remove(panelStateListener);
>>
>>             // Remove the header
>> -            accordion.remove(panelHeader);
>> +            containerChildAccess.remove(panelHeader);
>>         }
>>
>>         super.uninstall();
>> @@ -656,7 +660,7 @@
>>         PanelHeader panelHeader = new PanelHeader(panel);
>>         panelHeader.setGroup(panelHeaderGroup);
>>         panelHeaders.insert(panelHeader, index);
>> -        accordion.add(panelHeader);
>> +        containerChildAccess.add(panelHeader);
>>
>>         // Listen for state changes on the panel
>>         panelHeader.setEnabled(panel.isEnabled());
>> @@ -687,7 +691,7 @@
>>            
>> panel.getComponentStateListeners().remove(panelStateListener);
>>
>>             // Remove the header
>> -            accordion.remove(panelHeader);
>> +            containerChildAccess.remove(panelHeader);
>>         }
>>
>>         invalidateComponent();
>> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraAlertSkin.java
>> ===================================================================
>> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraAlertSkin.java   
>> (revision 801535)
>> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraAlertSkin.java   
>> (working copy)
>> @@ -24,11 +24,13 @@
>> import org.apache.pivot.wtk.ButtonPressListener;
>> import org.apache.pivot.wtk.Component;
>> import org.apache.pivot.wtk.BoxPane;
>> +import org.apache.pivot.wtk.Container;
>> import org.apache.pivot.wtk.ImageView;
>> import org.apache.pivot.wtk.Label;
>> import org.apache.pivot.wtk.PushButton;
>> import org.apache.pivot.wtk.Theme;
>> import org.apache.pivot.wtk.Window;
>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>> import org.apache.pivot.wtkx.WTKXSerializer;
>>
>>
>> @@ -50,8 +52,9 @@
>>     }
>>
>>     @Override
>> -    public void install(Component component) {
>> -        super.install(component);
>> +    public void install(Container component,
>> +            ContainerChildAccess containerChildAccess) {
>> +        super.install(component, containerChildAccess);
>>
>>         Alert alert = (Alert)component;
>>         alert.getAlertListeners().add(this);
>> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraCalendarSkin.java
>> ===================================================================
>> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraCalendarSkin.java   
>> (revision 801535)
>> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraCalendarSkin.java   
>> (working copy)
>> @@ -33,6 +33,7 @@
>> import org.apache.pivot.wtk.CalendarSelectionListener;
>> import org.apache.pivot.wtk.Component;
>> import org.apache.pivot.wtk.ComponentMouseButtonListener;
>> +import org.apache.pivot.wtk.Container;
>> import org.apache.pivot.wtk.Cursor;
>> import org.apache.pivot.wtk.Dimensions;
>> import org.apache.pivot.wtk.GraphicsUtilities;
>> @@ -47,6 +48,7 @@
>> import org.apache.pivot.wtk.TablePane;
>> import org.apache.pivot.wtk.Theme;
>> import org.apache.pivot.wtk.Button.Group;
>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>> import org.apache.pivot.wtk.content.ButtonDataRenderer;
>> import org.apache.pivot.wtk.content.NumericSpinnerData;
>> import org.apache.pivot.wtk.content.SpinnerItemRenderer;
>> @@ -500,11 +502,12 @@
>>     }
>>
>>     @Override
>> -    public void install(Component component) {
>> -        super.install(component);
>> +    public void install(Container container,
>> +            ContainerChildAccess containerChildAccess) {
>> +        super.install(container, containerChildAccess);
>>
>> -        Calendar calendar = (Calendar)component;
>> -        calendar.add(calendarTablePane);
>> +        Calendar calendar = (Calendar)container;
>> +        containerChildAccess.add(calendarTablePane);
>>
>>         yearSpinner.setSelectedIndex(calendar.getYear());
>>         monthSpinner.setSelectedIndex(calendar.getMonth());
>> @@ -514,8 +517,7 @@
>>
>>     @Override
>>     public void uninstall() {
>> -        Calendar calendar = (Calendar)getComponent();
>> -        calendar.remove(calendarTablePane);
>> +        containerChildAccess.remove(calendarTablePane);
>>
>>         super.uninstall();
>>     }
>> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraDialogSkin.java
>> ===================================================================
>> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraDialogSkin.java   
>> (revision 801535)
>> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraDialogSkin.java   
>> (working copy)
>> @@ -24,6 +24,7 @@
>> import org.apache.pivot.wtk.DialogStateListener;
>> import org.apache.pivot.wtk.Keyboard;
>> import org.apache.pivot.wtk.Window;
>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>>
>>
>> /**
>> @@ -54,8 +55,9 @@
>>     }
>>
>>     @Override
>> -    public void install(Component component) {
>> -        super.install(component);
>> +    public void install(Container component,
>> +            ContainerChildAccess containerChildAccess) {
>> +        super.install(component, containerChildAccess);
>>
>>         Dialog dialog = (Dialog)component;
>>         dialog.getDialogStateListeners().add(this);
>> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraExpanderSkin.java
>> ===================================================================
>> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraExpanderSkin.java   
>> (revision 801535)
>> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraExpanderSkin.java   
>> (working copy)
>> @@ -29,6 +29,7 @@
>> import org.apache.pivot.wtk.ButtonPressListener;
>> import org.apache.pivot.wtk.Component;
>> import org.apache.pivot.wtk.ComponentMouseButtonListener;
>> +import org.apache.pivot.wtk.Container;
>> import org.apache.pivot.wtk.Dimensions;
>> import org.apache.pivot.wtk.Expander;
>> import org.apache.pivot.wtk.BoxPane;
>> @@ -41,6 +42,7 @@
>> import org.apache.pivot.wtk.Orientation;
>> import org.apache.pivot.wtk.TablePane;
>> import org.apache.pivot.wtk.Theme;
>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>> import org.apache.pivot.wtk.content.ButtonDataRenderer;
>> import org.apache.pivot.wtk.effects.Transition;
>> import org.apache.pivot.wtk.effects.TransitionListener;
>> @@ -253,11 +255,12 @@
>>     }
>>
>>     @Override
>> -    public void install(Component component) {
>> -        super.install(component);
>> +    public void install(Container container,
>> +            ContainerChildAccess containerChildAccess) {
>> +        super.install(container, containerChildAccess);
>>
>> -        Expander expander = (Expander)component;
>> -        expander.add(titleBarTablePane);
>> +        Expander expander = (Expander)container;
>> +        containerChildAccess.add(titleBarTablePane);
>>
>>         Image buttonData = expander.isExpanded() ? collapseImage :
>> expandImage;
>>         shadeButton = new ShadeButton(buttonData);
>> @@ -270,8 +273,7 @@
>>     }
>>
>>     public void uninstall() {
>> -        Expander expander = (Expander)getComponent();
>> -        expander.remove(titleBarTablePane);
>> +        containerChildAccess.remove(titleBarTablePane);
>>
>>         shadeButton.getButtonPressListeners().remove(this);
>>         buttonBoxPane.remove(shadeButton);
>> Index:
>> wtk/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSheetSkin.java
>> ===================================================================
>> ---
>> wtk/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSheetSkin.java   
>> (revision 801535)
>> +++
>> wtk/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSheetSkin.java   
>> (working copy)
>> @@ -22,8 +22,10 @@
>> import org.apache.pivot.io.Folder;
>> import org.apache.pivot.util.Filter;
>> import org.apache.pivot.wtk.Component;
>> +import org.apache.pivot.wtk.Container;
>> import org.apache.pivot.wtk.FileBrowserSheet;
>> import org.apache.pivot.wtk.FileBrowserSheetListener;
>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>>
>> /**
>>  * Terra file browser sheet skin.
>> @@ -32,8 +34,9 @@
>>  */
>> public class TerraFileBrowserSheetSkin extends TerraSheetSkin
>> implements FileBrowserSheetListener {
>>     @Override
>> -    public void install(Component component) {
>> -        super.install(component);
>> +    public void install(Container component,
>> +            ContainerChildAccess containerChildAccess) {
>> +        super.install(component, containerChildAccess);
>>
>>         FileBrowserSheet fileBrowserSheet = (FileBrowserSheet)component;
>>         fileBrowserSheet.getFileBrowserSheetListeners().add(this);
>> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSkin.java
>> ===================================================================
>> ---
>> wtk/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSkin.java   
>> (revision 801535)
>> +++
>> wtk/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSkin.java   
>> (working copy)
>> @@ -21,8 +21,9 @@
>> import org.apache.pivot.collections.Sequence;
>> import org.apache.pivot.io.Folder;
>> import org.apache.pivot.util.Filter;
>> -import org.apache.pivot.wtk.Component;
>> +import org.apache.pivot.wtk.Container;
>> import org.apache.pivot.wtk.FileBrowser;
>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>> import org.apache.pivot.wtk.skin.FileBrowserSkin;
>>
>> /**
>> @@ -32,8 +33,9 @@
>>  */
>> public class TerraFileBrowserSkin extends FileBrowserSkin {
>>     @Override
>> -    public void install(Component component) {
>> -        super.install(component);
>> +    public void install(Container container,
>> +            ContainerChildAccess containerChildAccess) {
>> +        super.install(container, containerChildAccess);
>>
>>         // TODO Add components
>>     }
>> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraFormSkin.java
>> ===================================================================
>> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraFormSkin.java   
>> (revision 801535)
>> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraFormSkin.java   
>> (working copy)
>> @@ -19,6 +19,7 @@
>> import org.apache.pivot.collections.ArrayList;
>> import org.apache.pivot.collections.Sequence;
>> import org.apache.pivot.wtk.Component;
>> +import org.apache.pivot.wtk.Container;
>> import org.apache.pivot.wtk.Dimensions;
>> import org.apache.pivot.wtk.Form;
>> import org.apache.pivot.wtk.FormAttributeListener;
>> @@ -28,6 +29,7 @@
>> import org.apache.pivot.wtk.MessageType;
>> import org.apache.pivot.wtk.Separator;
>> import org.apache.pivot.wtk.Theme;
>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>> import org.apache.pivot.wtk.media.Image;
>> import org.apache.pivot.wtk.skin.ContainerSkin;
>>
>> @@ -52,10 +54,10 @@
>>     private static final int FLAG_IMAGE_SIZE = 16;
>>
>>     @Override
>> -    public void install(Component component) {
>> -        super.install(component);
>> +    public void install(Container container,
>> +            ContainerChildAccess containerChildAccess) {
>>
>> -        Form form = (Form)component;
>> +        Form form = (Form)container;
>>         form.getFormListeners().add(this);
>>         form.getFormAttributeListeners().add(this);
>>
>> @@ -411,7 +413,7 @@
>>         // Insert separator
>>         Separator separator = new Separator(section.getHeading());
>>         separators.insert(separator, index);
>> -        form.add(separator);
>> +        containerChildAccess.add(separator);
>>
>>         // Insert field label and flag image view lists
>>         ArrayList<Label> sectionLabels = new ArrayList<Label>();
>> @@ -445,7 +447,7 @@
>>             // Remove separators
>>             Sequence<Separator> removedSeparators =
>> separators.remove(index, n);
>>             for (int j = 0; j < n; j++) {
>> -                form.remove(removedSeparators.get(j));
>> +                containerChildAccess.remove(removedSeparators.get(j));
>>             }
>>         }
>>
>> @@ -459,13 +461,13 @@
>>         // Create the label
>>         Label label = new Label();
>>         labels.get(sectionIndex).insert(label, index);
>> -        form.add(label);
>> +        containerChildAccess.add(label);
>>         updateFieldLabel(section, index);
>>
>>         // Create the flag image view
>>         ImageView flagImageView = new ImageView();
>>         flagImageViews.get(sectionIndex).insert(flagImageView, index);
>> -        form.add(flagImageView);
>> +        containerChildAccess.add(flagImageView);
>>         updateFieldFlag(section, index);
>>
>>         invalidateComponent();
>> @@ -478,13 +480,13 @@
>>         // Remove the labels
>>         Sequence<Label> removedLabels =
>> labels.get(sectionIndex).remove(index, count);
>>         for (int i = 0; i < count; i++) {
>> -            form.remove(removedLabels.get(i));
>> +            containerChildAccess.remove(removedLabels.get(i));
>>         }
>>
>>         // Remove the flag image views
>>         Sequence<ImageView> removedFlagImageViews =
>> flagImageViews.get(sectionIndex).remove(index, count);
>>         for (int i = 0; i < count; i++) {
>> -            form.remove(removedFlagImageViews.get(i));
>> +            containerChildAccess.remove(removedFlagImageViews.get(i));
>>         }
>>
>>         invalidateComponent();
>> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraFrameSkin.java
>> ===================================================================
>> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraFrameSkin.java   
>> (revision 801535)
>> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraFrameSkin.java   
>> (working copy)
>> @@ -28,6 +28,7 @@
>> import org.apache.pivot.wtk.Button;
>> import org.apache.pivot.wtk.ButtonPressListener;
>> import org.apache.pivot.wtk.Component;
>> +import org.apache.pivot.wtk.Container;
>> import org.apache.pivot.wtk.Cursor;
>> import org.apache.pivot.wtk.Dimensions;
>> import org.apache.pivot.wtk.Display;
>> @@ -45,6 +46,7 @@
>> import org.apache.pivot.wtk.Theme;
>> import org.apache.pivot.wtk.VerticalAlignment;
>> import org.apache.pivot.wtk.Window;
>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>> import org.apache.pivot.wtk.effects.DropShadowDecorator;
>> import org.apache.pivot.wtk.media.Image;
>> import org.apache.pivot.wtk.skin.WindowSkin;
>> @@ -296,8 +298,9 @@
>>     }
>>
>>     @Override
>> -    public void install(Component component) {
>> -        super.install(component);
>> +    public void install(Container component,
>> +            ContainerChildAccess containerChildAccess) {
>> +        super.install(component, containerChildAccess);
>>
>>         Window window = (Window)component;
>>
>> @@ -305,7 +308,7 @@
>>         dropShadowDecorator = new DropShadowDecorator();
>>         window.getDecorators().add(dropShadowDecorator);
>>
>> -        window.add(titleBarTablePane);
>> +        containerChildAccess.add(titleBarTablePane);
>>
>>         // Create the frame buttons
>>         minimizeButton = new FrameButton(minimizeImage);
>> @@ -334,7 +337,7 @@
>>        
>> maximizeButton.getButtonPressListeners().add(buttonPressListener);
>>         closeButton.getButtonPressListeners().add(buttonPressListener);
>>
>> -        window.add(resizeHandle);
>> +        containerChildAccess.add(resizeHandle);
>>
>>         iconChanged(window, null);
>>         titleChanged(window, null);
>> @@ -351,7 +354,7 @@
>>         window.getDecorators().remove(dropShadowDecorator);
>>         dropShadowDecorator = null;
>>
>> -        window.remove(titleBarTablePane);
>> +        containerChildAccess.remove(titleBarTablePane);
>>
>>         buttonBoxPane.remove(minimizeButton);
>>         buttonBoxPane.remove(maximizeButton);
>> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraMenuBarSkin.java
>> ===================================================================
>> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraMenuBarSkin.java   
>> (revision 801535)
>> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraMenuBarSkin.java   
>> (working copy)
>> @@ -20,12 +20,13 @@
>> import java.awt.Font;
>>
>> import org.apache.pivot.collections.Sequence;
>> -import org.apache.pivot.wtk.Component;
>> +import org.apache.pivot.wtk.Container;
>> import org.apache.pivot.wtk.Dimensions;
>> import org.apache.pivot.wtk.GraphicsUtilities;
>> import org.apache.pivot.wtk.MenuBar;
>> import org.apache.pivot.wtk.MenuBarListener;
>> import org.apache.pivot.wtk.Theme;
>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>> import org.apache.pivot.wtk.skin.ContainerSkin;
>>
>>
>> @@ -54,10 +55,12 @@
>>         spacing = 2;
>>     }
>>
>> -    public void install(Component component) {
>> -        super.install(component);
>> +    @Override
>> +    public void install(Container container,
>> +            ContainerChildAccess containerChildAccess) {
>> +        super.install(container, containerChildAccess);
>>
>> -        MenuBar menuBar = (MenuBar)component;
>> +        MenuBar menuBar = (MenuBar)container;
>>         menuBar.getMenuBarListeners().add(this);
>>
>>         menuBar.setFocusTraversalPolicy(new
>> IndexFocusTraversalPolicy(true));
>> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraMenuPopupSkin.java
>> ===================================================================
>> ---
>> wtk/src/org/apache/pivot/wtk/skin/terra/TerraMenuPopupSkin.java   
>> (revision 801535)
>> +++
>> wtk/src/org/apache/pivot/wtk/skin/terra/TerraMenuPopupSkin.java   
>> (working copy)
>> @@ -34,6 +34,7 @@
>> import org.apache.pivot.wtk.Panorama;
>> import org.apache.pivot.wtk.Theme;
>> import org.apache.pivot.wtk.Window;
>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>> import org.apache.pivot.wtk.effects.DropShadowDecorator;
>> import org.apache.pivot.wtk.effects.Transition;
>> import org.apache.pivot.wtk.effects.TransitionListener;
>> @@ -124,8 +125,9 @@
>>     }
>>
>>     @Override
>> -    public void install(Component component) {
>> -        super.install(component);
>> +    public void install(Container component,
>> +            ContainerChildAccess containerChildAccess) {
>> +        super.install(component, containerChildAccess);
>>
>>         MenuPopup menuPopup = (MenuPopup)component;
>>         menuPopup.getMenuPopupListeners().add(this);
>> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraMenuSkin.java
>> ===================================================================
>> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraMenuSkin.java   
>> (revision 801535)
>> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraMenuSkin.java   
>> (working copy)
>> @@ -22,11 +22,13 @@
>>
>> import org.apache.pivot.collections.Sequence;
>> import org.apache.pivot.wtk.Component;
>> +import org.apache.pivot.wtk.Container;
>> import org.apache.pivot.wtk.Dimensions;
>> import org.apache.pivot.wtk.GraphicsUtilities;
>> import org.apache.pivot.wtk.Menu;
>> import org.apache.pivot.wtk.MenuListener;
>> import org.apache.pivot.wtk.Theme;
>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>> import org.apache.pivot.wtk.skin.ContainerSkin;
>>
>>
>> @@ -68,8 +70,10 @@
>>         showKeyboardShortcuts = true;
>>     }
>>
>> -    public void install(Component component) {
>> -        super.install(component);
>> +    @Override
>> +    public void install(Container component,
>> +            ContainerChildAccess containerChildAccess) {
>> +        super.install(component, containerChildAccess);
>>
>>         Menu menu = (Menu)component;
>>         menu.getMenuListeners().add(this);
>> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraPaletteSkin.java
>> ===================================================================
>> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraPaletteSkin.java   
>> (revision 801535)
>> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraPaletteSkin.java   
>> (working copy)
>> @@ -30,6 +30,7 @@
>> import org.apache.pivot.wtk.ButtonPressListener;
>> import org.apache.pivot.wtk.Component;
>> import org.apache.pivot.wtk.ComponentMouseButtonListener;
>> +import org.apache.pivot.wtk.Container;
>> import org.apache.pivot.wtk.Dimensions;
>> import org.apache.pivot.wtk.Display;
>> import org.apache.pivot.wtk.BoxPane;
>> @@ -47,6 +48,7 @@
>> import org.apache.pivot.wtk.VerticalAlignment;
>> import org.apache.pivot.wtk.Window;
>> import org.apache.pivot.wtk.WindowListener;
>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>> import org.apache.pivot.wtk.effects.DropShadowDecorator;
>> import org.apache.pivot.wtk.media.Image;
>> import org.apache.pivot.wtk.skin.WindowSkin;
>> @@ -172,11 +174,12 @@
>>     }
>>
>>     @Override
>> -    public void install(Component component) {
>> -        super.install(component);
>> +    public void install(Container component,
>> +            ContainerChildAccess containerChildAccess) {
>> +        super.install(component, containerChildAccess);
>>
>>         Palette palette = (Palette)component;
>> -        palette.add(titleBarTablePane);
>> +        containerChildAccess.add(titleBarTablePane);
>>
>>         // Attach the drop-shadow decorator
>>         dropShadowDecorator = new DropShadowDecorator(3, 3, 3);
>> @@ -189,7 +192,7 @@
>>     @Override
>>     public void uninstall() {
>>         Palette palette = (Palette)getComponent();
>> -        palette.remove(titleBarTablePane);
>> +        containerChildAccess.remove(titleBarTablePane);
>>
>>         // Detach the drop shadow decorator
>>         palette.getDecorators().remove(dropShadowDecorator);
>> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraPanoramaSkin.java
>> ===================================================================
>> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraPanoramaSkin.java   
>> (revision 801535)
>> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraPanoramaSkin.java   
>> (working copy)
>> @@ -26,6 +26,7 @@
>> import org.apache.pivot.wtk.Button;
>> import org.apache.pivot.wtk.Component;
>> import org.apache.pivot.wtk.ComponentMouseListener;
>> +import org.apache.pivot.wtk.Container;
>> import org.apache.pivot.wtk.Dimensions;
>> import org.apache.pivot.wtk.GraphicsUtilities;
>> import org.apache.pivot.wtk.Keyboard;
>> @@ -34,6 +35,7 @@
>> import org.apache.pivot.wtk.Theme;
>> import org.apache.pivot.wtk.Viewport;
>> import org.apache.pivot.wtk.ViewportListener;
>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>> import org.apache.pivot.wtk.content.ButtonDataRenderer;
>> import org.apache.pivot.wtk.media.Image;
>> import org.apache.pivot.wtk.skin.ButtonSkin;
>> @@ -278,8 +280,9 @@
>>     private static final int BUTTON_SIZE = 7;
>>
>>     @Override
>> -    public void install(Component component) {
>> -        super.install(component);
>> +    public void install(Container component,
>> +            ContainerChildAccess containerChildAccess) {
>> +        super.install(component, containerChildAccess);
>>
>>         Panorama panorama = (Panorama)component;
>>         panorama.getViewportListeners().add(this);
>> @@ -287,16 +290,16 @@
>>         // Add scroll arrow link buttons and attach mouse listeners
>>         // to them; the mouse handlers should call setScrollTop() and
>>         // setScrollLeft() on the panorama as appropriate
>> -        panorama.add(northButton);
>> +        containerChildAccess.add(northButton);
>>        
>> northButton.getComponentMouseListeners().add(buttonMouseListener);
>>
>> -        panorama.add(southButton);
>> +        containerChildAccess.add(southButton);
>>        
>> southButton.getComponentMouseListeners().add(buttonMouseListener);
>>
>> -        panorama.add(eastButton);
>> +        containerChildAccess.add(eastButton);
>>        
>> eastButton.getComponentMouseListeners().add(buttonMouseListener);
>>
>> -        panorama.add(westButton);
>> +        containerChildAccess.add(westButton);
>>        
>> westButton.getComponentMouseListeners().add(buttonMouseListener);
>>
>>         updateScrollButtonVisibility();
>> @@ -308,10 +311,10 @@
>>         panorama.getViewportListeners().remove(this);
>>
>>         // Remove scroll arrow link buttons
>> -        panorama.remove(northButton);
>> -        panorama.remove(southButton);
>> -        panorama.remove(eastButton);
>> -        panorama.remove(westButton);
>> +        containerChildAccess.remove(northButton);
>> +        containerChildAccess.remove(southButton);
>> +        containerChildAccess.remove(eastButton);
>> +        containerChildAccess.remove(westButton);
>>     }
>>
>>     @Override
>> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraPromptSkin.java
>> ===================================================================
>> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraPromptSkin.java   
>> (revision 801535)
>> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraPromptSkin.java   
>> (working copy)
>> @@ -22,6 +22,7 @@
>> import org.apache.pivot.wtk.ButtonPressListener;
>> import org.apache.pivot.wtk.Component;
>> import org.apache.pivot.wtk.BoxPane;
>> +import org.apache.pivot.wtk.Container;
>> import org.apache.pivot.wtk.ImageView;
>> import org.apache.pivot.wtk.Label;
>> import org.apache.pivot.wtk.Prompt;
>> @@ -29,6 +30,7 @@
>> import org.apache.pivot.wtk.PushButton;
>> import org.apache.pivot.wtk.Theme;
>> import org.apache.pivot.wtk.Window;
>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>> import org.apache.pivot.wtkx.WTKXSerializer;
>>
>>
>> @@ -48,8 +50,9 @@
>>     }
>>
>>     @Override
>> -    public void install(Component component) {
>> -        super.install(component);
>> +    public void install(Container component,
>> +            ContainerChildAccess containerChildAccess) {
>> +        super.install(component, containerChildAccess);
>>
>>         Prompt prompt = (Prompt)component;
>>         prompt.getPromptListeners().add(this);
>> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraRollupSkin.java
>> ===================================================================
>> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraRollupSkin.java   
>> (revision 801535)
>> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraRollupSkin.java   
>> (working copy)
>> @@ -25,12 +25,14 @@
>> import org.apache.pivot.util.Vote;
>> import org.apache.pivot.wtk.Component;
>> import org.apache.pivot.wtk.ComponentMouseButtonListener;
>> +import org.apache.pivot.wtk.Container;
>> import org.apache.pivot.wtk.Cursor;
>> import org.apache.pivot.wtk.Dimensions;
>> import org.apache.pivot.wtk.GraphicsUtilities;
>> import org.apache.pivot.wtk.Mouse;
>> import org.apache.pivot.wtk.Rollup;
>> import org.apache.pivot.wtk.Theme;
>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>> import org.apache.pivot.wtk.effects.Transition;
>> import org.apache.pivot.wtk.effects.TransitionListener;
>> import org.apache.pivot.wtk.effects.easing.Easing;
>> @@ -204,14 +206,15 @@
>>     }
>>
>>     @Override
>> -    public void install(Component component) {
>> -        super.install(component);
>> +    public void install(Container component,
>> +            ContainerChildAccess containerChildAccess) {
>> +        super.install(component, containerChildAccess);
>>
>>         Rollup rollup = (Rollup)component;
>>
>>         // Add the rollup button
>>         rollupButton = new RollupButton();
>> -        rollup.add(rollupButton);
>> +        containerChildAccess.add(rollupButton);
>>
>>         // Initialize state
>>         headingChanged(rollup, null);
>> @@ -229,7 +232,7 @@
>>         }
>>
>>         // Remove the rollup button
>> -        rollup.remove(rollupButton);
>> +        containerChildAccess.remove(rollupButton);
>>         rollupButton = null;
>>
>>         super.uninstall();
>> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraScrollBarSkin.java
>> ===================================================================
>> ---
>> wtk/src/org/apache/pivot/wtk/skin/terra/TerraScrollBarSkin.java   
>> (revision 801535)
>> +++
>> wtk/src/org/apache/pivot/wtk/skin/terra/TerraScrollBarSkin.java   
>> (working copy)
>> @@ -25,6 +25,7 @@
>>
>> import org.apache.pivot.wtk.ApplicationContext;
>> import org.apache.pivot.wtk.Component;
>> +import org.apache.pivot.wtk.Container;
>> import org.apache.pivot.wtk.Dimensions;
>> import org.apache.pivot.wtk.GraphicsUtilities;
>> import org.apache.pivot.wtk.Mouse;
>> @@ -33,6 +34,7 @@
>> import org.apache.pivot.wtk.ScrollBarListener;
>> import org.apache.pivot.wtk.ScrollBarValueListener;
>> import org.apache.pivot.wtk.Theme;
>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>> import org.apache.pivot.wtk.media.Image;
>> import org.apache.pivot.wtk.skin.ComponentSkin;
>> import org.apache.pivot.wtk.skin.ContainerSkin;
>> @@ -602,16 +604,17 @@
>>     }
>>
>>     @Override
>> -    public void install(Component component) {
>> -        super.install(component);
>> +    public void install(Container component,
>> +            ContainerChildAccess containerChildAccess) {
>> +        super.install(component, containerChildAccess);
>>
>>         ScrollBar scrollBar = (ScrollBar)component;
>>         scrollBar.getScrollBarListeners().add(this);
>>         scrollBar.getScrollBarValueListeners().add(this);
>>
>> -        scrollBar.add(scrollUpButton);
>> -        scrollBar.add(scrollDownButton);
>> -        scrollBar.add(handle);
>> +        containerChildAccess.add(scrollUpButton);
>> +        containerChildAccess.add(scrollDownButton);
>> +        containerChildAccess.add(handle);
>>
>>         setBackgroundColor(9);
>>
>> @@ -624,9 +627,9 @@
>>         scrollBar.getScrollBarListeners().remove(this);
>>         scrollBar.getScrollBarValueListeners().remove(this);
>>
>> -        scrollBar.remove(scrollUpButton);
>> -        scrollBar.remove(scrollDownButton);
>> -        scrollBar.remove(handle);
>> +        containerChildAccess.remove(scrollUpButton);
>> +        containerChildAccess.remove(scrollDownButton);
>> +        containerChildAccess.remove(handle);
>>
>>         super.uninstall();
>>     }
>> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraSheetSkin.java
>> ===================================================================
>> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraSheetSkin.java   
>> (revision 801535)
>> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraSheetSkin.java   
>> (working copy)
>> @@ -23,6 +23,7 @@
>> import org.apache.pivot.util.Vote;
>> import org.apache.pivot.wtk.Component;
>> import org.apache.pivot.wtk.ComponentListener;
>> +import org.apache.pivot.wtk.Container;
>> import org.apache.pivot.wtk.Dimensions;
>> import org.apache.pivot.wtk.GraphicsUtilities;
>> import org.apache.pivot.wtk.Insets;
>> @@ -33,6 +34,7 @@
>> import org.apache.pivot.wtk.SheetStateListener;
>> import org.apache.pivot.wtk.Theme;
>> import org.apache.pivot.wtk.Window;
>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>> import org.apache.pivot.wtk.effects.DropShadowDecorator;
>> import org.apache.pivot.wtk.effects.Transition;
>> import org.apache.pivot.wtk.effects.TransitionListener;
>> @@ -104,8 +106,9 @@
>>     }
>>
>>     @Override
>> -    public void install(Component component) {
>> -        super.install(component);
>> +    public void install(Container component,
>> +            ContainerChildAccess containerChildAccess) {
>> +        super.install(component, containerChildAccess);
>>
>>         Sheet sheet = (Sheet)component;
>>         sheet.getSheetStateListeners().add(this);
>> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraSliderSkin.java
>> ===================================================================
>> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraSliderSkin.java   
>> (revision 801535)
>> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraSliderSkin.java   
>> (working copy)
>> @@ -22,6 +22,7 @@
>> import java.awt.RenderingHints;
>>
>> import org.apache.pivot.wtk.Component;
>> +import org.apache.pivot.wtk.Container;
>> import org.apache.pivot.wtk.Dimensions;
>> import org.apache.pivot.wtk.GraphicsUtilities;
>> import org.apache.pivot.wtk.Mouse;
>> @@ -29,6 +30,7 @@
>> import org.apache.pivot.wtk.Point;
>> import org.apache.pivot.wtk.Slider;
>> import org.apache.pivot.wtk.Theme;
>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>> import org.apache.pivot.wtk.skin.ComponentSkin;
>> import org.apache.pivot.wtk.skin.SliderSkin;
>>
>> @@ -211,16 +213,17 @@
>>     }
>>
>>     @Override
>> -    public void install(Component component) {
>> -        super.install(component);
>> +    public void install(Container component,
>> +            ContainerChildAccess containerChildAccess) {
>> +        super.install(component, containerChildAccess);
>>
>>         Slider slider = (Slider)component;
>> -        slider.add(thumb);
>> +        containerChildAccess.add(thumb);
>>     }
>>
>>     public void uninstall() {
>>         Slider slider = (Slider)getComponent();
>> -        slider.remove(thumb);
>> +        containerChildAccess.remove(thumb);
>>
>>         super.uninstall();
>>     }
>> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraSpinnerSkin.java
>> ===================================================================
>> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraSpinnerSkin.java   
>> (revision 801535)
>> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraSpinnerSkin.java   
>> (working copy)
>> @@ -28,6 +28,7 @@
>> import org.apache.pivot.wtk.ApplicationContext;
>> import org.apache.pivot.wtk.Bounds;
>> import org.apache.pivot.wtk.Component;
>> +import org.apache.pivot.wtk.Container;
>> import org.apache.pivot.wtk.Dimensions;
>> import org.apache.pivot.wtk.GraphicsUtilities;
>> import org.apache.pivot.wtk.Keyboard;
>> @@ -37,6 +38,7 @@
>> import org.apache.pivot.wtk.SpinnerListener;
>> import org.apache.pivot.wtk.SpinnerSelectionListener;
>> import org.apache.pivot.wtk.Theme;
>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>> import org.apache.pivot.wtk.media.Image;
>> import org.apache.pivot.wtk.skin.ComponentSkin;
>> import org.apache.pivot.wtk.skin.ContainerSkin;
>> @@ -512,16 +514,17 @@
>>     }
>>
>>     @Override
>> -    public void install(Component component) {
>> -        super.install(component);
>> +    public void install(Container component,
>> +            ContainerChildAccess containerChildAccess) {
>> +        super.install(component, containerChildAccess);
>>
>>         Spinner spinner = (Spinner)component;
>>         spinner.getSpinnerListeners().add(this);
>>         spinner.getSpinnerSelectionListeners().add(this);
>>
>> -        spinner.add(spinnerContent);
>> -        spinner.add(upButton);
>> -        spinner.add(downButton);
>> +        containerChildAccess.add(spinnerContent);
>> +        containerChildAccess.add(upButton);
>> +        containerChildAccess.add(downButton);
>>     }
>>
>>     @Override
>> @@ -530,9 +533,9 @@
>>         spinner.getSpinnerListeners().remove(this);
>>         spinner.getSpinnerSelectionListeners().remove(this);
>>
>> -        spinner.remove(spinnerContent);
>> -        spinner.remove(upButton);
>> -        spinner.remove(downButton);
>> +        containerChildAccess.remove(spinnerContent);
>> +        containerChildAccess.remove(upButton);
>> +        containerChildAccess.remove(downButton);
>>
>>         super.uninstall();
>>     }
>> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraSplitPaneSkin.java
>> ===================================================================
>> ---
>> wtk/src/org/apache/pivot/wtk/skin/terra/TerraSplitPaneSkin.java   
>> (revision 801535)
>> +++
>> wtk/src/org/apache/pivot/wtk/skin/terra/TerraSplitPaneSkin.java   
>> (working copy)
>> @@ -21,6 +21,7 @@
>> import java.awt.Graphics2D;
>>
>> import org.apache.pivot.wtk.Component;
>> +import org.apache.pivot.wtk.Container;
>> import org.apache.pivot.wtk.Cursor;
>> import org.apache.pivot.wtk.Dimensions;
>> import org.apache.pivot.wtk.GraphicsUtilities;
>> @@ -30,6 +31,7 @@
>> import org.apache.pivot.wtk.SplitPane;
>> import org.apache.pivot.wtk.SplitPaneListener;
>> import org.apache.pivot.wtk.Theme;
>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>> import org.apache.pivot.wtk.skin.ComponentSkin;
>> import org.apache.pivot.wtk.skin.ContainerSkin;
>>
>> @@ -186,7 +188,7 @@
>>                 if (useShadow) {
>>                     // Add the shadow to the split pane and lay it out
>>                     shadow = new SplitterShadow();
>> -                    splitPane.add(shadow);
>> +                    containerChildAccess.add(shadow);
>>
>>                     if (orientation == Orientation.HORIZONTAL) {
>>                         shadow.setLocation(component.getX(), 0);
>> @@ -224,7 +226,7 @@
>>
>>                     splitPane.setSplitLocation(splitLocation);
>>
>> -                    splitPane.remove(shadow);
>> +                    containerChildAccess.remove(shadow);
>>                     shadow = null;
>>                 }
>>
>> @@ -318,13 +320,14 @@
>>     }
>>
>>     @Override
>> -    public void install(Component component) {
>> -        super.install(component);
>> +    public void install(Container component,
>> +            ContainerChildAccess containerChildAccess) {
>> +        super.install(component, containerChildAccess);
>>
>>         SplitPane splitPane = (SplitPane)component;
>>         splitPane.getSplitPaneListeners().add(this);
>>
>> -        splitPane.add(splitter);
>> +        containerChildAccess.add(splitter);
>>         updateSplitterCursor();
>>     }
>>
>> @@ -333,7 +336,7 @@
>>         SplitPane splitPane = (SplitPane)getComponent();
>>         splitPane.getSplitPaneListeners().remove(this);
>>
>> -        splitPane.remove(splitter);
>> +        containerChildAccess.remove(splitter);
>>
>>         super.uninstall();
>>     }
>> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraTabPaneSkin.java
>> ===================================================================
>> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraTabPaneSkin.java   
>> (revision 801535)
>> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraTabPaneSkin.java   
>> (working copy)
>> @@ -28,6 +28,7 @@
>> import org.apache.pivot.wtk.Button;
>> import org.apache.pivot.wtk.Component;
>> import org.apache.pivot.wtk.ComponentStateListener;
>> +import org.apache.pivot.wtk.Container;
>> import org.apache.pivot.wtk.Dimensions;
>> import org.apache.pivot.wtk.BoxPane;
>> import org.apache.pivot.wtk.GraphicsUtilities;
>> @@ -43,6 +44,7 @@
>> import org.apache.pivot.wtk.Theme;
>> import org.apache.pivot.wtk.VerticalAlignment;
>> import org.apache.pivot.wtk.Button.Group;
>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>> import org.apache.pivot.wtk.content.ButtonData;
>> import org.apache.pivot.wtk.content.ButtonDataRenderer;
>> import org.apache.pivot.wtk.effects.Transition;
>> @@ -409,8 +411,10 @@
>>         setButtonSpacing(2);
>>     }
>>
>> -    public void install(Component component) {
>> -        super.install(component);
>> +    @Override
>> +    public void install(Container component,
>> +            ContainerChildAccess containerChildAccess) {
>> +        super.install(component, containerChildAccess);
>>
>>         TabPane tabPane = (TabPane)component;
>>
>> @@ -420,7 +424,7 @@
>>         tabPane.getTabPaneAttributeListeners().add(this);
>>
>>         // Add the tab buttons
>> -        tabPane.add(buttonPanorama);
>> +        containerChildAccess.add(buttonPanorama);
>>
>>         Sequence<Component> tabs = tabPane.getTabs();
>>         int selectedIndex = tabPane.getSelectedIndex();
>> @@ -455,7 +459,7 @@
>>         }
>>
>>         // Remove the tab buttons
>> -        tabPane.remove(buttonPanorama);
>> +        containerChildAccess.remove(buttonPanorama);
>>
>>         super.uninstall();
>>     }
>> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraTooltipSkin.java
>> ===================================================================
>> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraTooltipSkin.java   
>> (revision 801535)
>> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraTooltipSkin.java   
>> (working copy)
>> @@ -33,6 +33,7 @@
>> import org.apache.pivot.wtk.Tooltip;
>> import org.apache.pivot.wtk.TooltipListener;
>> import org.apache.pivot.wtk.Window;
>> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>> import org.apache.pivot.wtk.effects.DropShadowDecorator;
>> import org.apache.pivot.wtk.effects.Transition;
>> import org.apache.pivot.wtk.effects.TransitionListener;
>> @@ -113,8 +114,9 @@
>>     }
>>
>>     @Override
>> -    public void install(Component component) {
>> -        super.install(component);
>> +    public void install(Container component,
>> +            ContainerChildAccess containerChildAccess) {
>> +        super.install(component, containerChildAccess);
>>
>>         Tooltip tooltip = (Tooltip)component;
>>
>> Index: wtk/test/org/apache/pivot/wtk/test/CardPaneTest.java
>> ===================================================================
>> --- wtk/test/org/apache/pivot/wtk/test/CardPaneTest.java    (revision
>> 801535)
>> +++ wtk/test/org/apache/pivot/wtk/test/CardPaneTest.java    (working
>> copy)
>> @@ -51,7 +51,7 @@
>>         sizeGroup.getGroupListeners().add(new Button.GroupListener() {
>>             public void selectionChanged(Button.Group buttonGroup,
>> Button previousSelection) {
>>                 final Button selection = buttonGroup.getSelection();
>> -                int selectedIndex = selection == null ? -1 :
>> selection.getParent().indexOf(selection);
>> +                int selectedIndex = selection == null ? -1 :
>> ((CardPane)selection.getParent()).indexOf(selection);
>>
>>                 cardPane.getCardPaneListeners().add(new
>> CardPaneListener.Adapter() {
>>                     public Vote previewSelectedIndexChange(CardPane
>> cardPane, int selectedIndex) {
>
>


Re: reducing container APIs

Posted by Greg Brown <gk...@mac.com>.
It's an interesting idea for sure. But, to me, it seems just a bit  
over-designed. There are lots of different ways a careless developer  
might shoot himself in the foot. We can't protect developers from  
absolutely every potential for code misuse.

We also try not to impose too many restrictions on developers. Yes, it  
incurs more potential for error, but it also maximizes flexibility. So  
I would not be in favor of this change.

G


On Aug 6, 2009, at 7:16 AM, Noel Grandin wrote:

> Hi
>
> I've always felt uncomfortable with the degree of access that user  
> code has to a Container's child Components.
>
> So I borrowed a trick from the Object Capability guys and came up  
> with the following patch.
>
> Basically, what it does it to hand a special object to the Skin  
> class so that it has privileged access to the Container's children.
>
> In this way, Container subclasses can decide for themselves what  
> degree of access they wish to permit to user code.
>
> Comments?
>
> Regards, Noel.
>
> Property changes on: .
> ___________________________________________________________________
> Added: svn:ignore
>   + .classpath
> .project
> baseline.june8.2.patch
> baseline.june8.patch
> baseline.june9.2.patch
> baseline.june9.patch
> .settings
>
>
> Index: tutorials/src/org/apache/pivot/tutorials/transition/ 
> Transitions.java
> ===================================================================
> --- tutorials/src/org/apache/pivot/tutorials/transition/ 
> Transitions.java	(revision 801535)
> +++ tutorials/src/org/apache/pivot/tutorials/transition/ 
> Transitions.java	(working copy)
> @@ -18,6 +18,7 @@
>
> import org.apache.pivot.collections.Map;
> import org.apache.pivot.wtk.Application;
> +import org.apache.pivot.wtk.BoxPane;
> import org.apache.pivot.wtk.Button;
> import org.apache.pivot.wtk.ButtonPressListener;
> import org.apache.pivot.wtk.Component;
> @@ -61,7 +62,7 @@
>
>                             if (!transition.isReversed()) {
>                                 Component component =  
> collapseTransition.getComponent();
> -                                 
> component.getParent().remove(component);
> +                                 
> ((BoxPane)component.getParent()).remove(component);
>                             }
>
>                             Transitions.this.collapseTransition =  
> null;
> Index: wtk/src/org/apache/pivot/wtk/BoxPane.java
> ===================================================================
> --- wtk/src/org/apache/pivot/wtk/BoxPane.java	(revision 801535)
> +++ wtk/src/org/apache/pivot/wtk/BoxPane.java	(working copy)
> @@ -24,7 +24,7 @@
>  *
>  * @author gbrown
>  */
> -public class BoxPane extends Container {
> +public class BoxPane extends SequenceContainer {
>     private static class BoxPaneListenerList extends  
> ListenerList<BoxPaneListener>
>         implements BoxPaneListener {
>         public void orientationChanged(BoxPane boxPane) {
> Index: wtk/src/org/apache/pivot/wtk/CardPane.java
> ===================================================================
> --- wtk/src/org/apache/pivot/wtk/CardPane.java	(revision 801535)
> +++ wtk/src/org/apache/pivot/wtk/CardPane.java	(working copy)
> @@ -27,7 +27,7 @@
>  *
>  * @author gbrown
>  */
> -public class CardPane extends Container {
> +public class CardPane extends SequenceContainer {
>     private static class CardPaneListenerList extends  
> ListenerList<CardPaneListener>
>         implements CardPaneListener {
>         public Vote previewSelectedIndexChange(CardPane cardPane,  
> int selectedIndex) {
> Index: wtk/src/org/apache/pivot/wtk/Container.java
> ===================================================================
> --- wtk/src/org/apache/pivot/wtk/Container.java	(revision 801535)
> +++ wtk/src/org/apache/pivot/wtk/Container.java	(working copy)
> @@ -46,8 +46,55 @@
>  *
>  * @author gbrown
>  */
> -public abstract class Container extends Component
> -    implements Sequence<Component>, Iterable<Component> {
> +public abstract class Container extends Component {
> +
> +    /**
> +     * This class is used to give privileged access to the children  
> of the container to the skin class.
> +     * (an example of the Object Capability pattern).
> +     *
> +     * Subclasses of container normally want finer control over how  
> they expose their children, so they
> +     * can define more specific methods for setting/modifying  
> children.
> +     *
> +     * @author Noel Grandin
> +     */
> +    public final class ContainerChildAccess implements  
> Sequence<Component>, Iterable<Component> {
> +        public Component update(int index, Component component) {
> +            return Container.this.update(index, component);
> +        }
> +
> +        public int indexOf(Component component) {
> +            return Container.this.indexOf(component);
> +        }
> +
> +        public final int remove(Component component) {
> +            return Container.this.remove(component);
> +        }
> +
> +        public Sequence<Component> remove(int index, int count) {
> +            return Container.this.remove(index, count);
> +        }
> +
> +        public int getLength() {
> +            return Container.this.getLength();
> +        }
> +
> +        public final int add(Component component) {
> +            return Container.this.add(component);
> +        }
> +
> +        public Component get(int index) {
> +            return Container.this.get(index);
> +        }
> +
> +        public void insert(Component component, int index) {
> +            Container.this.insert(component, index);
> +        }
> +
> +        public Iterator<Component> iterator() {
> +            return Container.this.iterator();
> +        }
> +    }
> +
>     private static class ContainerListenerList extends  
> ListenerList<ContainerListener>
>         implements ContainerListener {
>         public void componentInserted(Container container, int  
> index) {
> @@ -134,15 +181,31 @@
>
>     private ContainerListenerList containerListeners = new  
> ContainerListenerList();
>     private ContainerMouseListenerList containerMouseListeners = new  
> ContainerMouseListenerList();
> +    private final ContainerChildAccess containerChildAccess = new  
> ContainerChildAccess();
> +
> +    /**
> +     * Sets the skin, replacing any previous skin.
> +     *
> +     * @param skin
> +     * The new skin.
> +     */
> +    protected final void  
> setSkin(org.apache.pivot.wtk.skin.ContainerSkin skin) {
> +        super.setSkin(skin);
> +
> +        skin.install(this, containerChildAccess);
>
> -    public final int add(Component component) {
> +        invalidate();
> +        repaint();
> +    }
> +
> +    protected int add(Component component) {
>         int i = getLength();
>         insert(component, i);
>
>         return i;
>     }
>
> -    public void insert(Component component, int index) {
> +    protected void insert(Component component, int index) {
>         if (component == null) {
>             throw new IllegalArgumentException("component is null.");
>         }
> @@ -167,11 +230,11 @@
>         containerListeners.componentInserted(Container.this, index);
>     }
>
> -    public Component update(int index, Component component) {
> +    protected Component update(int index, Component component) {
>         throw new UnsupportedOperationException();
>     }
>
> -    public final int remove(Component component) {
> +    protected int remove(Component component) {
>         int index = indexOf(component);
>         if (index != -1) {
>             remove(index, 1);
> @@ -180,7 +243,7 @@
>         return index;
>     }
>
> -    public Sequence<Component> remove(int index, int count) {
> +    protected Sequence<Component> remove(int index, int count) {
>         Sequence<Component> removed = components.remove(index, count);
>
>         // Set the removed components' parent to null and repaint  
> the area
> @@ -208,7 +271,7 @@
>         return removed;
>     }
>
> -    public final Sequence<Component> removeAll() {
> +    protected final Sequence<Component> removeAll() {
>         return remove(0, getLength());
>     }
>
> @@ -221,7 +284,7 @@
>      * @param from
>      * @param to
>      */
> -    protected void move(int from, int to) {
> +    protected final void move(int from, int to) {
>         if (from != to) {
>             Sequence<Component> removed = components.remove(from, 1);
>             Component component = removed.get(0);
> @@ -232,19 +295,19 @@
>         }
>     }
>
> -    public Component get(int index) {
> +    protected Component get(int index) {
>         return components.get(index);
>     }
>
> -    public int indexOf(Component component) {
> +    protected int indexOf(Component component) {
>         return components.indexOf(component);
>     }
>
> -    public int getLength() {
> +    protected int getLength() {
>         return components.getLength();
>     }
>
> -    public Iterator<Component> iterator() {
> +    protected Iterator<Component> iterator() {
>         return new  
> ImmutableIterator<Component>(components.iterator());
>     }
>
> Index: wtk/src/org/apache/pivot/wtk/FlowPane.java
> ===================================================================
> --- wtk/src/org/apache/pivot/wtk/FlowPane.java	(revision 801535)
> +++ wtk/src/org/apache/pivot/wtk/FlowPane.java	(working copy)
> @@ -22,7 +22,7 @@
>  *
>  * @author gbrown
>  */
> -public class FlowPane extends Container {
> +public class FlowPane extends SequenceContainer {
>     public FlowPane() {
>         installSkin(FlowPane.class);
>     }
> Index: wtk/src/org/apache/pivot/wtk/SequenceContainer.java
> ===================================================================
> --- wtk/src/org/apache/pivot/wtk/SequenceContainer.java	(revision 0)
> +++ wtk/src/org/apache/pivot/wtk/SequenceContainer.java	(revision 0)
> @@ -0,0 +1,81 @@
> +package org.apache.pivot.wtk;
> +
> +import java.util.Iterator;
> +
> +import org.apache.pivot.collections.Sequence;
> +
> +/**
> + * Utility base class for those Container subclasses which want to  
> expose their children in a straight-forward way.
> + *
> + * @author Noel Grandin
> + */
> +public class SequenceContainer extends Container implements  
> Sequence<Component>, Iterable<Component> {
> +
> +    public Component update(int index, Component component) {
> +        throw new UnsupportedOperationException();
> +    }
> +
> +    /**
> +     * override and make public
> +     */
> +    @Override
> +    public int indexOf(Component component) {
> +        return super.indexOf(component);
> +    }
> +
> +    /**
> +     * override and make public
> +     */
> +    @Override
> +    public final int remove(Component component) {
> +        return super.remove(component);
> +    }
> +
> +    /**
> +     * override and make public
> +     */
> +    @Override
> +    public Sequence<Component> remove(int index, int count) {
> +        return super.remove(index, count);
> +    }
> +
> +    /**
> +     * override and make public
> +     */
> +    @Override
> +    public int getLength() {
> +        return super.getLength();
> +    }
> +
> +    /**
> +     * override and make public
> +     */
> +    @Override
> +    public final int add(Component component) {
> +        return super.add(component);
> +    }
> +
> +    /**
> +     * override and make public
> +     */
> +    @Override
> +    public Component get(int index) {
> +        return super.get(index);
> +    }
> +
> +    /**
> +     * override and make public
> +     */
> +    @Override
> +    public void insert(Component component, int index) {
> +        super.insert(component, index);
> +    }
> +
> +    /**
> +     * override and make public
> +     */
> +    @Override
> +    public final Iterator<Component> iterator() {
> +        return super.iterator();
> +    }
> +}
> Index: wtk/src/org/apache/pivot/wtk/skin/BorderSkin.java
> ===================================================================
> --- wtk/src/org/apache/pivot/wtk/skin/BorderSkin.java	(revision  
> 801535)
> +++ wtk/src/org/apache/pivot/wtk/skin/BorderSkin.java	(working copy)
> @@ -31,12 +31,14 @@
> import org.apache.pivot.wtk.Border;
> import org.apache.pivot.wtk.BorderListener;
> import org.apache.pivot.wtk.Component;
> +import org.apache.pivot.wtk.Container;
> import org.apache.pivot.wtk.CornerRadii;
> import org.apache.pivot.wtk.Dimensions;
> import org.apache.pivot.wtk.GraphicsUtilities;
> import org.apache.pivot.wtk.Insets;
> import org.apache.pivot.wtk.Platform;
> import org.apache.pivot.wtk.Theme;
> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>
>
> /**
> @@ -71,10 +73,11 @@
>     }
>
>     @Override
> -    public void install(Component component) {
> -        super.install(component);
> +    public void install(Container container,
> +            ContainerChildAccess containerChildAccess) {
> +        super.install(container, containerChildAccess);
>
> -        Border border = (Border)component;
> +        Border border = (Border)container;
>         border.getBorderListeners().add(this);
>     }
>
> Index: wtk/src/org/apache/pivot/wtk/skin/BoxPaneSkin.java
> ===================================================================
> --- wtk/src/org/apache/pivot/wtk/skin/BoxPaneSkin.java	(revision  
> 801535)
> +++ wtk/src/org/apache/pivot/wtk/skin/BoxPaneSkin.java	(working copy)
> @@ -18,6 +18,7 @@
>
> import org.apache.pivot.collections.Dictionary;
> import org.apache.pivot.wtk.Component;
> +import org.apache.pivot.wtk.Container;
> import org.apache.pivot.wtk.Dimensions;
> import org.apache.pivot.wtk.BoxPane;
> import org.apache.pivot.wtk.BoxPaneListener;
> @@ -25,6 +26,7 @@
> import org.apache.pivot.wtk.Insets;
> import org.apache.pivot.wtk.Orientation;
> import org.apache.pivot.wtk.VerticalAlignment;
> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>
> /**
>  * Box pane skin.
> @@ -43,10 +45,11 @@
>     private boolean fill = false;
>
>     @Override
> -    public void install(Component component) {
> -        super.install(component);
> +    public void install(Container container,
> +            ContainerChildAccess containerChildAccess) {
> +        super.install(container, containerChildAccess);
>
> -        BoxPane boxPane = (BoxPane)component;
> +        BoxPane boxPane = (BoxPane)container;
>         boxPane.getBoxPaneListeners().add(this);
>     }
>
> Index: wtk/src/org/apache/pivot/wtk/skin/CalendarSkin.java
> ===================================================================
> --- wtk/src/org/apache/pivot/wtk/skin/CalendarSkin.java	(revision  
> 801535)
> +++ wtk/src/org/apache/pivot/wtk/skin/CalendarSkin.java	(working copy)
> @@ -19,8 +19,8 @@
> import org.apache.pivot.wtk.Calendar;
> import org.apache.pivot.wtk.CalendarListener;
> import org.apache.pivot.wtk.CalendarSelectionListener;
> -import org.apache.pivot.wtk.Component;
> -import org.apache.pivot.wtk.skin.ContainerSkin;
> +import org.apache.pivot.wtk.Container;
> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>
> /**
>  * Abstract base class for calendar skins.
> @@ -30,10 +30,11 @@
> public abstract class CalendarSkin extends ContainerSkin
>     implements CalendarListener, CalendarSelectionListener {
>     @Override
> -    public void install(Component component) {
> -        super.install(component);
> +    public void install(Container container,
> +            ContainerChildAccess containerChildAccess) {
> +        super.install(container, containerChildAccess);
>
> -        Calendar calendar = (Calendar)component;
> +        Calendar calendar = (Calendar)container;
>         calendar.getCalendarListeners().add(this);
>         calendar.getCalendarSelectionListeners().add(this);
>     }
> Index: wtk/src/org/apache/pivot/wtk/skin/CardPaneSkin.java
> ===================================================================
> --- wtk/src/org/apache/pivot/wtk/skin/CardPaneSkin.java	(revision  
> 801535)
> +++ wtk/src/org/apache/pivot/wtk/skin/CardPaneSkin.java	(working copy)
> @@ -26,6 +26,7 @@
> import org.apache.pivot.wtk.Dimensions;
> import org.apache.pivot.wtk.Insets;
> import org.apache.pivot.wtk.Orientation;
> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
> import org.apache.pivot.wtk.effects.FadeDecorator;
> import org.apache.pivot.wtk.effects.ScaleDecorator;
> import org.apache.pivot.wtk.effects.Transition;
> @@ -74,9 +75,8 @@
>             this.from = from;
>             this.to = to;
>
> -            CardPane cardPane = (CardPane)getComponent();
> -            fromCard = (from == -1) ? null : cardPane.get(from);
> -            toCard = (to == -1) ? null : cardPane.get(to);
> +            fromCard = (from == -1) ? null :  
> containerChildAccess.get(from);
> +            toCard = (to == -1) ? null :  
> containerChildAccess.get(to);
>         }
>     }
>
> @@ -305,10 +305,11 @@
>     public static final int SELECTION_CHANGE_RATE = 30;
>
>     @Override
> -    public void install(Component component) {
> -        super.install(component);
> +    public void install(Container container,
> +            ContainerChildAccess containerChildAccess) {
> +        super.install(container, containerChildAccess);
>
> -        CardPane cardPane = (CardPane)component;
> +        CardPane cardPane = (CardPane)container;
>         cardPane.getCardPaneListeners().add(this);
>     }
>
> @@ -328,8 +329,7 @@
>             Dimensions preferredSize = getPreferredSize();
>             preferredWidth = preferredSize.width;
>         } else {
> -            CardPane cardPane = (CardPane)getComponent();
> -            for (Component card : cardPane) {
> +            for (Component card : containerChildAccess) {
>                 preferredWidth = Math.max(preferredWidth,  
> card.getPreferredWidth(height));
>             }
>
> @@ -347,8 +347,7 @@
>             Dimensions preferredSize = getPreferredSize();
>             preferredHeight = preferredSize.height;
>         } else {
> -            CardPane cardPane = (CardPane)getComponent();
> -            for (Component card : cardPane) {
> +            for (Component card : containerChildAccess) {
>                 preferredHeight = Math.max(preferredHeight,  
> card.getPreferredHeight(width));
>             }
>
> @@ -402,7 +401,7 @@
>                 preferredHeight = previousHeight + (int)((height -  
> previousHeight) * percentComplete);
>             }
>         } else {
> -            for (Component card : cardPane) {
> +            for (Component card : containerChildAccess) {
>                 Dimensions cardSize = card.getPreferredSize();
>
>                 preferredWidth = Math.max(cardSize.width,  
> preferredWidth);
> @@ -419,11 +418,10 @@
>     public void layout() {
>         // Set the size of all components to match the size of the  
> stack pane,
>         // minus padding
> -        CardPane cardPane = (CardPane)getComponent();
>         int width = getWidth() - (padding.left + padding.right);
>         int height = getHeight() - (padding.top + padding.bottom);
>
> -        for (Component card : cardPane) {
> +        for (Component card : containerChildAccess) {
>             card.setLocation(padding.left, padding.top);
>             card.setSize(width, height);
>         }
> @@ -512,10 +510,10 @@
>         super.componentInserted(container, index);
>
>         CardPane cardPane = (CardPane)container;
> -        Component card = cardPane.get(index);
> +        Component card = containerChildAccess.get(index);
>         card.setVisible(false);
>
> -        if (cardPane.getLength() == 1) {
> +        if (containerChildAccess.getLength() == 1) {
>             cardPane.setSelectedIndex(0);
>         }
>
> @@ -596,7 +594,7 @@
>                         SelectionChangeTransition  
> selectionChangeTransition =
>                             (SelectionChangeTransition)transition;
>
> -                        int selectedIndex =  
> cardPane.indexOf(selectionChangeTransition.toCard);
> +                        int selectedIndex =  
> containerChildAccess.indexOf(selectionChangeTransition.toCard);
>                         cardPane.setSelectedIndex(selectedIndex);
>                         CardPaneSkin.this.selectionChangeTransition  
> = null;
>                     }
> @@ -632,12 +630,12 @@
>     public void selectedIndexChanged(CardPane cardPane, int  
> previousSelectedIndex) {
>         int selectedIndex = cardPane.getSelectedIndex();
>         if (selectedIndex != -1) {
> -            Component selectedCard = cardPane.get(selectedIndex);
> +            Component selectedCard =  
> containerChildAccess.get(selectedIndex);
>             selectedCard.setVisible(true);
>         }
>
>         if (previousSelectedIndex != -1) {
> -            Component previousSelectedCard =  
> cardPane.get(previousSelectedIndex);
> +            Component previousSelectedCard =  
> containerChildAccess.get(previousSelectedIndex);
>             previousSelectedCard.setVisible(false);
>         }
>
> Index: wtk/src/org/apache/pivot/wtk/skin/ContainerSkin.java
> ===================================================================
> --- wtk/src/org/apache/pivot/wtk/skin/ContainerSkin.java	(revision  
> 801535)
> +++ wtk/src/org/apache/pivot/wtk/skin/ContainerSkin.java	(working  
> copy)
> @@ -38,13 +38,16 @@
>  */
> public abstract class ContainerSkin extends ComponentSkin
>     implements ContainerListener {
> +
> +    protected Container.ContainerChildAccess containerChildAccess;
> +
>     /**
>      * Focus traversal policy that determines traversal order based  
> on the order
>      * of components in the container's component sequence.
>      *
>      * @author gbrown
>      */
> -    public static class IndexFocusTraversalPolicy implements  
> FocusTraversalPolicy {
> +    public class IndexFocusTraversalPolicy implements  
> FocusTraversalPolicy {
>         private boolean wrap;
>
>         public IndexFocusTraversalPolicy() {
> @@ -59,6 +62,9 @@
>             if (container == null) {
>                 throw new IllegalArgumentException("container is  
> null.");
>             }
> +            if (container != ContainerSkin.this.getComponent()) {
> +                throw new IllegalArgumentException("wrong  
> container.");
> +            }
>
>             if (direction == null) {
>                 throw new IllegalArgumentException("direction is  
> null.");
> @@ -66,26 +72,26 @@
>
>             Component nextComponent = null;
>
> -            int n = container.getLength();
> +            int n = containerChildAccess.getLength();
>             if (n > 0) {
>                 switch (direction) {
>                     case FORWARD: {
>                         if (component == null) {
>                             // Return the first component in the  
> sequence
> -                            nextComponent = container.get(0);
> +                            nextComponent =  
> containerChildAccess.get(0);
>                         } else {
>                             // Return the next component in the  
> sequence
> -                            int index = container.indexOf(component);
> +                            int index =  
> containerChildAccess.indexOf(component);
>                             if (index == -1) {
>                                 throw new IllegalArgumentException();
>                             }
>
>                             if (index < n - 1) {
> -                                nextComponent = container.get(index  
> + 1);
> +                                nextComponent =  
> containerChildAccess.get(index + 1);
>                             } else {
>                                 if (wrap
>                                     && container.containsFocus()) {
> -                                    nextComponent = container.get(0);
> +                                    nextComponent =  
> containerChildAccess.get(0);
>                                 }
>                             }
>                         }
> @@ -96,20 +102,20 @@
>                     case BACKWARD: {
>                         if (component == null) {
>                             // Return the last component in the  
> sequence
> -                            nextComponent = container.get(n - 1);
> +                            nextComponent =  
> containerChildAccess.get(n - 1);
>                         } else {
>                             // Return the previous component in the  
> sequence
> -                            int index = container.indexOf(component);
> +                            int index =  
> containerChildAccess.indexOf(component);
>                             if (index == -1) {
>                                 throw new IllegalArgumentException();
>                             }
>
>                             if (index > 0) {
> -                                nextComponent = container.get(index  
> - 1);
> +                                nextComponent =  
> containerChildAccess.get(index - 1);
>                             } else {
>                                 if (wrap
>                                     && container.containsFocus()) {
> -                                    nextComponent = container.get(n  
> - 1);
> +                                    nextComponent =  
> containerChildAccess.get(n - 1);
>                                 }
>                             }
>                         }
> @@ -125,12 +131,21 @@
>
>     private Paint backgroundPaint = null;
>
> +    /**
> +     * Make this final so that none of the subclasses can override  
> it.
> +     * They need to override the other install() method.
> +     */
>     @Override
> -    public void install(Component component) {
> +    public final void install(Component component) {
> +        //check that none of the subclasses is accidentally calling  
> me.
> +        if (this.containerChildAccess!=null) throw new  
> IllegalStateException("wrong calling sequence");
> +
>         super.install(component);
> -
> -        Container container = (Container)component;
> -
> +    }
> +
> +    public void install(Container container,  
> Container.ContainerChildAccess containerChildAccess) {
> +        this.containerChildAccess = containerChildAccess;
> +
>         // Add this as a container listener
>         container.getContainerListeners().add(this);
>
> Index: wtk/src/org/apache/pivot/wtk/skin/DisplaySkin.java
> ===================================================================
> --- wtk/src/org/apache/pivot/wtk/skin/DisplaySkin.java	(revision  
> 801535)
> +++ wtk/src/org/apache/pivot/wtk/skin/DisplaySkin.java	(working copy)
> @@ -19,9 +19,11 @@
> import java.awt.Color;
>
> import org.apache.pivot.wtk.Component;
> +import org.apache.pivot.wtk.Container;
> import org.apache.pivot.wtk.Dimensions;
> import org.apache.pivot.wtk.Display;
> import org.apache.pivot.wtk.Window;
> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>
> /**
>  * Display skin.
> @@ -38,19 +40,20 @@
>     }
>
>     @Override
> -    public void install(Component component) {
> -        if (!(component instanceof Display)) {
> +    public void install(Container container,
> +            ContainerChildAccess containerChildAccess) {
> +        if (!(container instanceof Display)) {
>             throw new IllegalArgumentException("DisplaySkin can only  
> be installed on instances of Display.");
>         }
>
> -        super.install(component);
> +        super.install(container, containerChildAccess);
>     }
>
>     public void layout() {
>         Display display = (Display)getComponent();
>
>         // Set all components to their preferred sizes
> -        for (Component component : display) {
> +        for (Component component : containerChildAccess) {
>             Window window = (Window)component;
>
>             if (window.isDisplayable()) {
> Index: wtk/src/org/apache/pivot/wtk/skin/ExpanderSkin.java
> ===================================================================
> --- wtk/src/org/apache/pivot/wtk/skin/ExpanderSkin.java	(revision  
> 801535)
> +++ wtk/src/org/apache/pivot/wtk/skin/ExpanderSkin.java	(working copy)
> @@ -18,8 +18,10 @@
>
> import org.apache.pivot.util.Vote;
> import org.apache.pivot.wtk.Component;
> +import org.apache.pivot.wtk.Container;
> import org.apache.pivot.wtk.Expander;
> import org.apache.pivot.wtk.ExpanderListener;
> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>
> /**
>  * Abstract base class for expander skins.
> @@ -29,10 +31,11 @@
> public abstract class ExpanderSkin extends ContainerSkin
>     implements ExpanderListener {
>     @Override
> -    public void install(Component component) {
> -        super.install(component);
> +    public void install(Container container,
> +            ContainerChildAccess containerChildAccess) {
> +        super.install(container, containerChildAccess);
>
> -        Expander expander = (Expander)component;
> +        Expander expander = (Expander)container;
>         expander.getExpanderListeners().add(this);
>     }
>
> Index: wtk/src/org/apache/pivot/wtk/skin/FileBrowserSkin.java
> ===================================================================
> --- wtk/src/org/apache/pivot/wtk/skin/FileBrowserSkin.java	(revision  
> 801535)
> +++ wtk/src/org/apache/pivot/wtk/skin/FileBrowserSkin.java	(working  
> copy)
> @@ -17,8 +17,10 @@
> package org.apache.pivot.wtk.skin;
>
> import org.apache.pivot.wtk.Component;
> +import org.apache.pivot.wtk.Container;
> import org.apache.pivot.wtk.FileBrowser;
> import org.apache.pivot.wtk.FileBrowserListener;
> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
> import org.apache.pivot.wtk.skin.ContainerSkin;
>
> /**
> @@ -28,10 +30,11 @@
>  */
> public abstract class FileBrowserSkin extends ContainerSkin  
> implements FileBrowserListener {
>     @Override
> -    public void install(Component component) {
> -        super.install(component);
> +    public void install(Container container,
> +            ContainerChildAccess containerChildAccess) {
> +        super.install(container, containerChildAccess);
>
> -        FileBrowser fileBrowser = (FileBrowser)component;
> +        FileBrowser fileBrowser = (FileBrowser)container;
>         fileBrowser.getFileBrowserListeners().add(this);
>     }
>
> Index: wtk/src/org/apache/pivot/wtk/skin/FlowPaneSkin.java
> ===================================================================
> --- wtk/src/org/apache/pivot/wtk/skin/FlowPaneSkin.java	(revision  
> 801535)
> +++ wtk/src/org/apache/pivot/wtk/skin/FlowPaneSkin.java	(working copy)
> @@ -19,10 +19,12 @@
> import org.apache.pivot.collections.ArrayList;
> import org.apache.pivot.collections.Dictionary;
> import org.apache.pivot.wtk.Component;
> +import org.apache.pivot.wtk.Container;
> import org.apache.pivot.wtk.Dimensions;
> import org.apache.pivot.wtk.FlowPane;
> import org.apache.pivot.wtk.HorizontalAlignment;
> import org.apache.pivot.wtk.Insets;
> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>
> public class FlowPaneSkin extends ContainerSkin {
>     private HorizontalAlignment alignment = HorizontalAlignment.LEFT;
> @@ -32,8 +34,9 @@
>     private boolean alignToBaseline = false;
>
>     @Override
> -    public void install(Component component) {
> -        super.install(component);
> +    public void install(Container container,
> +            ContainerChildAccess containerChildAccess) {
> +        super.install(container, containerChildAccess);
>     }
>
>     @Override
> Index: wtk/src/org/apache/pivot/wtk/skin/RollupSkin.java
> ===================================================================
> --- wtk/src/org/apache/pivot/wtk/skin/RollupSkin.java	(revision  
> 801535)
> +++ wtk/src/org/apache/pivot/wtk/skin/RollupSkin.java	(working copy)
> @@ -18,9 +18,11 @@
>
> import org.apache.pivot.util.Vote;
> import org.apache.pivot.wtk.Component;
> +import org.apache.pivot.wtk.Container;
> import org.apache.pivot.wtk.Rollup;
> import org.apache.pivot.wtk.RollupListener;
> import org.apache.pivot.wtk.RollupStateListener;
> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>
>
> /**
> @@ -31,10 +33,11 @@
> public abstract class RollupSkin extends ContainerSkin
>     implements RollupListener, RollupStateListener {
>     @Override
> -    public void install(Component component) {
> -        super.install(component);
> +    public void install(Container container,
> +            ContainerChildAccess containerChildAccess) {
> +        super.install(container, containerChildAccess);
>
> -        Rollup rollup = (Rollup)component;
> +        Rollup rollup = (Rollup)container;
>         rollup.getRollupListeners().add(this);
>         rollup.getRollupStateListeners().add(this);
>     }
> Index: wtk/src/org/apache/pivot/wtk/skin/ScrollPaneSkin.java
> ===================================================================
> --- wtk/src/org/apache/pivot/wtk/skin/ScrollPaneSkin.java	(revision  
> 801535)
> +++ wtk/src/org/apache/pivot/wtk/skin/ScrollPaneSkin.java	(working  
> copy)
> @@ -24,6 +24,7 @@
> import org.apache.pivot.wtk.ApplicationContext;
> import org.apache.pivot.wtk.Bounds;
> import org.apache.pivot.wtk.Component;
> +import org.apache.pivot.wtk.Container;
> import org.apache.pivot.wtk.DesktopApplicationContext;
> import org.apache.pivot.wtk.Dimensions;
> import org.apache.pivot.wtk.Keyboard;
> @@ -35,6 +36,7 @@
> import org.apache.pivot.wtk.ScrollPaneListener;
> import org.apache.pivot.wtk.Viewport;
> import org.apache.pivot.wtk.ViewportListener;
> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
> import org.apache.pivot.wtk.ScrollPane.Corner;
> import org.apache.pivot.wtk.ScrollPane.ScrollBarPolicy;
>
> @@ -75,20 +77,21 @@
>     }
>
>     @Override
> -    public void install(Component component) {
> -        super.install(component);
> +    public void install(Container container,
> +            ContainerChildAccess containerChildAccess) {
> +        super.install(container, containerChildAccess);
>
> -        ScrollPane scrollPane = (ScrollPane)component;
> +        ScrollPane scrollPane = (ScrollPane)container;
>         scrollPane.getViewportListeners().add(this);
>         scrollPane.getScrollPaneListeners().add(this);
>
> -        scrollPane.add(horizontalScrollBar);
> -        scrollPane.add(verticalScrollBar);
> +        containerChildAccess.add(horizontalScrollBar);
> +        containerChildAccess.add(verticalScrollBar);
>
> -        scrollPane.add(topLeftCorner);
> -        scrollPane.add(bottomLeftCorner);
> -        scrollPane.add(bottomRightCorner);
> -        scrollPane.add(topRightCorner);
> +        containerChildAccess.add(topLeftCorner);
> +        containerChildAccess.add(bottomLeftCorner);
> +        containerChildAccess.add(bottomRightCorner);
> +        containerChildAccess.add(topRightCorner);
>
>         horizontalScrollBar.getScrollBarValueListeners().add(this);
>         verticalScrollBar.getScrollBarValueListeners().add(this);
> @@ -100,13 +103,13 @@
>         scrollPane.getViewportListeners().remove(this);
>         scrollPane.getScrollPaneListeners().remove(this);
>
> -        scrollPane.remove(horizontalScrollBar);
> -        scrollPane.remove(verticalScrollBar);
> +        containerChildAccess.remove(horizontalScrollBar);
> +        containerChildAccess.remove(verticalScrollBar);
>
> -        scrollPane.remove(topLeftCorner);
> -        scrollPane.remove(bottomLeftCorner);
> -        scrollPane.remove(bottomRightCorner);
> -        scrollPane.remove(topRightCorner);
> +        containerChildAccess.remove(topLeftCorner);
> +        containerChildAccess.remove(bottomLeftCorner);
> +        containerChildAccess.remove(bottomRightCorner);
> +        containerChildAccess.remove(topRightCorner);
>
>         horizontalScrollBar.getScrollBarValueListeners().remove(this);
>         verticalScrollBar.getScrollBarValueListeners().remove(this);
> Index: wtk/src/org/apache/pivot/wtk/skin/SliderSkin.java
> ===================================================================
> --- wtk/src/org/apache/pivot/wtk/skin/SliderSkin.java	(revision  
> 801535)
> +++ wtk/src/org/apache/pivot/wtk/skin/SliderSkin.java	(working copy)
> @@ -17,9 +17,11 @@
> package org.apache.pivot.wtk.skin;
>
> import org.apache.pivot.wtk.Component;
> +import org.apache.pivot.wtk.Container;
> import org.apache.pivot.wtk.Slider;
> import org.apache.pivot.wtk.SliderListener;
> import org.apache.pivot.wtk.SliderValueListener;
> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>
> /**
>  * Abstract base class for slider skins.
> @@ -29,10 +31,11 @@
> public abstract class SliderSkin extends ContainerSkin
>     implements SliderListener, SliderValueListener {
>     @Override
> -    public void install(Component component) {
> -        super.install(component);
> +    public void install(Container container,
> +            ContainerChildAccess containerChildAccess) {
> +        super.install(container, containerChildAccess);
>
> -        Slider slider = (Slider)component;
> +        Slider slider = (Slider)container;
>         slider.getSliderListeners().add(this);
>         slider.getSliderValueListeners().add(this);
>     }
> Index: wtk/src/org/apache/pivot/wtk/skin/StackPaneSkin.java
> ===================================================================
> --- wtk/src/org/apache/pivot/wtk/skin/StackPaneSkin.java	(revision  
> 801535)
> +++ wtk/src/org/apache/pivot/wtk/skin/StackPaneSkin.java	(working  
> copy)
> @@ -20,7 +20,6 @@
> import org.apache.pivot.wtk.Component;
> import org.apache.pivot.wtk.Dimensions;
> import org.apache.pivot.wtk.Insets;
> -import org.apache.pivot.wtk.StackPane;
>
> /**
>  * Stack pane skin.
> @@ -32,9 +31,8 @@
>
>     public int getPreferredWidth(int height) {
>         int preferredWidth = 0;
> -        StackPane stackPane = (StackPane)getComponent();
>
> -        for (Component component : stackPane) {
> +        for (Component component : containerChildAccess) {
>             preferredWidth = Math.max(preferredWidth,
>                 component.getPreferredWidth(height));
>         }
> @@ -46,9 +44,8 @@
>
>     public int getPreferredHeight(int width) {
>         int preferredHeight = 0;
> -        StackPane stackPane = (StackPane)getComponent();
>
> -        for (Component component : stackPane) {
> +        for (Component component : containerChildAccess) {
>             preferredHeight = Math.max(preferredHeight,
>                 component.getPreferredHeight(width));
>         }
> @@ -62,9 +59,7 @@
>         int preferredWidth = 0;
>         int preferredHeight = 0;
>
> -        StackPane stackPane = (StackPane)getComponent();
> -
> -        for (Component component : stackPane) {
> +        for (Component component : containerChildAccess) {
>             Dimensions preferredCardSize =  
> component.getPreferredSize();
>
>             preferredWidth = Math.max(preferredWidth,
> @@ -83,12 +78,10 @@
>     public void layout() {
>         // Set the size of all components to match the size of the  
> stack pane,
>         // minus padding
> -        StackPane stackPane = (StackPane)getComponent();
> -
>         int width = getWidth() - (padding.left + padding.right);
>         int height = getHeight() - (padding.top + padding.bottom);
>
> -        for (Component component : stackPane) {
> +        for (Component component : containerChildAccess) {
>             component.setLocation(padding.left, padding.top);
>             component.setSize(width, height);
>         }
> Index: wtk/src/org/apache/pivot/wtk/skin/TablePaneSkin.java
> ===================================================================
> --- wtk/src/org/apache/pivot/wtk/skin/TablePaneSkin.java	(revision  
> 801535)
> +++ wtk/src/org/apache/pivot/wtk/skin/TablePaneSkin.java	(working  
> copy)
> @@ -27,6 +27,7 @@
> import org.apache.pivot.collections.Sequence;
> import org.apache.pivot.wtk.Bounds;
> import org.apache.pivot.wtk.Component;
> +import org.apache.pivot.wtk.Container;
> import org.apache.pivot.wtk.Dimensions;
> import org.apache.pivot.wtk.GraphicsUtilities;
> import org.apache.pivot.wtk.Insets;
> @@ -34,6 +35,7 @@
> import org.apache.pivot.wtk.TablePane;
> import org.apache.pivot.wtk.TablePaneAttributeListener;
> import org.apache.pivot.wtk.TablePaneListener;
> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>
>
> /**
> @@ -57,10 +59,11 @@
>     private int[] rowHeights = null;
>
>     @Override
> -    public void install(Component component) {
> -        super.install(component);
> +    public void install(Container container,
> +            ContainerChildAccess containerChildAccess) {
> +        super.install(container, containerChildAccess);
>
> -        TablePane tablePane = (TablePane)component;
> +        TablePane tablePane = (TablePane)container;
>         tablePane.getTablePaneListeners().add(this);
>         tablePane.getTablePaneAttributeListeners().add(this);
>     }
> Index: wtk/src/org/apache/pivot/wtk/skin/WindowSkin.java
> ===================================================================
> --- wtk/src/org/apache/pivot/wtk/skin/WindowSkin.java	(revision  
> 801535)
> +++ wtk/src/org/apache/pivot/wtk/skin/WindowSkin.java	(working copy)
> @@ -28,6 +28,7 @@
> import org.apache.pivot.wtk.Window;
> import org.apache.pivot.wtk.WindowListener;
> import org.apache.pivot.wtk.WindowStateListener;
> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
> import org.apache.pivot.wtk.media.Image;
>
> /**
> @@ -66,8 +67,9 @@
>     }
>
>     @Override
> -    public void install(Component component) {
> -        super.install(component);
> +    public void install(Container component,
> +            ContainerChildAccess containerChildAccess) {
> +        super.install(component, containerChildAccess);
>
>         Window window = (Window)component;
>         window.getWindowListeners().add(this);
> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraAccordionSkin.java
> ===================================================================
> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraAccordionSkin.java	 
> (revision 801535)
> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraAccordionSkin.java	 
> (working copy)
> @@ -32,6 +32,7 @@
> import org.apache.pivot.wtk.Button;
> import org.apache.pivot.wtk.Component;
> import org.apache.pivot.wtk.ComponentStateListener;
> +import org.apache.pivot.wtk.Container;
> import org.apache.pivot.wtk.Dimensions;
> import org.apache.pivot.wtk.GraphicsUtilities;
> import org.apache.pivot.wtk.HorizontalAlignment;
> @@ -39,6 +40,7 @@
> import org.apache.pivot.wtk.Mouse;
> import org.apache.pivot.wtk.Theme;
> import org.apache.pivot.wtk.Button.Group;
> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
> import org.apache.pivot.wtk.content.ButtonData;
> import org.apache.pivot.wtk.content.ButtonDataRenderer;
> import org.apache.pivot.wtk.effects.ClipDecorator;
> @@ -312,10 +314,12 @@
>         super.setSize(width, height);
>     }
>
> -    public void install(Component component) {
> -        super.install(component);
> +    @Override
> +    public void install(Container container,
> +            ContainerChildAccess containerChildAccess) {
> +        super.install(container, containerChildAccess);
>
> -        Accordion accordion = (Accordion)component;
> +        Accordion accordion = (Accordion)container;
>
>         // Add this as a listener on the accordion
>         accordion.getAccordionListeners().add(this);
> @@ -327,7 +331,7 @@
>             PanelHeader panelHeader = new PanelHeader(panel);
>             panelHeader.setGroup(panelHeaderGroup);
>             panelHeaders.add(panelHeader);
> -            accordion.add(panelHeader);
> +            containerChildAccess.add(panelHeader);
>
>             // Listen for state changes on the panel
>             panelHeader.setEnabled(panel.isEnabled());
> @@ -349,7 +353,7 @@
>              
> panel.getComponentStateListeners().remove(panelStateListener);
>
>             // Remove the header
> -            accordion.remove(panelHeader);
> +            containerChildAccess.remove(panelHeader);
>         }
>
>         super.uninstall();
> @@ -656,7 +660,7 @@
>         PanelHeader panelHeader = new PanelHeader(panel);
>         panelHeader.setGroup(panelHeaderGroup);
>         panelHeaders.insert(panelHeader, index);
> -        accordion.add(panelHeader);
> +        containerChildAccess.add(panelHeader);
>
>         // Listen for state changes on the panel
>         panelHeader.setEnabled(panel.isEnabled());
> @@ -687,7 +691,7 @@
>              
> panel.getComponentStateListeners().remove(panelStateListener);
>
>             // Remove the header
> -            accordion.remove(panelHeader);
> +            containerChildAccess.remove(panelHeader);
>         }
>
>         invalidateComponent();
> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraAlertSkin.java
> ===================================================================
> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraAlertSkin.java	 
> (revision 801535)
> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraAlertSkin.java	 
> (working copy)
> @@ -24,11 +24,13 @@
> import org.apache.pivot.wtk.ButtonPressListener;
> import org.apache.pivot.wtk.Component;
> import org.apache.pivot.wtk.BoxPane;
> +import org.apache.pivot.wtk.Container;
> import org.apache.pivot.wtk.ImageView;
> import org.apache.pivot.wtk.Label;
> import org.apache.pivot.wtk.PushButton;
> import org.apache.pivot.wtk.Theme;
> import org.apache.pivot.wtk.Window;
> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
> import org.apache.pivot.wtkx.WTKXSerializer;
>
>
> @@ -50,8 +52,9 @@
>     }
>
>     @Override
> -    public void install(Component component) {
> -        super.install(component);
> +    public void install(Container component,
> +            ContainerChildAccess containerChildAccess) {
> +        super.install(component, containerChildAccess);
>
>         Alert alert = (Alert)component;
>         alert.getAlertListeners().add(this);
> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraCalendarSkin.java
> ===================================================================
> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraCalendarSkin.java	 
> (revision 801535)
> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraCalendarSkin.java	 
> (working copy)
> @@ -33,6 +33,7 @@
> import org.apache.pivot.wtk.CalendarSelectionListener;
> import org.apache.pivot.wtk.Component;
> import org.apache.pivot.wtk.ComponentMouseButtonListener;
> +import org.apache.pivot.wtk.Container;
> import org.apache.pivot.wtk.Cursor;
> import org.apache.pivot.wtk.Dimensions;
> import org.apache.pivot.wtk.GraphicsUtilities;
> @@ -47,6 +48,7 @@
> import org.apache.pivot.wtk.TablePane;
> import org.apache.pivot.wtk.Theme;
> import org.apache.pivot.wtk.Button.Group;
> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
> import org.apache.pivot.wtk.content.ButtonDataRenderer;
> import org.apache.pivot.wtk.content.NumericSpinnerData;
> import org.apache.pivot.wtk.content.SpinnerItemRenderer;
> @@ -500,11 +502,12 @@
>     }
>
>     @Override
> -    public void install(Component component) {
> -        super.install(component);
> +    public void install(Container container,
> +            ContainerChildAccess containerChildAccess) {
> +        super.install(container, containerChildAccess);
>
> -        Calendar calendar = (Calendar)component;
> -        calendar.add(calendarTablePane);
> +        Calendar calendar = (Calendar)container;
> +        containerChildAccess.add(calendarTablePane);
>
>         yearSpinner.setSelectedIndex(calendar.getYear());
>         monthSpinner.setSelectedIndex(calendar.getMonth());
> @@ -514,8 +517,7 @@
>
>     @Override
>     public void uninstall() {
> -        Calendar calendar = (Calendar)getComponent();
> -        calendar.remove(calendarTablePane);
> +        containerChildAccess.remove(calendarTablePane);
>
>         super.uninstall();
>     }
> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraDialogSkin.java
> ===================================================================
> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraDialogSkin.java	 
> (revision 801535)
> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraDialogSkin.java	 
> (working copy)
> @@ -24,6 +24,7 @@
> import org.apache.pivot.wtk.DialogStateListener;
> import org.apache.pivot.wtk.Keyboard;
> import org.apache.pivot.wtk.Window;
> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>
>
> /**
> @@ -54,8 +55,9 @@
>     }
>
>     @Override
> -    public void install(Component component) {
> -        super.install(component);
> +    public void install(Container component,
> +            ContainerChildAccess containerChildAccess) {
> +        super.install(component, containerChildAccess);
>
>         Dialog dialog = (Dialog)component;
>         dialog.getDialogStateListeners().add(this);
> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraExpanderSkin.java
> ===================================================================
> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraExpanderSkin.java	 
> (revision 801535)
> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraExpanderSkin.java	 
> (working copy)
> @@ -29,6 +29,7 @@
> import org.apache.pivot.wtk.ButtonPressListener;
> import org.apache.pivot.wtk.Component;
> import org.apache.pivot.wtk.ComponentMouseButtonListener;
> +import org.apache.pivot.wtk.Container;
> import org.apache.pivot.wtk.Dimensions;
> import org.apache.pivot.wtk.Expander;
> import org.apache.pivot.wtk.BoxPane;
> @@ -41,6 +42,7 @@
> import org.apache.pivot.wtk.Orientation;
> import org.apache.pivot.wtk.TablePane;
> import org.apache.pivot.wtk.Theme;
> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
> import org.apache.pivot.wtk.content.ButtonDataRenderer;
> import org.apache.pivot.wtk.effects.Transition;
> import org.apache.pivot.wtk.effects.TransitionListener;
> @@ -253,11 +255,12 @@
>     }
>
>     @Override
> -    public void install(Component component) {
> -        super.install(component);
> +    public void install(Container container,
> +            ContainerChildAccess containerChildAccess) {
> +        super.install(container, containerChildAccess);
>
> -        Expander expander = (Expander)component;
> -        expander.add(titleBarTablePane);
> +        Expander expander = (Expander)container;
> +        containerChildAccess.add(titleBarTablePane);
>
>         Image buttonData = expander.isExpanded() ? collapseImage :  
> expandImage;
>         shadeButton = new ShadeButton(buttonData);
> @@ -270,8 +273,7 @@
>     }
>
>     public void uninstall() {
> -        Expander expander = (Expander)getComponent();
> -        expander.remove(titleBarTablePane);
> +        containerChildAccess.remove(titleBarTablePane);
>
>         shadeButton.getButtonPressListeners().remove(this);
>         buttonBoxPane.remove(shadeButton);
> Index: wtk/src/org/apache/pivot/wtk/skin/terra/ 
> TerraFileBrowserSheetSkin.java
> ===================================================================
> --- wtk/src/org/apache/pivot/wtk/skin/terra/ 
> TerraFileBrowserSheetSkin.java	(revision 801535)
> +++ wtk/src/org/apache/pivot/wtk/skin/terra/ 
> TerraFileBrowserSheetSkin.java	(working copy)
> @@ -22,8 +22,10 @@
> import org.apache.pivot.io.Folder;
> import org.apache.pivot.util.Filter;
> import org.apache.pivot.wtk.Component;
> +import org.apache.pivot.wtk.Container;
> import org.apache.pivot.wtk.FileBrowserSheet;
> import org.apache.pivot.wtk.FileBrowserSheetListener;
> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
>
> /**
>  * Terra file browser sheet skin.
> @@ -32,8 +34,9 @@
>  */
> public class TerraFileBrowserSheetSkin extends TerraSheetSkin  
> implements FileBrowserSheetListener {
>     @Override
> -    public void install(Component component) {
> -        super.install(component);
> +    public void install(Container component,
> +            ContainerChildAccess containerChildAccess) {
> +        super.install(component, containerChildAccess);
>
>         FileBrowserSheet fileBrowserSheet =  
> (FileBrowserSheet)component;
>         fileBrowserSheet.getFileBrowserSheetListeners().add(this);
> Index: wtk/src/org/apache/pivot/wtk/skin/terra/ 
> TerraFileBrowserSkin.java
> ===================================================================
> --- wtk/src/org/apache/pivot/wtk/skin/terra/ 
> TerraFileBrowserSkin.java	(revision 801535)
> +++ wtk/src/org/apache/pivot/wtk/skin/terra/ 
> TerraFileBrowserSkin.java	(working copy)
> @@ -21,8 +21,9 @@
> import org.apache.pivot.collections.Sequence;
> import org.apache.pivot.io.Folder;
> import org.apache.pivot.util.Filter;
> -import org.apache.pivot.wtk.Component;
> +import org.apache.pivot.wtk.Container;
> import org.apache.pivot.wtk.FileBrowser;
> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
> import org.apache.pivot.wtk.skin.FileBrowserSkin;
>
> /**
> @@ -32,8 +33,9 @@
>  */
> public class TerraFileBrowserSkin extends FileBrowserSkin {
>     @Override
> -    public void install(Component component) {
> -        super.install(component);
> +    public void install(Container container,
> +            ContainerChildAccess containerChildAccess) {
> +        super.install(container, containerChildAccess);
>
>         // TODO Add components
>     }
> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraFormSkin.java
> ===================================================================
> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraFormSkin.java	 
> (revision 801535)
> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraFormSkin.java	 
> (working copy)
> @@ -19,6 +19,7 @@
> import org.apache.pivot.collections.ArrayList;
> import org.apache.pivot.collections.Sequence;
> import org.apache.pivot.wtk.Component;
> +import org.apache.pivot.wtk.Container;
> import org.apache.pivot.wtk.Dimensions;
> import org.apache.pivot.wtk.Form;
> import org.apache.pivot.wtk.FormAttributeListener;
> @@ -28,6 +29,7 @@
> import org.apache.pivot.wtk.MessageType;
> import org.apache.pivot.wtk.Separator;
> import org.apache.pivot.wtk.Theme;
> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
> import org.apache.pivot.wtk.media.Image;
> import org.apache.pivot.wtk.skin.ContainerSkin;
>
> @@ -52,10 +54,10 @@
>     private static final int FLAG_IMAGE_SIZE = 16;
>
>     @Override
> -    public void install(Component component) {
> -        super.install(component);
> +    public void install(Container container,
> +            ContainerChildAccess containerChildAccess) {
>
> -        Form form = (Form)component;
> +        Form form = (Form)container;
>         form.getFormListeners().add(this);
>         form.getFormAttributeListeners().add(this);
>
> @@ -411,7 +413,7 @@
>         // Insert separator
>         Separator separator = new Separator(section.getHeading());
>         separators.insert(separator, index);
> -        form.add(separator);
> +        containerChildAccess.add(separator);
>
>         // Insert field label and flag image view lists
>         ArrayList<Label> sectionLabels = new ArrayList<Label>();
> @@ -445,7 +447,7 @@
>             // Remove separators
>             Sequence<Separator> removedSeparators =  
> separators.remove(index, n);
>             for (int j = 0; j < n; j++) {
> -                form.remove(removedSeparators.get(j));
> +                 
> containerChildAccess.remove(removedSeparators.get(j));
>             }
>         }
>
> @@ -459,13 +461,13 @@
>         // Create the label
>         Label label = new Label();
>         labels.get(sectionIndex).insert(label, index);
> -        form.add(label);
> +        containerChildAccess.add(label);
>         updateFieldLabel(section, index);
>
>         // Create the flag image view
>         ImageView flagImageView = new ImageView();
>         flagImageViews.get(sectionIndex).insert(flagImageView, index);
> -        form.add(flagImageView);
> +        containerChildAccess.add(flagImageView);
>         updateFieldFlag(section, index);
>
>         invalidateComponent();
> @@ -478,13 +480,13 @@
>         // Remove the labels
>         Sequence<Label> removedLabels =  
> labels.get(sectionIndex).remove(index, count);
>         for (int i = 0; i < count; i++) {
> -            form.remove(removedLabels.get(i));
> +            containerChildAccess.remove(removedLabels.get(i));
>         }
>
>         // Remove the flag image views
>         Sequence<ImageView> removedFlagImageViews =  
> flagImageViews.get(sectionIndex).remove(index, count);
>         for (int i = 0; i < count; i++) {
> -            form.remove(removedFlagImageViews.get(i));
> +             
> containerChildAccess.remove(removedFlagImageViews.get(i));
>         }
>
>         invalidateComponent();
> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraFrameSkin.java
> ===================================================================
> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraFrameSkin.java	 
> (revision 801535)
> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraFrameSkin.java	 
> (working copy)
> @@ -28,6 +28,7 @@
> import org.apache.pivot.wtk.Button;
> import org.apache.pivot.wtk.ButtonPressListener;
> import org.apache.pivot.wtk.Component;
> +import org.apache.pivot.wtk.Container;
> import org.apache.pivot.wtk.Cursor;
> import org.apache.pivot.wtk.Dimensions;
> import org.apache.pivot.wtk.Display;
> @@ -45,6 +46,7 @@
> import org.apache.pivot.wtk.Theme;
> import org.apache.pivot.wtk.VerticalAlignment;
> import org.apache.pivot.wtk.Window;
> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
> import org.apache.pivot.wtk.effects.DropShadowDecorator;
> import org.apache.pivot.wtk.media.Image;
> import org.apache.pivot.wtk.skin.WindowSkin;
> @@ -296,8 +298,9 @@
>     }
>
>     @Override
> -    public void install(Component component) {
> -        super.install(component);
> +    public void install(Container component,
> +            ContainerChildAccess containerChildAccess) {
> +        super.install(component, containerChildAccess);
>
>         Window window = (Window)component;
>
> @@ -305,7 +308,7 @@
>         dropShadowDecorator = new DropShadowDecorator();
>         window.getDecorators().add(dropShadowDecorator);
>
> -        window.add(titleBarTablePane);
> +        containerChildAccess.add(titleBarTablePane);
>
>         // Create the frame buttons
>         minimizeButton = new FrameButton(minimizeImage);
> @@ -334,7 +337,7 @@
>          
> maximizeButton.getButtonPressListeners().add(buttonPressListener);
>          
> closeButton.getButtonPressListeners().add(buttonPressListener);
>
> -        window.add(resizeHandle);
> +        containerChildAccess.add(resizeHandle);
>
>         iconChanged(window, null);
>         titleChanged(window, null);
> @@ -351,7 +354,7 @@
>         window.getDecorators().remove(dropShadowDecorator);
>         dropShadowDecorator = null;
>
> -        window.remove(titleBarTablePane);
> +        containerChildAccess.remove(titleBarTablePane);
>
>         buttonBoxPane.remove(minimizeButton);
>         buttonBoxPane.remove(maximizeButton);
> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraMenuBarSkin.java
> ===================================================================
> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraMenuBarSkin.java	 
> (revision 801535)
> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraMenuBarSkin.java	 
> (working copy)
> @@ -20,12 +20,13 @@
> import java.awt.Font;
>
> import org.apache.pivot.collections.Sequence;
> -import org.apache.pivot.wtk.Component;
> +import org.apache.pivot.wtk.Container;
> import org.apache.pivot.wtk.Dimensions;
> import org.apache.pivot.wtk.GraphicsUtilities;
> import org.apache.pivot.wtk.MenuBar;
> import org.apache.pivot.wtk.MenuBarListener;
> import org.apache.pivot.wtk.Theme;
> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
> import org.apache.pivot.wtk.skin.ContainerSkin;
>
>
> @@ -54,10 +55,12 @@
>         spacing = 2;
>     }
>
> -    public void install(Component component) {
> -        super.install(component);
> +    @Override
> +    public void install(Container container,
> +            ContainerChildAccess containerChildAccess) {
> +        super.install(container, containerChildAccess);
>
> -        MenuBar menuBar = (MenuBar)component;
> +        MenuBar menuBar = (MenuBar)container;
>         menuBar.getMenuBarListeners().add(this);
>
>         menuBar.setFocusTraversalPolicy(new  
> IndexFocusTraversalPolicy(true));
> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraMenuPopupSkin.java
> ===================================================================
> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraMenuPopupSkin.java	 
> (revision 801535)
> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraMenuPopupSkin.java	 
> (working copy)
> @@ -34,6 +34,7 @@
> import org.apache.pivot.wtk.Panorama;
> import org.apache.pivot.wtk.Theme;
> import org.apache.pivot.wtk.Window;
> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
> import org.apache.pivot.wtk.effects.DropShadowDecorator;
> import org.apache.pivot.wtk.effects.Transition;
> import org.apache.pivot.wtk.effects.TransitionListener;
> @@ -124,8 +125,9 @@
>     }
>
>     @Override
> -    public void install(Component component) {
> -        super.install(component);
> +    public void install(Container component,
> +            ContainerChildAccess containerChildAccess) {
> +        super.install(component, containerChildAccess);
>
>         MenuPopup menuPopup = (MenuPopup)component;
>         menuPopup.getMenuPopupListeners().add(this);
> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraMenuSkin.java
> ===================================================================
> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraMenuSkin.java	 
> (revision 801535)
> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraMenuSkin.java	 
> (working copy)
> @@ -22,11 +22,13 @@
>
> import org.apache.pivot.collections.Sequence;
> import org.apache.pivot.wtk.Component;
> +import org.apache.pivot.wtk.Container;
> import org.apache.pivot.wtk.Dimensions;
> import org.apache.pivot.wtk.GraphicsUtilities;
> import org.apache.pivot.wtk.Menu;
> import org.apache.pivot.wtk.MenuListener;
> import org.apache.pivot.wtk.Theme;
> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
> import org.apache.pivot.wtk.skin.ContainerSkin;
>
>
> @@ -68,8 +70,10 @@
>         showKeyboardShortcuts = true;
>     }
>
> -    public void install(Component component) {
> -        super.install(component);
> +    @Override
> +    public void install(Container component,
> +            ContainerChildAccess containerChildAccess) {
> +        super.install(component, containerChildAccess);
>
>         Menu menu = (Menu)component;
>         menu.getMenuListeners().add(this);
> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraPaletteSkin.java
> ===================================================================
> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraPaletteSkin.java	 
> (revision 801535)
> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraPaletteSkin.java	 
> (working copy)
> @@ -30,6 +30,7 @@
> import org.apache.pivot.wtk.ButtonPressListener;
> import org.apache.pivot.wtk.Component;
> import org.apache.pivot.wtk.ComponentMouseButtonListener;
> +import org.apache.pivot.wtk.Container;
> import org.apache.pivot.wtk.Dimensions;
> import org.apache.pivot.wtk.Display;
> import org.apache.pivot.wtk.BoxPane;
> @@ -47,6 +48,7 @@
> import org.apache.pivot.wtk.VerticalAlignment;
> import org.apache.pivot.wtk.Window;
> import org.apache.pivot.wtk.WindowListener;
> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
> import org.apache.pivot.wtk.effects.DropShadowDecorator;
> import org.apache.pivot.wtk.media.Image;
> import org.apache.pivot.wtk.skin.WindowSkin;
> @@ -172,11 +174,12 @@
>     }
>
>     @Override
> -    public void install(Component component) {
> -        super.install(component);
> +    public void install(Container component,
> +            ContainerChildAccess containerChildAccess) {
> +        super.install(component, containerChildAccess);
>
>         Palette palette = (Palette)component;
> -        palette.add(titleBarTablePane);
> +        containerChildAccess.add(titleBarTablePane);
>
>         // Attach the drop-shadow decorator
>         dropShadowDecorator = new DropShadowDecorator(3, 3, 3);
> @@ -189,7 +192,7 @@
>     @Override
>     public void uninstall() {
>         Palette palette = (Palette)getComponent();
> -        palette.remove(titleBarTablePane);
> +        containerChildAccess.remove(titleBarTablePane);
>
>         // Detach the drop shadow decorator
>         palette.getDecorators().remove(dropShadowDecorator);
> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraPanoramaSkin.java
> ===================================================================
> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraPanoramaSkin.java	 
> (revision 801535)
> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraPanoramaSkin.java	 
> (working copy)
> @@ -26,6 +26,7 @@
> import org.apache.pivot.wtk.Button;
> import org.apache.pivot.wtk.Component;
> import org.apache.pivot.wtk.ComponentMouseListener;
> +import org.apache.pivot.wtk.Container;
> import org.apache.pivot.wtk.Dimensions;
> import org.apache.pivot.wtk.GraphicsUtilities;
> import org.apache.pivot.wtk.Keyboard;
> @@ -34,6 +35,7 @@
> import org.apache.pivot.wtk.Theme;
> import org.apache.pivot.wtk.Viewport;
> import org.apache.pivot.wtk.ViewportListener;
> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
> import org.apache.pivot.wtk.content.ButtonDataRenderer;
> import org.apache.pivot.wtk.media.Image;
> import org.apache.pivot.wtk.skin.ButtonSkin;
> @@ -278,8 +280,9 @@
>     private static final int BUTTON_SIZE = 7;
>
>     @Override
> -    public void install(Component component) {
> -        super.install(component);
> +    public void install(Container component,
> +            ContainerChildAccess containerChildAccess) {
> +        super.install(component, containerChildAccess);
>
>         Panorama panorama = (Panorama)component;
>         panorama.getViewportListeners().add(this);
> @@ -287,16 +290,16 @@
>         // Add scroll arrow link buttons and attach mouse listeners
>         // to them; the mouse handlers should call setScrollTop() and
>         // setScrollLeft() on the panorama as appropriate
> -        panorama.add(northButton);
> +        containerChildAccess.add(northButton);
>          
> northButton.getComponentMouseListeners().add(buttonMouseListener);
>
> -        panorama.add(southButton);
> +        containerChildAccess.add(southButton);
>          
> southButton.getComponentMouseListeners().add(buttonMouseListener);
>
> -        panorama.add(eastButton);
> +        containerChildAccess.add(eastButton);
>          
> eastButton.getComponentMouseListeners().add(buttonMouseListener);
>
> -        panorama.add(westButton);
> +        containerChildAccess.add(westButton);
>          
> westButton.getComponentMouseListeners().add(buttonMouseListener);
>
>         updateScrollButtonVisibility();
> @@ -308,10 +311,10 @@
>         panorama.getViewportListeners().remove(this);
>
>         // Remove scroll arrow link buttons
> -        panorama.remove(northButton);
> -        panorama.remove(southButton);
> -        panorama.remove(eastButton);
> -        panorama.remove(westButton);
> +        containerChildAccess.remove(northButton);
> +        containerChildAccess.remove(southButton);
> +        containerChildAccess.remove(eastButton);
> +        containerChildAccess.remove(westButton);
>     }
>
>     @Override
> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraPromptSkin.java
> ===================================================================
> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraPromptSkin.java	 
> (revision 801535)
> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraPromptSkin.java	 
> (working copy)
> @@ -22,6 +22,7 @@
> import org.apache.pivot.wtk.ButtonPressListener;
> import org.apache.pivot.wtk.Component;
> import org.apache.pivot.wtk.BoxPane;
> +import org.apache.pivot.wtk.Container;
> import org.apache.pivot.wtk.ImageView;
> import org.apache.pivot.wtk.Label;
> import org.apache.pivot.wtk.Prompt;
> @@ -29,6 +30,7 @@
> import org.apache.pivot.wtk.PushButton;
> import org.apache.pivot.wtk.Theme;
> import org.apache.pivot.wtk.Window;
> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
> import org.apache.pivot.wtkx.WTKXSerializer;
>
>
> @@ -48,8 +50,9 @@
>     }
>
>     @Override
> -    public void install(Component component) {
> -        super.install(component);
> +    public void install(Container component,
> +            ContainerChildAccess containerChildAccess) {
> +        super.install(component, containerChildAccess);
>
>         Prompt prompt = (Prompt)component;
>         prompt.getPromptListeners().add(this);
> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraRollupSkin.java
> ===================================================================
> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraRollupSkin.java	 
> (revision 801535)
> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraRollupSkin.java	 
> (working copy)
> @@ -25,12 +25,14 @@
> import org.apache.pivot.util.Vote;
> import org.apache.pivot.wtk.Component;
> import org.apache.pivot.wtk.ComponentMouseButtonListener;
> +import org.apache.pivot.wtk.Container;
> import org.apache.pivot.wtk.Cursor;
> import org.apache.pivot.wtk.Dimensions;
> import org.apache.pivot.wtk.GraphicsUtilities;
> import org.apache.pivot.wtk.Mouse;
> import org.apache.pivot.wtk.Rollup;
> import org.apache.pivot.wtk.Theme;
> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
> import org.apache.pivot.wtk.effects.Transition;
> import org.apache.pivot.wtk.effects.TransitionListener;
> import org.apache.pivot.wtk.effects.easing.Easing;
> @@ -204,14 +206,15 @@
>     }
>
>     @Override
> -    public void install(Component component) {
> -        super.install(component);
> +    public void install(Container component,
> +            ContainerChildAccess containerChildAccess) {
> +        super.install(component, containerChildAccess);
>
>         Rollup rollup = (Rollup)component;
>
>         // Add the rollup button
>         rollupButton = new RollupButton();
> -        rollup.add(rollupButton);
> +        containerChildAccess.add(rollupButton);
>
>         // Initialize state
>         headingChanged(rollup, null);
> @@ -229,7 +232,7 @@
>         }
>
>         // Remove the rollup button
> -        rollup.remove(rollupButton);
> +        containerChildAccess.remove(rollupButton);
>         rollupButton = null;
>
>         super.uninstall();
> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraScrollBarSkin.java
> ===================================================================
> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraScrollBarSkin.java	 
> (revision 801535)
> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraScrollBarSkin.java	 
> (working copy)
> @@ -25,6 +25,7 @@
>
> import org.apache.pivot.wtk.ApplicationContext;
> import org.apache.pivot.wtk.Component;
> +import org.apache.pivot.wtk.Container;
> import org.apache.pivot.wtk.Dimensions;
> import org.apache.pivot.wtk.GraphicsUtilities;
> import org.apache.pivot.wtk.Mouse;
> @@ -33,6 +34,7 @@
> import org.apache.pivot.wtk.ScrollBarListener;
> import org.apache.pivot.wtk.ScrollBarValueListener;
> import org.apache.pivot.wtk.Theme;
> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
> import org.apache.pivot.wtk.media.Image;
> import org.apache.pivot.wtk.skin.ComponentSkin;
> import org.apache.pivot.wtk.skin.ContainerSkin;
> @@ -602,16 +604,17 @@
>     }
>
>     @Override
> -    public void install(Component component) {
> -        super.install(component);
> +    public void install(Container component,
> +            ContainerChildAccess containerChildAccess) {
> +        super.install(component, containerChildAccess);
>
>         ScrollBar scrollBar = (ScrollBar)component;
>         scrollBar.getScrollBarListeners().add(this);
>         scrollBar.getScrollBarValueListeners().add(this);
>
> -        scrollBar.add(scrollUpButton);
> -        scrollBar.add(scrollDownButton);
> -        scrollBar.add(handle);
> +        containerChildAccess.add(scrollUpButton);
> +        containerChildAccess.add(scrollDownButton);
> +        containerChildAccess.add(handle);
>
>         setBackgroundColor(9);
>
> @@ -624,9 +627,9 @@
>         scrollBar.getScrollBarListeners().remove(this);
>         scrollBar.getScrollBarValueListeners().remove(this);
>
> -        scrollBar.remove(scrollUpButton);
> -        scrollBar.remove(scrollDownButton);
> -        scrollBar.remove(handle);
> +        containerChildAccess.remove(scrollUpButton);
> +        containerChildAccess.remove(scrollDownButton);
> +        containerChildAccess.remove(handle);
>
>         super.uninstall();
>     }
> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraSheetSkin.java
> ===================================================================
> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraSheetSkin.java	 
> (revision 801535)
> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraSheetSkin.java	 
> (working copy)
> @@ -23,6 +23,7 @@
> import org.apache.pivot.util.Vote;
> import org.apache.pivot.wtk.Component;
> import org.apache.pivot.wtk.ComponentListener;
> +import org.apache.pivot.wtk.Container;
> import org.apache.pivot.wtk.Dimensions;
> import org.apache.pivot.wtk.GraphicsUtilities;
> import org.apache.pivot.wtk.Insets;
> @@ -33,6 +34,7 @@
> import org.apache.pivot.wtk.SheetStateListener;
> import org.apache.pivot.wtk.Theme;
> import org.apache.pivot.wtk.Window;
> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
> import org.apache.pivot.wtk.effects.DropShadowDecorator;
> import org.apache.pivot.wtk.effects.Transition;
> import org.apache.pivot.wtk.effects.TransitionListener;
> @@ -104,8 +106,9 @@
>     }
>
>     @Override
> -    public void install(Component component) {
> -        super.install(component);
> +    public void install(Container component,
> +            ContainerChildAccess containerChildAccess) {
> +        super.install(component, containerChildAccess);
>
>         Sheet sheet = (Sheet)component;
>         sheet.getSheetStateListeners().add(this);
> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraSliderSkin.java
> ===================================================================
> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraSliderSkin.java	 
> (revision 801535)
> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraSliderSkin.java	 
> (working copy)
> @@ -22,6 +22,7 @@
> import java.awt.RenderingHints;
>
> import org.apache.pivot.wtk.Component;
> +import org.apache.pivot.wtk.Container;
> import org.apache.pivot.wtk.Dimensions;
> import org.apache.pivot.wtk.GraphicsUtilities;
> import org.apache.pivot.wtk.Mouse;
> @@ -29,6 +30,7 @@
> import org.apache.pivot.wtk.Point;
> import org.apache.pivot.wtk.Slider;
> import org.apache.pivot.wtk.Theme;
> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
> import org.apache.pivot.wtk.skin.ComponentSkin;
> import org.apache.pivot.wtk.skin.SliderSkin;
>
> @@ -211,16 +213,17 @@
>     }
>
>     @Override
> -    public void install(Component component) {
> -        super.install(component);
> +    public void install(Container component,
> +            ContainerChildAccess containerChildAccess) {
> +        super.install(component, containerChildAccess);
>
>         Slider slider = (Slider)component;
> -        slider.add(thumb);
> +        containerChildAccess.add(thumb);
>     }
>
>     public void uninstall() {
>         Slider slider = (Slider)getComponent();
> -        slider.remove(thumb);
> +        containerChildAccess.remove(thumb);
>
>         super.uninstall();
>     }
> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraSpinnerSkin.java
> ===================================================================
> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraSpinnerSkin.java	 
> (revision 801535)
> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraSpinnerSkin.java	 
> (working copy)
> @@ -28,6 +28,7 @@
> import org.apache.pivot.wtk.ApplicationContext;
> import org.apache.pivot.wtk.Bounds;
> import org.apache.pivot.wtk.Component;
> +import org.apache.pivot.wtk.Container;
> import org.apache.pivot.wtk.Dimensions;
> import org.apache.pivot.wtk.GraphicsUtilities;
> import org.apache.pivot.wtk.Keyboard;
> @@ -37,6 +38,7 @@
> import org.apache.pivot.wtk.SpinnerListener;
> import org.apache.pivot.wtk.SpinnerSelectionListener;
> import org.apache.pivot.wtk.Theme;
> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
> import org.apache.pivot.wtk.media.Image;
> import org.apache.pivot.wtk.skin.ComponentSkin;
> import org.apache.pivot.wtk.skin.ContainerSkin;
> @@ -512,16 +514,17 @@
>     }
>
>     @Override
> -    public void install(Component component) {
> -        super.install(component);
> +    public void install(Container component,
> +            ContainerChildAccess containerChildAccess) {
> +        super.install(component, containerChildAccess);
>
>         Spinner spinner = (Spinner)component;
>         spinner.getSpinnerListeners().add(this);
>         spinner.getSpinnerSelectionListeners().add(this);
>
> -        spinner.add(spinnerContent);
> -        spinner.add(upButton);
> -        spinner.add(downButton);
> +        containerChildAccess.add(spinnerContent);
> +        containerChildAccess.add(upButton);
> +        containerChildAccess.add(downButton);
>     }
>
>     @Override
> @@ -530,9 +533,9 @@
>         spinner.getSpinnerListeners().remove(this);
>         spinner.getSpinnerSelectionListeners().remove(this);
>
> -        spinner.remove(spinnerContent);
> -        spinner.remove(upButton);
> -        spinner.remove(downButton);
> +        containerChildAccess.remove(spinnerContent);
> +        containerChildAccess.remove(upButton);
> +        containerChildAccess.remove(downButton);
>
>         super.uninstall();
>     }
> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraSplitPaneSkin.java
> ===================================================================
> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraSplitPaneSkin.java	 
> (revision 801535)
> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraSplitPaneSkin.java	 
> (working copy)
> @@ -21,6 +21,7 @@
> import java.awt.Graphics2D;
>
> import org.apache.pivot.wtk.Component;
> +import org.apache.pivot.wtk.Container;
> import org.apache.pivot.wtk.Cursor;
> import org.apache.pivot.wtk.Dimensions;
> import org.apache.pivot.wtk.GraphicsUtilities;
> @@ -30,6 +31,7 @@
> import org.apache.pivot.wtk.SplitPane;
> import org.apache.pivot.wtk.SplitPaneListener;
> import org.apache.pivot.wtk.Theme;
> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
> import org.apache.pivot.wtk.skin.ComponentSkin;
> import org.apache.pivot.wtk.skin.ContainerSkin;
>
> @@ -186,7 +188,7 @@
>                 if (useShadow) {
>                     // Add the shadow to the split pane and lay it out
>                     shadow = new SplitterShadow();
> -                    splitPane.add(shadow);
> +                    containerChildAccess.add(shadow);
>
>                     if (orientation == Orientation.HORIZONTAL) {
>                         shadow.setLocation(component.getX(), 0);
> @@ -224,7 +226,7 @@
>
>                     splitPane.setSplitLocation(splitLocation);
>
> -                    splitPane.remove(shadow);
> +                    containerChildAccess.remove(shadow);
>                     shadow = null;
>                 }
>
> @@ -318,13 +320,14 @@
>     }
>
>     @Override
> -    public void install(Component component) {
> -        super.install(component);
> +    public void install(Container component,
> +            ContainerChildAccess containerChildAccess) {
> +        super.install(component, containerChildAccess);
>
>         SplitPane splitPane = (SplitPane)component;
>         splitPane.getSplitPaneListeners().add(this);
>
> -        splitPane.add(splitter);
> +        containerChildAccess.add(splitter);
>         updateSplitterCursor();
>     }
>
> @@ -333,7 +336,7 @@
>         SplitPane splitPane = (SplitPane)getComponent();
>         splitPane.getSplitPaneListeners().remove(this);
>
> -        splitPane.remove(splitter);
> +        containerChildAccess.remove(splitter);
>
>         super.uninstall();
>     }
> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraTabPaneSkin.java
> ===================================================================
> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraTabPaneSkin.java	 
> (revision 801535)
> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraTabPaneSkin.java	 
> (working copy)
> @@ -28,6 +28,7 @@
> import org.apache.pivot.wtk.Button;
> import org.apache.pivot.wtk.Component;
> import org.apache.pivot.wtk.ComponentStateListener;
> +import org.apache.pivot.wtk.Container;
> import org.apache.pivot.wtk.Dimensions;
> import org.apache.pivot.wtk.BoxPane;
> import org.apache.pivot.wtk.GraphicsUtilities;
> @@ -43,6 +44,7 @@
> import org.apache.pivot.wtk.Theme;
> import org.apache.pivot.wtk.VerticalAlignment;
> import org.apache.pivot.wtk.Button.Group;
> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
> import org.apache.pivot.wtk.content.ButtonData;
> import org.apache.pivot.wtk.content.ButtonDataRenderer;
> import org.apache.pivot.wtk.effects.Transition;
> @@ -409,8 +411,10 @@
>         setButtonSpacing(2);
>     }
>
> -    public void install(Component component) {
> -        super.install(component);
> +    @Override
> +    public void install(Container component,
> +            ContainerChildAccess containerChildAccess) {
> +        super.install(component, containerChildAccess);
>
>         TabPane tabPane = (TabPane)component;
>
> @@ -420,7 +424,7 @@
>         tabPane.getTabPaneAttributeListeners().add(this);
>
>         // Add the tab buttons
> -        tabPane.add(buttonPanorama);
> +        containerChildAccess.add(buttonPanorama);
>
>         Sequence<Component> tabs = tabPane.getTabs();
>         int selectedIndex = tabPane.getSelectedIndex();
> @@ -455,7 +459,7 @@
>         }
>
>         // Remove the tab buttons
> -        tabPane.remove(buttonPanorama);
> +        containerChildAccess.remove(buttonPanorama);
>
>         super.uninstall();
>     }
> Index: wtk/src/org/apache/pivot/wtk/skin/terra/TerraTooltipSkin.java
> ===================================================================
> --- wtk/src/org/apache/pivot/wtk/skin/terra/TerraTooltipSkin.java	 
> (revision 801535)
> +++ wtk/src/org/apache/pivot/wtk/skin/terra/TerraTooltipSkin.java	 
> (working copy)
> @@ -33,6 +33,7 @@
> import org.apache.pivot.wtk.Tooltip;
> import org.apache.pivot.wtk.TooltipListener;
> import org.apache.pivot.wtk.Window;
> +import org.apache.pivot.wtk.Container.ContainerChildAccess;
> import org.apache.pivot.wtk.effects.DropShadowDecorator;
> import org.apache.pivot.wtk.effects.Transition;
> import org.apache.pivot.wtk.effects.TransitionListener;
> @@ -113,8 +114,9 @@
>     }
>
>     @Override
> -    public void install(Component component) {
> -        super.install(component);
> +    public void install(Container component,
> +            ContainerChildAccess containerChildAccess) {
> +        super.install(component, containerChildAccess);
>
>         Tooltip tooltip = (Tooltip)component;
>
> Index: wtk/test/org/apache/pivot/wtk/test/CardPaneTest.java
> ===================================================================
> --- wtk/test/org/apache/pivot/wtk/test/CardPaneTest.java	(revision  
> 801535)
> +++ wtk/test/org/apache/pivot/wtk/test/CardPaneTest.java	(working  
> copy)
> @@ -51,7 +51,7 @@
>         sizeGroup.getGroupListeners().add(new Button.GroupListener() {
>             public void selectionChanged(Button.Group buttonGroup,  
> Button previousSelection) {
>                 final Button selection = buttonGroup.getSelection();
> -                int selectedIndex = selection == null ? -1 :  
> selection.getParent().indexOf(selection);
> +                int selectedIndex = selection == null ? -1 :  
> ((CardPane)selection.getParent()).indexOf(selection);
>
>                 cardPane.getCardPaneListeners().add(new  
> CardPaneListener.Adapter() {
>                     public Vote previewSelectedIndexChange(CardPane  
> cardPane, int selectedIndex) {