<s> """<STR_LIT>""" <EOL> import pyjd <EOL> from pyjamas . ui . VerticalPanel import VerticalPanel <EOL> from pyjamas . ui . HTML import HTML <EOL> from pyjamas . ui . ClickListener import ClickHandler <EOL> from pyjamas . ui . RootPanel import RootPanel <EOL> from pyjamas . ui import Event <EOL> from pyjamas import DOM <EOL> from pyjamas import logging <EOL> log = logging . getAppendLogger ( __name__ , logging . DEBUG , logging . PLAIN_FORMAT ) <EOL> class Board ( VerticalPanel , ClickHandler ) : <EOL> def __init__ ( self ) : <EOL> """<STR_LIT>""" <EOL> global Text <EOL> VerticalPanel . __init__ ( self ) <EOL> ClickHandler . __init__ ( self ) <EOL> self . addClickListener ( self ) <EOL> self . title = Text ( '<STR_LIT>' ) <EOL> self . title . setzIndex ( <NUM_LIT:100> ) <EOL> self . add ( self . title ) <EOL> self . setSize ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> self . setBorderWidth ( <NUM_LIT:1> ) <EOL> def onClick ( self , sender ) : <EOL> log . debug ( '<STR_LIT>' + str ( sender ) ) <EOL> def _event_targets_title ( self , event ) : <EOL> target = DOM . eventGetTarget ( event ) <EOL> return target and DOM . isOrHasChild ( self . title . getElement ( ) , target ) <EOL> def onBrowserEvent ( self , event ) : <EOL> etype = DOM . eventGetType ( event ) <EOL> if etype == "<STR_LIT>" : <EOL> if self . _event_targets_title ( event ) : <EOL> return <EOL> ClickHandler . onBrowserEvent ( self , event ) <EOL> class Text ( HTML , ClickHandler ) : <EOL> def __init__ ( self , text ) : <EOL> HTML . __init__ ( self , text ) <EOL> ClickHandler . __init__ ( self , preventDefault = True ) <EOL> self . addClickListener ( self ) <EOL> def onClick ( self , sender ) : <EOL> log . debug ( '<STR_LIT>' + str ( sender ) ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> pyjd . setup ( "<STR_LIT>" ) <EOL> board = Board ( ) <EOL> RootPanel ( ) . add ( board ) <EOL> pyjd . run ( ) </s>
