<s> from traits . api import Any , Bool , Event , HasTraits , Interface , Instance , Property , Unicode , Vetoable , VetoableEvent , cached_property <EOL> class IEditor ( Interface ) : <EOL> """<STR_LIT>""" <EOL> name = Unicode <EOL> tooltip = Unicode <EOL> control = Any <EOL> obj = Any <EOL> dirty = Bool <EOL> editor_area = Instance ( <EOL> '<STR_LIT>' ) <EOL> is_active = Bool <EOL> has_focus = Bool <EOL> closing = VetoableEvent <EOL> closed = Event <EOL> def close ( self ) : <EOL> """<STR_LIT>""" <EOL> def create ( self , parent ) : <EOL> """<STR_LIT>""" <EOL> def destroy ( self ) : <EOL> """<STR_LIT>""" <EOL> class MEditor ( HasTraits ) : <EOL> """<STR_LIT>""" <EOL> name = Unicode <EOL> tooltip = Unicode <EOL> control = Any <EOL> obj = Any <EOL> dirty = Bool ( False ) <EOL> editor_area = Instance ( <EOL> '<STR_LIT>' ) <EOL> is_active = Property ( Bool , depends_on = '<STR_LIT>' ) <EOL> has_focus = Bool ( False ) <EOL> closing = VetoableEvent <EOL> closed = Event <EOL> def close ( self ) : <EOL> """<STR_LIT>""" <EOL> if self . control is not None : <EOL> self . closing = event = Vetoable ( ) <EOL> if not event . veto : <EOL> self . editor_area . remove_editor ( self ) <EOL> self . closed = True <EOL> @ cached_property <EOL> def _get_is_active ( self ) : <EOL> if self . editor_area is not None : <EOL> return self . editor_area . active_editor == self <EOL> return False </s>
