<s> """<STR_LIT>""" <EOL> from envisage . api import ExtensionPoint , Plugin , ServiceOffer <EOL> from traits . api import Callable , List <EOL> PKG = '<STR_LIT:.>' . join ( __name__ . split ( '<STR_LIT:.>' ) [ : - <NUM_LIT:1> ] ) <EOL> class WorkbenchPlugin ( Plugin ) : <EOL> """<STR_LIT>""" <EOL> ACTION_SETS = PKG + '<STR_LIT>' <EOL> PERSPECTIVES = PKG + '<STR_LIT>' <EOL> PREFERENCES_PAGES = PKG + '<STR_LIT>' <EOL> WORKBENCH_SERVICE_OFFERS = PKG + '<STR_LIT>' <EOL> VIEWS = PKG + '<STR_LIT>' <EOL> PREFERENCES = '<STR_LIT>' <EOL> SERVICE_OFFERS = '<STR_LIT>' <EOL> id = '<STR_LIT>' <EOL> name = '<STR_LIT>' <EOL> action_sets = ExtensionPoint ( <EOL> List ( Callable ) , id = ACTION_SETS , desc = """<STR_LIT>""" <EOL> ) <EOL> perspectives = ExtensionPoint ( <EOL> List ( Callable ) , id = PERSPECTIVES , desc = """<STR_LIT>""" <EOL> ) <EOL> preferences_pages = ExtensionPoint ( <EOL> List ( Callable ) , id = PREFERENCES_PAGES , desc = """<STR_LIT>""" <EOL> ) <EOL> service_offers = ExtensionPoint ( <EOL> List ( ServiceOffer ) , <EOL> id = WORKBENCH_SERVICE_OFFERS , <EOL> desc = """<STR_LIT>""" <EOL> ) <EOL> views = ExtensionPoint ( <EOL> List ( Callable ) , id = VIEWS , desc = """<STR_LIT>""" <EOL> ) <EOL> my_action_sets = List ( contributes_to = ACTION_SETS ) <EOL> def _my_action_sets_default ( self ) : <EOL> """<STR_LIT>""" <EOL> from . default_action_set import DefaultActionSet <EOL> return [ DefaultActionSet ] <EOL> my_preferences = List ( contributes_to = PREFERENCES ) <EOL> def _my_preferences_default ( self ) : <EOL> """<STR_LIT>""" <EOL> return [ '<STR_LIT>' ] <EOL> my_preferences_pages = List ( contributes_to = PREFERENCES_PAGES ) <EOL> def _my_preferences_pages_default ( self ) : <EOL> """<STR_LIT>""" <EOL> from . workbench_preferences_page import WorkbenchPreferencesPage <EOL> return [ WorkbenchPreferencesPage ] <EOL> my_service_offers = List ( contributes_to = SERVICE_OFFERS ) <EOL> def _my_service_offers_default ( self ) : <EOL> """<STR_LIT>""" <EOL> preferences_manager_service_offer = ServiceOffer ( <EOL> protocol = '<STR_LIT>' <EOL> '<STR_LIT>' , <EOL> factory = self . _create_preferences_manager_service <EOL> ) <EOL> workbench_service_offer = ServiceOffer ( <EOL> protocol = '<STR_LIT>' , <EOL> factory = self . _create_workbench_service <EOL> ) <EOL> return [ preferences_manager_service_offer , workbench_service_offer ] <EOL> def _create_preferences_manager_service ( self , ** properties ) : <EOL> """<STR_LIT>""" <EOL> from apptools . preferences . ui . api import PreferencesManager <EOL> preferences_manager = PreferencesManager ( <EOL> pages = [ factory ( ) for factory in self . preferences_pages ] <EOL> ) <EOL> return preferences_manager <EOL> def _create_workbench_service ( self , ** properties ) : <EOL> """<STR_LIT>""" <EOL> return getattr ( self . application , '<STR_LIT>' , None ) </s>
