@@ -772,22 +772,24 @@ public void setComponentZOrder(Component comp, int index) {
772772 */
773773 @ SuppressWarnings ("deprecation" )
774774 private void reparentTraverse (ContainerPeer parentPeer , Container child ) {
775- checkTreeLock ();
776-
777- for (int i = 0 ; i < child .getComponentCount (); i ++) {
778- Component comp = child .getComponent (i );
779- if (comp .isLightweight ()) {
780- // If components is lightweight check if it is container
781- // If it is container it might contain heavyweight children we need to reparent
782- if (comp instanceof Container ) {
783- reparentTraverse (parentPeer , (Container )comp );
784- }
785- } else {
786- // Q: Need to update NativeInLightFixer?
787- comp .getPeer ().reparent (parentPeer );
788- }
789- }
775+ // JSComponentUI.reparent is not implemented. It just gets tainted.
790776 }
777+ // checkTreeLock();
778+ //
779+ // for (int i = 0; i < child.getComponentCount(); i++) {
780+ // Component comp = child.getComponent(i);
781+ // if (comp.isLightweight()) {
782+ // // If components is lightweight check if it is container
783+ // // If it is container it might contain heavyweight children we need to reparent
784+ // if (comp instanceof Container) {
785+ // reparentTraverse(parentPeer, (Container)comp);
786+ // }
787+ // } else {
788+ // // Q: Need to update NativeInLightFixer?
789+ // comp.peer.reparent(parentPeer);
790+ // }
791+ // }
792+ // }
791793
792794 /**
793795 * Reparents child component peer to this container peer.
@@ -796,22 +798,24 @@ private void reparentTraverse(ContainerPeer parentPeer, Container child) {
796798 */
797799 @ SuppressWarnings ("deprecation" )
798800 private void reparentChild (Component comp ) {
801+ // SwingJS does not need to worry about reparenting peers.
802+ //
799803// checkTreeLock();
800- if (comp == null ) {
801- return ;
802- }
803- if (comp .isLightweight ()) {
804-
805- // never true in SwingJS
806-
807- // If component is lightweight container we need to reparent all its explicit heavyweight children
808- if (comp instanceof Container ) {
809- // Traverse component's tree till depth-first until encountering heavyweight component
810- reparentTraverse ((ContainerPeer )getPeer () , (Container )comp );
811- }
812- } else {
813- comp .getPeer () .reparent ((ContainerPeer )getPeer () );
814- }
804+ // if (comp == null) {
805+ // return;
806+ // }
807+ // if (comp.isLightweight()) {
808+ //
809+ // // never true in SwingJS
810+ //
811+ // // If component is lightweight container we need to reparent all its explicit heavyweight children
812+ // if (comp instanceof Container) {
813+ // // Traverse component's tree till depth-first until encountering heavyweight component
814+ // reparentTraverse((ContainerPeer)peer , (Container)comp); // BH was getPeer()
815+ // }
816+ // } else {
817+ // comp.peer .reparent((ContainerPeer)peer );
818+ // }
815819 }
816820
817821 /**
0 commit comments