public ElementBox createBox(ElementBox parent, Element e, Viewport viewport, NodeData style)
    {
        String name = e.getNodeName().toLowerCase();
        if (name.equals("object"))
            return createSubtreeObject(parent, e, viewport, style);
        else if (name.equals("img"))
            return createSubtreeImg(parent, e, viewport, style);
        else if (name.equals("a") && e.hasAttribute("name")
                && (e.getTextContent() == null || e.getTextContent().trim().length() == 0))
        {
            //make the named anchors sticky
            ElementBox eb = factory.createElementInstance(parent, e, style);
            eb.setSticky(true);
            return eb;
        }
        else
            return null;
    }
public ElementBox createBox ( ElementBox parent , Element e , Viewport viewport , NodeData style ) { String name = e . getNodeName ( ) . toLowerCase ( ) ; if ( name . equals ( "object" ) ) return createSubtreeObject ( parent , e , viewport , style ) ; else if ( name . equals ( "img" ) ) return createSubtreeImg ( parent , e , viewport , style ) ; else if ( name . equals ( "a" ) && e . hasAttribute ( "name" ) && ( e . getTextContent ( ) == null || e . getTextContent ( ) . trim ( ) . length ( ) == 0 ) ) { ElementBox eb = factory . createElementInstance ( parent , e , style ) ; eb . setSticky ( true ) ; return eb ; } else return null ; }
Creates the box according to the HTML element.
@param parent The box in the main box tree to be used as a parent box for the new box.
@param e The element to be processed.
@param viewport The viewport to be used for the new box.
@param style The style of the element.
@return The newly created box or <code>null</code> when the element is not supported
or cannot be created.