What is object.paint(target) equivalent on Vaadin 7 beta 10?

I am converting some of the add-ons to Vaadin 7 beta 10 APIs.

And I come across following code


@Override
    public void paintContent(PaintTarget target) throws PaintException {
        super.paintContent(target);

        target.addAttribute(VLazyLoadWrapper.WIDGET_LOAD_PROXIMITY, proximity);
        target.addAttribute(VLazyLoadWrapper.WIDGET_LOAD_VISIBLE_DELAY,
                placeholderVisibleDelay);
        target.addAttribute(VLazyLoadWrapper.PLACEHOLDER_HEIGHT,
                placeholderHeight);
        target.addAttribute(VLazyLoadWrapper.PLACEHOLDER_WIDTH,
                placeholderWidth);
        target.addAttribute(VLazyLoadWrapper.WRAPPER_MODE, mode);
        target.addAttribute(VLazyLoadWrapper.STATIC_CONTAINER, staticContainer);
        target.addAttribute(VLazyLoadWrapper.WIDGET_VISIBLE_ID,
                clientSideIsVisible);
        target.addAttribute(VLazyLoadWrapper.WRAPPER_AUTOREINIT_ON_REATTACH,
                autoReinitLazyLoad);

        if ((clientSideIsVisible || mode == MODE_LAZY_LOAD_DRAW) && lazyloadComponent != null) {
            lazyloadComponent.paint(target);
        }
    }

For such codes, I understand I need to use AbstractComponentContainer and convert the code inside paintContent to Shared state. But if you see at the end of this code, it is calling lazyloadComponent.paint(target);. So what will be the equivalent of this code for new architecture?

In Vaadin 6 its the responsibility of the component container to paint its children using child.paint(). In Vaadin 7 the framework takes care of sending the data of the children automatically. Typically this is handled automatically as you want the same children to be visible on the server and the client side. For the case of lazy loading children you have the option of making the server side iterator() not returning the child when it is not visible on the client side, then it won’t be in the server or in the client component hierarchy. Another, maybe better, option is to implement SelectiveRenderer on the server side and the method isRendered(Component childComponent) which dictates if a given child component in the server side hierarchy should be communicated to the client or not,