private void setupLabel ( ) { // To retain compatibility with the WText API, create a WText for this component, // which gets added to the label body. WText textBody = new WText ( ) { @ Override public boolean isEncodeText ( ) { return WHeading . this . isEncodeText ( ) ; } @ Override public String getText ( ) { return WHeading . this . getText ( ) ; } } ; if ( label . getBody ( ) == null ) { label . setBody ( textBody ) ; } else { WComponent oldBody = label . getBody ( ) ; WContainer newBody = new WContainer ( ) ; label . setBody ( newBody ) ; newBody . add ( textBody ) ; newBody . add ( oldBody ) ; } }
Setup the label .