<s> from Sink import Sink , SinkInfo <EOL> from pyjamas . ui . MenuBar import MenuBar <EOL> from pyjamas . ui . MenuItem import MenuItem <EOL> from pyjamas import Window <EOL> from pyjamas . ui . HTML import HTML <EOL> from pyjamas . ui . VerticalPanel import VerticalPanel <EOL> from pyjamas import DOM <EOL> from pyjamas . ui . ContextMenuPopupPanel import ContextMenuPopupPanel <EOL> class Menus ( Sink ) : <EOL> def __init__ ( self ) : <EOL> Sink . __init__ ( self ) <EOL> self . menu = MenuBar ( ) <EOL> subMenu = MenuBar ( True ) <EOL> subMenu . addItem ( "<STR_LIT>" , True , self ) <EOL> subMenu . addItem ( "<STR_LIT>" , True , self ) <EOL> subMenu . addItem ( "<STR_LIT>" , True , self ) <EOL> menu0 = MenuBar ( True ) <EOL> menu0 . addItem ( "<STR_LIT>" , True , self ) <EOL> menu0 . addItem ( "<STR_LIT>" , True , self ) <EOL> menu0 . addItem ( "<STR_LIT>" , True , subMenu ) <EOL> menu1 = MenuBar ( True ) <EOL> menu1 . addItem ( "<STR_LIT>" , True , self ) <EOL> menu1 . addItem ( "<STR_LIT>" , True , self ) <EOL> menu1 . addItem ( "<STR_LIT>" , True , self ) <EOL> menu1 . addItem ( "<STR_LIT>" , True , self ) <EOL> menu2 = MenuBar ( True ) <EOL> menu2 . addItem ( "<STR_LIT>" , self ) <EOL> menu2 . addItem ( "<STR_LIT>" , self ) <EOL> menu2 . addItem ( "<STR_LIT>" , True , self ) <EOL> self . menu . addItem ( MenuItem ( "<STR_LIT>" , menu0 ) ) <EOL> self . menu . addItem ( MenuItem ( "<STR_LIT>" , menu1 ) ) <EOL> self . menu . addItem ( MenuItem ( "<STR_LIT>" , menu2 ) ) <EOL> self . menu . setWidth ( "<STR_LIT>" ) <EOL> self . panel = VerticalPanel ( ) <EOL> self . context = HTML ( """<STR_LIT>""" ) <EOL> self . panel . add ( self . menu ) <EOL> self . panel . add ( self . context ) <EOL> self . initWidget ( self . panel ) <EOL> self . context . setContextMenu ( self ) <EOL> def onContextMenu ( self , sender ) : <EOL> event = DOM . eventGetCurrentEvent ( ) <EOL> subMenu = MenuBar ( True ) <EOL> subMenu . addItem ( "<STR_LIT>" , True , self ) <EOL> subMenu . addItem ( "<STR_LIT>" , True , self ) <EOL> subMenu . addItem ( "<STR_LIT>" , True , self ) <EOL> x = DOM . eventGetClientX ( event ) + <NUM_LIT:2> <EOL> y = DOM . eventGetClientY ( event ) + <NUM_LIT:2> <EOL> popup = ContextMenuPopupPanel ( subMenu ) <EOL> popup . showAt ( x , y ) <EOL> def execute ( self ) : <EOL> Window . alert ( "<STR_LIT>" ) <EOL> def onShow ( self ) : <EOL> pass <EOL> def init ( ) : <EOL> return SinkInfo ( "<STR_LIT>" , "<STR_LIT>" , Menus ) </s>
