jdk/src/share/classes/javax/swing/AncestorNotifier.java
author alexp
Fri, 06 Nov 2009 22:40:58 +0300
changeset 4278 b7a976422d27
parent 1639 a97859015238
child 5506 202f599c92aa
permissions -rw-r--r--
6878399: public SwingUtilities.getParentViewport() is required Reviewed-by: peterz
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
1639
a97859015238 6785258: Update copyright year
xdono
parents: 1301
diff changeset
     2
 * Copyright 1997-2008 Sun Microsystems, Inc.  All Rights Reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Sun designates this
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * by Sun in the LICENSE file that accompanied this code.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 * CA 95054 USA or visit www.sun.com if you need additional information or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
 * have any questions.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package javax.swing;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import javax.swing.event.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import java.awt.event.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
import java.awt.Component;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
import java.awt.Container;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
import java.awt.Window;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
import java.beans.PropertyChangeListener;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
import java.beans.PropertyChangeEvent;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
import java.io.Serializable;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * @author Dave Moore
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
class AncestorNotifier implements ComponentListener, PropertyChangeListener, Serializable
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
{
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
    Component firstInvisibleAncestor;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
    EventListenerList listenerList = new EventListenerList();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
    JComponent root;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
    AncestorNotifier(JComponent root) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
        this.root = root;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
        addListeners(root, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
    void addAncestorListener(AncestorListener l) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
        listenerList.add(AncestorListener.class, l);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
    void removeAncestorListener(AncestorListener l) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
        listenerList.remove(AncestorListener.class, l);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
    AncestorListener[] getAncestorListeners() {
1301
15e81207e1f2 6727662: Code improvement and warnings removing from swing packages
rupashka
parents: 2
diff changeset
    65
        return listenerList.getListeners(AncestorListener.class);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
     * Notify all listeners that have registered interest for
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
     * notification on this event type.  The event instance
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
     * is lazily created using the parameters passed into
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
     * the fire method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
     * @see EventListenerList
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
    protected void fireAncestorAdded(JComponent source, int id, Container ancestor, Container ancestorParent) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
        // Guaranteed to return a non-null array
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
        Object[] listeners = listenerList.getListenerList();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
        // Process the listeners last to first, notifying
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
        // those that are interested in this event
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
        for (int i = listeners.length-2; i>=0; i-=2) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
            if (listeners[i]==AncestorListener.class) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
                // Lazily create the event:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
                AncestorEvent ancestorEvent =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
                    new AncestorEvent(source, id, ancestor, ancestorParent);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
                ((AncestorListener)listeners[i+1]).ancestorAdded(ancestorEvent);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
     * Notify all listeners that have registered interest for
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
     * notification on this event type.  The event instance
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
     * is lazily created using the parameters passed into
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
     * the fire method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
     * @see EventListenerList
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
    protected void fireAncestorRemoved(JComponent source, int id, Container ancestor, Container ancestorParent) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
        // Guaranteed to return a non-null array
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
        Object[] listeners = listenerList.getListenerList();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
        // Process the listeners last to first, notifying
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
        // those that are interested in this event
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
        for (int i = listeners.length-2; i>=0; i-=2) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
            if (listeners[i]==AncestorListener.class) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
                // Lazily create the event:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
                AncestorEvent ancestorEvent =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
                    new AncestorEvent(source, id, ancestor, ancestorParent);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
                ((AncestorListener)listeners[i+1]).ancestorRemoved(ancestorEvent);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
     * Notify all listeners that have registered interest for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
     * notification on this event type.  The event instance
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
     * is lazily created using the parameters passed into
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
     * the fire method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
     * @see EventListenerList
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
    protected void fireAncestorMoved(JComponent source, int id, Container ancestor, Container ancestorParent) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
        // Guaranteed to return a non-null array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
        Object[] listeners = listenerList.getListenerList();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
        // Process the listeners last to first, notifying
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
        // those that are interested in this event
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
        for (int i = listeners.length-2; i>=0; i-=2) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
            if (listeners[i]==AncestorListener.class) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
                // Lazily create the event:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
                AncestorEvent ancestorEvent =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
                    new AncestorEvent(source, id, ancestor, ancestorParent);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
                ((AncestorListener)listeners[i+1]).ancestorMoved(ancestorEvent);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
    void removeAllListeners() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
        removeListeners(root);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
    void addListeners(Component ancestor, boolean addToFirst) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
        Component a;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
        firstInvisibleAncestor = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
        for (a = ancestor;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
             firstInvisibleAncestor == null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
             a = a.getParent()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
            if (addToFirst || a != ancestor) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
                a.addComponentListener(this);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
                if (a instanceof JComponent) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
                    JComponent jAncestor = (JComponent)a;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
                    jAncestor.addPropertyChangeListener(this);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
            if (!a.isVisible() || a.getParent() == null || a instanceof Window) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
                firstInvisibleAncestor = a;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
        if (firstInvisibleAncestor instanceof Window &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
            firstInvisibleAncestor.isVisible()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
            firstInvisibleAncestor = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
    void removeListeners(Component ancestor) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
        Component a;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
        for (a = ancestor; a != null; a = a.getParent()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
            a.removeComponentListener(this);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
            if (a instanceof JComponent) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
                JComponent jAncestor = (JComponent)a;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
                jAncestor.removePropertyChangeListener(this);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
            if (a == firstInvisibleAncestor || a instanceof Window) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
                break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
    public void componentResized(ComponentEvent e) {}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
    public void componentMoved(ComponentEvent e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
        Component source = e.getComponent();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
        fireAncestorMoved(root, AncestorEvent.ANCESTOR_MOVED,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
                          (Container)source, source.getParent());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
    public void componentShown(ComponentEvent e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
        Component ancestor = e.getComponent();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
        if (ancestor == firstInvisibleAncestor) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
            addListeners(ancestor, false);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
            if (firstInvisibleAncestor == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
                fireAncestorAdded(root, AncestorEvent.ANCESTOR_ADDED,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
                                  (Container)ancestor, ancestor.getParent());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
    public void componentHidden(ComponentEvent e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
        Component ancestor = e.getComponent();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
        boolean needsNotify = firstInvisibleAncestor == null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
        if ( !(ancestor instanceof Window) ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
            removeListeners(ancestor.getParent());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
        firstInvisibleAncestor = ancestor;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
        if (needsNotify) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
            fireAncestorRemoved(root, AncestorEvent.ANCESTOR_REMOVED,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
                                (Container)ancestor, ancestor.getParent());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
    public void propertyChange(PropertyChangeEvent evt) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
        String s = evt.getPropertyName();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
        if (s!=null && (s.equals("parent") || s.equals("ancestor"))) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
            JComponent component = (JComponent)evt.getSource();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
            if (evt.getNewValue() != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
                if (component == firstInvisibleAncestor) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
                    addListeners(component, false);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
                    if (firstInvisibleAncestor == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
                        fireAncestorAdded(root, AncestorEvent.ANCESTOR_ADDED,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
                                          component, component.getParent());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
            } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
                boolean needsNotify = firstInvisibleAncestor == null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
                Container oldParent = (Container)evt.getOldValue();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
                removeListeners(oldParent);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
                firstInvisibleAncestor = component;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
                if (needsNotify) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
                    fireAncestorRemoved(root, AncestorEvent.ANCESTOR_REMOVED,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
                                        component, oldParent);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
}