def _refresh_branding(self):
        """ Refresh the branding object for the window model.

        """
        workbench = self.workbench
        point = workbench.get_extension_point(BRANDING_POINT)
        extensions = point.extensions
        if not extensions:
            self._branding_extension = None
            self._model.branding = Branding()
            return

        extension = extensions[-1]
        if extension is self._branding_extension:
            return

        if extension.factory:
            branding = extension.factory(workbench)
            if not isinstance(branding, Branding):
                msg = "extension '%s' created non-Branding type '%s'"
                args = (extension.qualified_id, type(branding).__name__)
                raise TypeError(msg % args)
        else:
            branding = extension.get_child(Branding, reverse=True)
            branding = branding or Branding()

        self._branding_extension = extension
        self._model.branding = branding
dataset/ETHPy150Open nucleic/enaml/enaml/workbench/ui/ui_plugin.py/UIPlugin._refresh_branding/original