public void insert(Widget w, int beforeIndex) {

        // in case an option bar as a direct child is present it may disturb the insert order
        // it needs to be detached first
        Element optionBar = null;
        NodeList<Node> children = getElement().getChildNodes();
        for (int i = 0; i < children.getLength(); i++) {
            Node child = children.getItem(i);
            if ((child.getNodeType() == Node.ELEMENT_NODE)
                && ((Element)child).hasClassName(I_CmsLayoutBundle.INSTANCE.containerpageCss().optionBar())) {
                optionBar = (Element)child;
                optionBar.removeFromParent();
                break;
            }

        }

        insert(w, (Element)getElement(), beforeIndex, true);
        if (optionBar != null) {
            getElement().insertFirst(optionBar);
        }
    }
public void insert ( Widget w , int beforeIndex ) { Element optionBar = null ; NodeList < Node > children = getElement ( ) . getChildNodes ( ) ; for ( int i = 0 ; i < children . getLength ( ) ; i ++ ) { Node child = children . getItem ( i ) ; if ( ( child . getNodeType ( ) == Node . ELEMENT_NODE ) && ( ( Element ) child ) . hasClassName ( I_CmsLayoutBundle . INSTANCE . containerpageCss ( ) . optionBar ( ) ) ) { optionBar = ( Element ) child ; optionBar . removeFromParent ( ) ; break ; } } insert ( w , ( Element ) getElement ( ) , beforeIndex , true ) ; if ( optionBar != null ) { getElement ( ) . insertFirst ( optionBar ) ; } }
@see org.opencms.ade.containerpage.client.ui.I_CmsDropContainer#insert(com.google.gwt.user.client.ui.Widget, int)