'Helper method for setting the user interaction handlers.'

def _setUserInteractionHandler(self, handler):

    if self.__scene.user_interaction_handler:
        if isinstance(self.__scene.user_interaction_handler, (interactions.ResizeArrowAnnotation, interactions.ResizeTextAnnotation)):
            self.__scene.user_interaction_handler.commit()
        self.__scene.user_interaction_handler.ended.disconnect(self.__onInteractionEnded)
    if handler:
        handler.ended.connect(self.__onInteractionEnded)
        set_enabled_all(self.__disruptiveActions, False)
    self.__scene.set_user_interaction_handler(handler)
