Register callback methods for triggered actions

        :param rafcon.gui.shortcut_manager.ShortcutManager shortcut_manager:
1132
def register_actions(self, shortcut_manager):
        
        shortcut_manager.add_callback_for_action("undo", self.undo)
        shortcut_manager.add_callback_for_action("redo", self.redo)
563594
def dispatch(self, *args, **kwargs):
        
        called_handlers = set()
        for handler_list in self.handlers.values():
            for handler, argspec in handler_list:
                accept_args, accept_kwargs = argspec.accepts
                if handler in called_handlers and False:
                    continue
                else:
                    if args_match(accept_args, accept_kwargs, self.default, *args, **kwargs):
                        called_handlers.add(handler)
                        handler(*args, **kwargs)
        
        return called_handlers
1305971
def register(self, method, uri, call_back):
        
        found = False

        self.create_route(uri, False)
        self.routes[uri]['handlers'].register_method(method,
                                                     call_back)
832852
private void addActivationHandler() {

        if (m_activationHandlerRegistration == null) {
            m_activationHandlerRegistration = addMouseDownHandler(new MouseDownHandler() {

                public void onMouseDown(MouseDownEvent event) {

                    // only act on click if not inside the button bar
                    if (!m_buttonBar.getElement().isOrHasChild((Node)event.getNativeEvent().getEventTarget().cast())) {
                        activateWidget();
                    }
                }
            });
        }
    }
45262
def _register_event_listeners(self, cls):
        
        event.listen(cls, 'after_insert', self._new_listener)
        event.listen(cls, 'after_update', self._update_listener)
        event.listen(cls, 'after_delete', self._delete_listener)
811198
def methods(self, *args, **kwds):
        
        self.callmanager.methods(self, *args, **kwds)
738524
def register(self, *paths, methods=None, name=None, handler=None):
        
        if isinstance(methods, str):
            methods = [methods]

        def wrapper(view):
            if handler is None:

                handler_ = view
                methods_ = methods or [METH_ANY]

                if isfunction(handler_) or ismethod(handler_):
                    handler_ = Handler.from_view(view, *methods_, name=name)

                handler_.bind(self, *paths, methods=methods_, name=name)

            else:

                view_name = view.__name__
                if not hasattr(handler, view_name):
                    setattr(handler, view_name, to_coroutine(view))
                name_ = name or view_name
                handler.bind(self, *paths, methods=methods, name=name_, view=view_name)

            return view

        # Support for @app.register(func)
        if len(paths) == 1 and callable(paths[0]):
            view = paths[0]

            if isclass(view) and issubclass(view, BaseException):
                return wrapper

            paths = []
            return wrapper(view)

        return wrapper
1039978
protected function registerManagerStartCallback()
    {
        $this->swooleServer->on('ManagerStart', function () {
            $this->setProcessName("{$this->app->name()} : Manager");

            $this->events->dispatch(new Events\ManagerStarted($this));

            $this->dispatchEvent('ManagerStart', $this);
        });
    }
340038
async def addSignalHandlers(self):
        '''
        
        '''

        def sigint():
            self.printf('<ctrl-c>')
            if self.cmdtask is not None:
                self.cmdtask.cancel()

        self.loop.add_signal_handler(signal.SIGINT, sigint)
735779
def register_callback(self, callback, remove=False):
        """"""

        # (Un)Register the callback.
        if remove and callback in self.callbacks:
            self.callbacks.remove(callback)
        elif not remove and callback not in self.callbacks:
            self.callbacks.append(callback)
1062160
def register_handlers(self, handler_classes):
        
        for handler_class in handler_classes:
            self.handlers.append(handler_class(client=self.client))
            logging.info('Successfully registered {handler_class}'.format(
                handler_class=getattr(handler_class, '__name__', str(handler_class)))
            )
