def _create_action_items(self, extension):
        """ Create the action items for the extension.

        """
        workbench = self.workbench
        menu_items = extension.get_children(MenuItem)
        action_items = extension.get_children(ActionItem)
        if extension.factory:
            for item in extension.factory(workbench):
                if isinstance(item, MenuItem):
                    menu_items.append(item)
                elif isinstance(item, ActionItem):
                    action_items.append(item)
                else:
                    msg = "action extension created invalid action type '%s'"
                    raise TypeError(msg % type(item).__name__)
        return menu_items, action_items
dataset/ETHPy150Open nucleic/enaml/enaml/workbench/ui/ui_plugin.py/UIPlugin._create_action_items/original