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 ; }
Creates the box according to the HTML element .