def select_workspace(self, extension_id):
        """ Select and start the workspace for the given extension id.

        The current workspace will be stopped and released.

        """
        target = None
        workbench = self.workbench
        point = workbench.get_extension_point(WORKSPACES_POINT)
        for extension in point.extensions:
            if extension.qualified_id == extension_id:
                target = extension
                break

        if target is None:
            msg = "'%s' is not a registered workspace extension"
            raise ValueError(msg % extension_id)

        if target is self._workspace_extension:
            return

        old_workspace = self._model.workspace
        old_workspace.stop()
        old_workspace.workbench = None

        self._workspace_extension = target
        new_workspace = self._create_workspace(target)

        new_workspace.workbench = workbench
        new_workspace.start()
        self._model.workspace = new_workspace

    #--------------------------------------------------------------------------
    # Private API
    #--------------------------------------------------------------------------
    #: The application provided by an ApplicationFactory extension.
dataset/ETHPy150Open nucleic/enaml/enaml/workbench/ui/ui_plugin.py/UIPlugin.select_workspace/original