protected static void renderTagOpen ( final WImage imageComponent , final XmlStringBuilder xml ) { // Check for alternative text on the image String alternativeText = imageComponent . getAlternativeText ( ) ; if ( alternativeText == null ) { alternativeText = "" ; } else { alternativeText = I18nUtilities . format ( null , alternativeText ) ; } xml . appendTagOpen ( "img" ) ; xml . appendAttribute ( "id" , imageComponent . getId ( ) ) ; xml . appendOptionalAttribute ( "class" , imageComponent . getHtmlClass ( ) ) ; xml . appendOptionalAttribute ( "track" , imageComponent . isTracking ( ) , "true" ) ; xml . appendUrlAttribute ( "src" , imageComponent . getTargetUrl ( ) ) ; xml . appendAttribute ( "alt" , alternativeText ) ; xml . appendOptionalAttribute ( "hidden" , imageComponent . isHidden ( ) , "hidden" ) ; // Check for size information on the image Dimension size = imageComponent . getSize ( ) ; if ( size != null ) { if ( size . getHeight ( ) >= 0 ) { xml . appendAttribute ( "height" , size . height ) ; } if ( size . getWidth ( ) >= 0 ) { xml . appendAttribute ( "width" , size . width ) ; } } }
Builds the open tag part of the XML that is the tagname and attributes .