<s> """<STR_LIT>""" <EOL> from pyface . action . api import Action , MenuManager <EOL> from pyface . workbench . api import EditorManager , WorkbenchWindow <EOL> from pyface . workbench . api import Perspective , PerspectiveItem <EOL> from pyface . workbench . action . api import MenuBarManager <EOL> from pyface . workbench . action . api import ToolBarManager <EOL> from pyface . workbench . action . api import ViewMenuManager <EOL> from traits . api import Callable , List , Instance <EOL> from black_view import BlackView <EOL> from blue_view import BlueView <EOL> from green_view import GreenView <EOL> from red_view import RedView <EOL> from yellow_view import YellowView <EOL> from person import Person <EOL> class ExampleEditorManager ( EditorManager ) : <EOL> """<STR_LIT>""" <EOL> def get_editor_memento ( self , editor ) : <EOL> """<STR_LIT>""" <EOL> return ( editor . obj . name , editor . obj . age ) <EOL> def set_editor_memento ( self , memento ) : <EOL> """<STR_LIT>""" <EOL> name , age = memento <EOL> person = Person ( name = name , age = age ) <EOL> return self . create_editor ( self . window , person , None ) <EOL> class ExampleWorkbenchWindow ( WorkbenchWindow ) : <EOL> """<STR_LIT>""" <EOL> perspectives = [ <EOL> Perspective ( <EOL> name = '<STR_LIT>' , <EOL> contents = [ <EOL> PerspectiveItem ( id = '<STR_LIT>' , position = '<STR_LIT>' , height = <NUM_LIT:0.1> ) , <EOL> PerspectiveItem ( id = '<STR_LIT>' , position = '<STR_LIT:left>' , width = <NUM_LIT> ) <EOL> ] <EOL> ) , <EOL> Perspective ( <EOL> name = '<STR_LIT>' , <EOL> contents = [ <EOL> PerspectiveItem ( id = '<STR_LIT>' , position = '<STR_LIT>' ) , <EOL> PerspectiveItem ( id = '<STR_LIT>' , position = '<STR_LIT>' ) , <EOL> PerspectiveItem ( id = '<STR_LIT>' , position = '<STR_LIT:left>' ) , <EOL> PerspectiveItem ( id = '<STR_LIT>' , position = '<STR_LIT:right>' ) , <EOL> PerspectiveItem ( id = '<STR_LIT>' , position = '<STR_LIT:left>' ) <EOL> ] <EOL> ) <EOL> ] <EOL> view_factories = List ( Callable ) <EOL> _exit_action = Instance ( Action ) <EOL> _new_person_action = Instance ( Action ) <EOL> def _editor_manager_default ( self ) : <EOL> """<STR_LIT>""" <EOL> return ExampleEditorManager ( ) <EOL> def _menu_bar_manager_default ( self ) : <EOL> """<STR_LIT>""" <EOL> file_menu = MenuManager ( <EOL> self . _new_person_action , self . _exit_action , <EOL> name = '<STR_LIT>' , id = '<STR_LIT>' <EOL> ) <EOL> view_menu = ViewMenuManager ( name = '<STR_LIT>' , id = '<STR_LIT>' , window = self ) <EOL> return MenuBarManager ( file_menu , view_menu , window = self ) <EOL> def _tool_bar_managers_default ( self ) : <EOL> """<STR_LIT>""" <EOL> tool_bar_managers = [ <EOL> ToolBarManager ( <EOL> self . _exit_action , show_tool_names = False , name = str ( i ) <EOL> ) <EOL> for i in range ( <NUM_LIT:5> ) <EOL> ] <EOL> return tool_bar_managers <EOL> def _view_factories_default ( self ) : <EOL> """<STR_LIT>""" <EOL> from pyface . workbench . debug . api import DebugView <EOL> return [ DebugView , BlackView , BlueView , GreenView , RedView , YellowView ] <EOL> def _views_default ( self ) : <EOL> """<STR_LIT>""" <EOL> return [ factory ( window = self ) for factory in self . view_factories ] <EOL> def __exit_action_default ( self ) : <EOL> """<STR_LIT>""" <EOL> return Action ( name = '<STR_LIT>' , on_perform = self . workbench . exit ) <EOL> def __new_person_action_default ( self ) : <EOL> """<STR_LIT>""" <EOL> return Action ( name = '<STR_LIT>' , on_perform = self . _new_person ) <EOL> def _new_person ( self ) : <EOL> """<STR_LIT>""" <EOL> from person import Person <EOL> self . workbench . edit ( Person ( name = '<STR_LIT>' , age = <NUM_LIT:100> ) ) <EOL> return </s>
