Add a KE-chain Navigation Bar (e.g. navigation bar widget) to the customization.

        The widget will be saved to KE-chain.

        :param activities: List of activities. Each activity must be a Python dict(), with the following keys:
            * customText: A custom text for each button in the attachment viewer widget: None (default): Task name;
            a String value: Custom text
            * emphasize: bool which determines if the button should stand-out or not - default(False)
            * activityId: class `Activity` or UUID
        :type activities: list
        :param alignment: The alignment of the buttons inside navigation bar
            * center (default): Center aligned
            * start: left aligned
        :type alignment: basestring (see :class:`enums.NavigationBarAlignment`)

        :raises IllegalArgumentError: When unknown or illegal arguments are passed.

def add_navigation_bar_widget(self, activities, alignment=NavigationBarAlignment.CENTER):
        """
        Add a KE-chain Navigation Bar (e.g. navigation bar widget) to the customization.

        The widget will be saved to KE-chain.

        :param activities: List of activities. Each activity must be a Python dict(), with the following keys:
            * customText: A custom text for each button in the attachment viewer widget: None (default): Task name;
            a String value: Custom text
            * emphasize: bool which determines if the button should stand-out or not - default(False)
            * activityId: class `Activity` or UUID
        :type activities: list
        :param alignment: The alignment of the buttons inside navigation bar
            * center (default): Center aligned
            * start: left aligned
        :type alignment: basestring (see :class:`enums.NavigationBarAlignment`)

        :raises IllegalArgumentError: When unknown or illegal arguments are passed.
        """
        # Loop through the list of activities
        set_of_expected_keys = {'activityId', 'customText', 'emphasize'}
        for activity_dict in activities:
            if set(activity_dict.keys()).issubset(set_of_expected_keys) and 'activityId' in set_of_expected_keys:
                # Check whether the activityId is class `Activity` or UUID
                activity = activity_dict['activityId']
                if isinstance(activity, Activity):
                    activity_dict['activityId'] = activity.id
                elif isinstance(activity, text_type) and is_uuid(activity):
                    pass
                else:
                    raise IllegalArgumentError("When using the add_navigation_bar_widget, activityId must be an "
                                               "Activity or Activity id. Type is: {}".format(type(activity)))
                if 'customText' not in activity_dict.keys() or not activity_dict['customText']:
                    activity_dict['customText'] = str()
                if 'emphasize' not in activity_dict.keys():
                    activity_dict['emphasize'] = False

            else:
                raise IllegalArgumentError("Found unexpected key in activities. Only keys allowed are: {}".
                                           format(set_of_expected_keys))

        # Declare navigation bar widget config
        config = {
            'alignment': alignment,
            'xtype': ComponentXType.ACTIVITYNAVIGATIONBAR,
            'filter': {
                'activity_id': str(self.activity.id)
            },
            'taskButtons': activities
        }

        for activity_dict in activities:
            activity_id = activity_dict['activityId']
            activity_dict['name'] = self._client.activity(id=activity_id).name

        # Declare navigation bar widget meta
        meta = {
            'alignment': alignment,
            'activityId': str(self.activity.id),
            'taskButtons': activities
        }

        self._add_widget(dict(config=config, meta=meta, name=WidgetNames.TASKNAVIGATIONBARWIDGET))