<s> import pyjd <EOL> from pyjamas import Window <EOL> from pyjamas import DeferredCommand <EOL> from pyjamas . ui . DockPanel import DockPanel <EOL> from pyjamas . ui . RootPanel import RootPanel <EOL> from pyjamas . ui . VerticalPanel import VerticalPanel <EOL> from MailDetail import MailDetail <EOL> from Shortcuts import Shortcuts <EOL> from MailList import MailList <EOL> from TopPanel import TopPanel <EOL> from MailLogger import Logger <EOL> class Mail : <EOL> def get ( self ) : <EOL> return self . singleton <EOL> def onModuleLoad ( self ) : <EOL> self . singleton = self <EOL> topPanel = TopPanel ( ) <EOL> rightPanel = VerticalPanel ( ) <EOL> self . mailDetail = MailDetail ( ) <EOL> self . shortcuts = Shortcuts ( ) <EOL> topPanel . setWidth ( "<STR_LIT>" ) <EOL> mailList = MailList ( self . singleton ) <EOL> mailList . setWidth ( "<STR_LIT>" ) <EOL> rightPanel . add ( mailList ) <EOL> rightPanel . add ( self . mailDetail ) <EOL> mailList . setWidth ( "<STR_LIT>" ) <EOL> self . mailDetail . setWidth ( "<STR_LIT>" ) <EOL> outer = DockPanel ( ) <EOL> outer . add ( topPanel , DockPanel . NORTH ) <EOL> outer . add ( self . shortcuts , DockPanel . WEST ) <EOL> outer . add ( rightPanel , DockPanel . CENTER ) <EOL> outer . setWidth ( "<STR_LIT>" ) <EOL> outer . setSpacing ( <NUM_LIT:4> ) <EOL> outer . setCellWidth ( rightPanel , "<STR_LIT>" ) <EOL> Window . addWindowResizeListener ( self ) <EOL> Window . enableScrolling ( False ) <EOL> Window . setMargin ( "<STR_LIT>" ) <EOL> RootPanel ( ) . add ( outer ) <EOL> RootPanel ( ) . add ( Logger ( ) ) <EOL> DeferredCommand . add ( self ) <EOL> def execute ( self ) : <EOL> self . onWindowResized ( Window . getClientWidth ( ) , Window . getClientHeight ( ) ) <EOL> def onWindowResized ( self , width , height ) : <EOL> shortcutHeight = height - self . shortcuts . getAbsoluteTop ( ) - <NUM_LIT:8> <EOL> if ( shortcutHeight < <NUM_LIT:1> ) : <EOL> shortcutHeight = <NUM_LIT:1> <EOL> self . shortcuts . setHeight ( "<STR_LIT>" % shortcutHeight ) <EOL> self . mailDetail . adjustSize ( width , height ) <EOL> def displayItem ( self , item ) : <EOL> self . mailDetail . setItem ( item ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> pyjd . setup ( "<STR_LIT>" ) <EOL> m = Mail ( ) <EOL> m . onModuleLoad ( ) <EOL> pyjd . run ( ) </s>
