<s> """<STR_LIT>""" <EOL> from traits . api import Event , HasTraits , Instance , Interface , Str <EOL> from traits . api import provides <EOL> from . i_editor import IEditor <EOL> from . i_view import IView <EOL> class IWorkbenchWindowLayout ( Interface ) : <EOL> """<STR_LIT>""" <EOL> editor_area_id = Str <EOL> window = Instance ( '<STR_LIT>' ) <EOL> editor_opening = Event ( IEditor ) <EOL> editor_opened = Event ( IEditor ) <EOL> editor_closing = Event ( IEditor ) <EOL> editor_closed = Event ( IEditor ) <EOL> view_opening = Event ( IView ) <EOL> view_opened = Event ( IView ) <EOL> view_closing = Event ( IView ) <EOL> view_closed = Event ( IView ) <EOL> def activate_editor ( self , editor ) : <EOL> """<STR_LIT>""" <EOL> def activate_view ( self , view ) : <EOL> """<STR_LIT>""" <EOL> def add_editor ( self , editor , title ) : <EOL> """<STR_LIT>""" <EOL> def add_view ( self , view , position = None , relative_to = None , size = ( - <NUM_LIT:1> , - <NUM_LIT:1> ) ) : <EOL> """<STR_LIT>""" <EOL> def close_editor ( self , editor ) : <EOL> """<STR_LIT>""" <EOL> def close_view ( self , view ) : <EOL> """<STR_LIT>""" <EOL> def close ( self ) : <EOL> """<STR_LIT>""" <EOL> def create_initial_layout ( self , parent ) : <EOL> """<STR_LIT>""" <EOL> def contains_view ( self , view ) : <EOL> """<STR_LIT>""" <EOL> def hide_editor_area ( self ) : <EOL> """<STR_LIT>""" <EOL> def hide_view ( self , view ) : <EOL> """<STR_LIT>""" <EOL> def refresh ( self ) : <EOL> """<STR_LIT>""" <EOL> def reset_editors ( self ) : <EOL> """<STR_LIT>""" <EOL> def reset_views ( self ) : <EOL> """<STR_LIT>""" <EOL> def show_editor_area ( self ) : <EOL> """<STR_LIT>""" <EOL> def show_view ( self , view ) : <EOL> """<STR_LIT>""" <EOL> def get_view_memento ( self ) : <EOL> """<STR_LIT>""" <EOL> def set_view_memento ( self , memento ) : <EOL> """<STR_LIT>""" <EOL> def get_editor_memento ( self ) : <EOL> """<STR_LIT>""" <EOL> def set_editor_memento ( self , memento ) : <EOL> """<STR_LIT>""" <EOL> def get_toolkit_memento ( self ) : <EOL> """<STR_LIT>""" <EOL> def set_toolkit_memento ( self , memento ) : <EOL> """<STR_LIT>""" <EOL> @ provides ( IWorkbenchWindowLayout ) <EOL> class MWorkbenchWindowLayout ( HasTraits ) : <EOL> """<STR_LIT>""" <EOL> editor_area_id = Str <EOL> window = Instance ( '<STR_LIT>' ) <EOL> editor_opening = Event ( IEditor ) <EOL> editor_opened = Event ( IEditor ) <EOL> editor_closing = Event ( IEditor ) <EOL> editor_closed = Event ( IEditor ) <EOL> view_opening = Event ( IView ) <EOL> view_opened = Event ( IView ) <EOL> view_closing = Event ( IView ) <EOL> view_closed = Event ( IView ) <EOL> def activate_editor ( self , editor ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError <EOL> def activate_view ( self , view ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError <EOL> def add_editor ( self , editor , title ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError <EOL> def add_view ( self , view , position = None , relative_to = None , size = ( - <NUM_LIT:1> , - <NUM_LIT:1> ) ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError <EOL> def close_editor ( self , editor ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError <EOL> def close_view ( self , view ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError <EOL> def close ( self ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError <EOL> def create_initial_layout ( self , parent ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError <EOL> def contains_view ( self , view ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError <EOL> def hide_editor_area ( self ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError <EOL> def hide_view ( self , view ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError <EOL> def refresh ( self ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError <EOL> def reset_editors ( self ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError <EOL> def reset_views ( self ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError <EOL> def show_editor_area ( self ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError <EOL> def show_view ( self , view ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError <EOL> def get_view_memento ( self ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError <EOL> def set_view_memento ( self , memento ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError <EOL> def get_editor_memento ( self ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError <EOL> def set_editor_memento ( self , memento ) : <EOL> """<STR_LIT>""" <EOL> raise NotImplementedError <EOL> def get_toolkit_memento ( self ) : <EOL> """<STR_LIT>""" <EOL> return None <EOL> def set_toolkit_memento ( self , memento ) : <EOL> """<STR_LIT>""" <EOL> return <EOL> def _get_editor_references ( self ) : <EOL> """<STR_LIT>""" <EOL> editor_manager = self . window . editor_manager <EOL> editor_references = { } <EOL> for editor in self . window . editors : <EOL> editor_reference = editor_manager . get_editor_memento ( editor ) <EOL> if editor_reference is not None : <EOL> editor_references [ editor . id ] = editor_reference <EOL> return editor_references </s>
