<s> from pyjamas import DOM <EOL> from pyjamas import Factory <EOL> from pyjamas . ui . InnerText import InnerText <EOL> from pyjamas . ui . Widget import Widget <EOL> from pyjamas . ui . MouseListener import MouseHandler <EOL> from pyjamas . ui . ClickListener import ClickHandler <EOL> class Label ( Widget , MouseHandler , ClickHandler , InnerText ) : <EOL> _props = [ ( "<STR_LIT:label>" , "<STR_LIT>" , "<STR_LIT>" , None ) , <EOL> ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , None ) , <EOL> ( "<STR_LIT>" , "<STR_LIT>" , "<STR_LIT>" , None ) , <EOL> ] <EOL> def __init__ ( self , text = None , wordWrap = True , ** kwargs ) : <EOL> kwargs [ '<STR_LIT>' ] = kwargs . get ( '<STR_LIT>' , "<STR_LIT>" ) <EOL> kwargs [ '<STR_LIT>' ] = kwargs . get ( '<STR_LIT>' , wordWrap ) <EOL> kwargs [ '<STR_LIT>' ] = kwargs . get ( '<STR_LIT>' , "<STR_LIT>" ) <EOL> if text : <EOL> kwargs [ '<STR_LIT>' ] = text <EOL> self . setElement ( kwargs . pop ( '<STR_LIT>' , None ) or DOM . createDiv ( ) ) <EOL> self . horzAlign = "<STR_LIT>" <EOL> Widget . __init__ ( self , ** kwargs ) <EOL> MouseHandler . __init__ ( self ) <EOL> ClickHandler . __init__ ( self ) <EOL> @ classmethod <EOL> def _getProps ( self ) : <EOL> return Widget . _getProps ( ) + InnerText . _getProps ( ) + self . _props <EOL> def getHorizontalAlignment ( self ) : <EOL> return self . horzAlign <EOL> def getWordWrap ( self ) : <EOL> ws = DOM . getStyleAttribute ( self . getElement ( ) , "<STR_LIT>" ) <EOL> return ws != "<STR_LIT>" <EOL> def setHorizontalAlignment ( self , align ) : <EOL> self . horzAlign = align <EOL> DOM . setStyleAttribute ( self . getElement ( ) , "<STR_LIT>" , align ) <EOL> def setWordWrap ( self , wrap ) : <EOL> style = wrap and "<STR_LIT>" or "<STR_LIT>" <EOL> DOM . setStyleAttribute ( self . getElement ( ) , "<STR_LIT>" , style ) <EOL> Factory . registerClass ( '<STR_LIT>' , '<STR_LIT>' , Label ) </s>