809513
function Input(manager, callback) {
    var self = this;
    this.manager = manager;
    this.callback = callback;
    this.element = manager.element;
    this.target = manager.options.inputTarget;

    // smaller wrapper around the handler, for the scope and the enabled state of the manager,
    // so when disabled the input events are completely bypassed.
    this.domHandler = function(ev) {
        if (boolOrFn(manager.options.enable, [manager])) {
            self.handler(ev);
        }
    };

    this.init();

}
749501
def register_view(self, view):
        """"""
        super(AbstractTreeViewController, self).register_view(view)
        self.signal_handlers.append((self._tree_selection,
                                     self._tree_selection.connect('changed', self.selection_changed)))
        # self.handler_ids.append((self.tree_view,
        #                          self.tree_view.connect('key-press-event', self.tree_view_keypress_callback)))
        self.tree_view.connect('key-release-event', self.on_key_release_event)
        self.tree_view.connect('button-release-event', self.tree_view_keypress_callback)
        # key press is needed for tab motion but needs to be registered already here TODO why?
        self.tree_view.connect('key-press-event', self.tree_view_keypress_callback)
        self._tree_selection.set_mode(Gtk.SelectionMode.MULTIPLE)
        self.update_selection_sm_prior()
658786
def register_led_updates(self, callback, button):
        """"""
        button_callbacks = self._button_observer_callbacks.get(button)
        if not button_callbacks:
            self._button_observer_callbacks[button] = []
        _LOGGER.debug('New callback for button %d', button)
        self._button_observer_callbacks[button].append(callback)
822054
def register_actions(self, shortcut_manager):
        
        shortcut_manager.add_callback_for_action("add", partial(self._add_new_state, state_type=StateType.EXECUTION))
        shortcut_manager.add_callback_for_action("add_execution_state", partial(self._add_new_state,
                                                                                state_type=StateType.EXECUTION))
        shortcut_manager.add_callback_for_action("add_hierarchy_state", partial(self._add_new_state,
                                                                                state_type=StateType.HIERARCHY))
        shortcut_manager.add_callback_for_action("add_barrier_state", partial(self._add_new_state,
                                                                              state_type=StateType.BARRIER_CONCURRENCY))
        shortcut_manager.add_callback_for_action("add_preemptive_state", partial(self._add_new_state,
                                                                                 state_type=StateType.PREEMPTION_CONCURRENCY))

        shortcut_manager.add_callback_for_action("add_output", partial(self._add_data_port_to_selected_state,
                                                                       data_port_type='OUTPUT'))
        shortcut_manager.add_callback_for_action("add_input", partial(self._add_data_port_to_selected_state,
                                                                      data_port_type='INPUT'))
        shortcut_manager.add_callback_for_action("add_scoped_variable", self._add_scoped_variable_to_selected_state)
        shortcut_manager.add_callback_for_action("add_outcome", self._add_outcome_to_selected_state)

        shortcut_manager.add_callback_for_action("delete", self._remove_selected_elements)

        shortcut_manager.add_callback_for_action("copy", self._copy_selection)
        shortcut_manager.add_callback_for_action("paste", self._paste_clipboard)
        shortcut_manager.add_callback_for_action("cut", self._cut_selection)

        shortcut_manager.add_callback_for_action('show_data_flows', self.update_view)
        shortcut_manager.add_callback_for_action('show_data_values', self.update_view)
        shortcut_manager.add_callback_for_action('data_flow_mode', self.data_flow_mode)
        shortcut_manager.add_callback_for_action('show_aborted_preempted', self.update_view)
679395
def action(
        self,
        intent_name,
        is_fallback=False,
        mapping={},
        convert={},
        default={},
        with_context=[],
        events=[],
        *args,
        **kw
    ):
        

        def decorator(f):
            action_funcs = self._intent_action_funcs.get(intent_name, [])
            action_funcs.append(f)
            self._intent_action_funcs[intent_name] = action_funcs

            self._intent_mappings[intent_name] = mapping
            self._intent_converts[intent_name] = convert
            self._intent_defaults[intent_name] = default
            self._intent_fallbacks[intent_name] = is_fallback
            self._intent_events[intent_name] = events
            self._register_context_to_func(intent_name, with_context)

            @wraps(f)
            def wrapper(*args, **kw):
                self._flask_assitant_view_func(*args, **kw)

            return f

        return decorator
630447
def remove_all_callbacks(self):
        
        for action in self.registered_shortcut_callbacks.keys():
            for callback in self.registered_shortcut_callbacks[action]:
                self.shortcut_manager.remove_callback_for_action(action, callback)
        # delete all registered shortcut callbacks
        self.registered_shortcut_callbacks = {}