Registers events for menu items.
335311
protected function bootMenuItemEvents()
    {
        Event::listen('pages.menuitem.listTypes', function () {
            return [
                'cms-page' => 'cms::lang.page.cms_page'
            ];
        });

        Event::listen('pages.menuitem.getTypeInfo', function ($type) {
            if ($type === 'cms-page') {
                return CmsPage::getMenuTypeInfo($type);
            }
        });

        Event::listen('pages.menuitem.resolveItem', function ($type, $item, $url, $theme) {
            if ($type === 'cms-page') {
                return CmsPage::resolveMenuItem($item, $url, $theme);
            }
        });
    }
576686
def trigger_event(self, event, client, args, force_dispatch=False):
        """"""
        self.controller.process_event(event, client, args, force_dispatch=force_dispatch)
194195
protected function bindEvents(): void
    {
        $userConfig = $this->app['config'][static::$abstract];

        $handler = new EventHandler($this->app->events, $userConfig);

        $handler->subscribe();

        $handler->subscribeQueueEvents($this->app->queue);

        if (isset($userConfig['send_default_pii']) && $userConfig['send_default_pii'] !== false) {
            $handler->subscribeAuthEvents();
        }
    }
179001
function (items, options) {
            items = items || [];
            var self = this;
            this.each(function (item) {
                if (item instanceof EventDispatcher) {
                    item.unbind('*', self._onItemEvent, self);
                    item.unbind('change', self._onItemChange, self);
                }
            });

            this.$items = items || [];

            this.each(function (item) {
                if (item instanceof EventDispatcher) {
                    item.bind('*', self._onItemEvent, self);
                    item.bind('change', self._onItemChange, self);
                }
            });

            options = options || {};
            if (!options.silent) {
                this.trigger('reset', {items: items});
            }
        }
772178
public void onClick(MenuItemClickEvent event) {
		if (editController.getEditMode() == EditMode.DRAG_MODE) {
			editController.setEditMode(EditMode.INSERT_MODE);
		} else {
			editController.setEditMode(EditMode.DRAG_MODE);
		}
	}
1130067
public function registerEvents()
    {
        $job = & $this->job;

        Event::listen(Event::JOB_PERFORM, function ($event, $_job) use (&$job) {
            $job = $_job;
        });
    }
94596
protected function registerEventListeners()
    {
        foreach ($this->events as $event => $listener) {
            Event::listen($event, $listener);
        }

        return $this;
    }
211619
def _onMenuButton(self, evt):
        """"""
        x, y = self.GetPositionTuple()
        w, h = self.GetSizeTuple()
        self.PopupMenuXY(self._menu, x, y+h-4)
                # When menu returned, indicate selection in button
        evt.Skip()
812965
def init_menu():
    """"""
    # Register breadcrumb root
    item = current_menu.submenu('breadcrumbs.settings')
    item.register('', _('Account'))
    item = current_menu.submenu('breadcrumbs.{0}'.format(
        current_app.config['SECURITY_BLUEPRINT_NAME']))

    if current_app.config.get('SECURITY_CHANGEABLE', True):
        item.register('', _('Change password'))

        # Register settings menu
        item = current_menu.submenu('settings.change_password')
        item.register(
            "{0}.change_password".format(
                current_app.config['SECURITY_BLUEPRINT_NAME']),
            # NOTE: Menu item text (icon replaced by a user icon).
            _('%(icon)s Change password',
                icon='<i class="fa fa-key fa-fw"></i>'),
            order=1)

        # Register breadcrumb
        item = current_menu.submenu('breadcrumbs.{0}.change_password'.format(
            current_app.config['SECURITY_BLUEPRINT_NAME']))
        item.register(
            "{0}.change_password".format(
                current_app.config['SECURITY_BLUEPRINT_NAME']),
            _("Change password"),
            order=0,
        )
659387
def __setup_menu(self):
        """"""
        self.menu.clear()
        if self.data:
            actions = self.menu_actions
        else:
            actions = (self.new_action, self.open_action)
            self.setFocus() # --> Editor.__get_focus_editortabwidget
        add_actions(self.menu, list(actions) + self.__get_split_actions())
        self.close_action.setEnabled(self.is_closable)
1142783
protected function actions() {
		// run parent actions ( keep 'admin_head' hook )
		parent::actions();

		if ( empty( $this->struct['page_title'] ) || empty( $this->struct['menu_title'] ) ) {
			return;
		}

		$this->setup_pages();

	}
550038
protected void registerEventListener() {

        OpenCms.addCmsEventListener(
            this,
            new int[] {
                I_CmsEventListener.EVENT_RESOURCE_AND_PROPERTIES_MODIFIED,
                I_CmsEventListener.EVENT_RESOURCES_AND_PROPERTIES_MODIFIED,
                I_CmsEventListener.EVENT_RESOURCE_MODIFIED,
                I_CmsEventListener.EVENT_RESOURCES_MODIFIED,
                I_CmsEventListener.EVENT_RESOURCE_MOVED,
                I_CmsEventListener.EVENT_RESOURCE_DELETED,
                I_CmsEventListener.EVENT_PUBLISH_PROJECT,
                I_CmsEventListener.EVENT_CLEAR_CACHES,
                I_CmsEventListener.EVENT_CLEAR_ONLINE_CACHES,
                I_CmsEventListener.EVENT_CLEAR_OFFLINE_CACHES});
    }
488427
void onItemClick(MouseEvents.ClickEvent event, Object itemId, Object propertyId) {

        if (!event.isCtrlKey() && !event.isShiftKey()) {

            changeValueIfNotMultiSelect(itemId);

            // don't interfere with multi-selection using control key
            if (event.getButton().equals(MouseButton.RIGHT) || (TableProperty.Icon.equals(propertyId))) {

                m_menu.setEntries(getMenuEntries(), (Set<String>)getValue());
                m_menu.openForTable(event, itemId, propertyId, this);
            } else if (event.getButton().equals(MouseButton.LEFT) && TableProperty.UserName.equals(propertyId)) {
                showUserInfoWindow(((Set<String>)getValue()).iterator().next());
            }
        }
    }
1152235
@Override
    public void register(CareWebShell shell, ElementBase owner, boolean register) {
        if (register) {
            ElementPlugin plugin = (ElementPlugin) owner;
            BaseMenuComponent menu = plugin.getShell().addMenu(getPath(), getAction());
            plugin.registerComponent(menu);
            plugin.registerId(getId(), menu);
        }
    }
1112182
def register_menu_item(self, items):
        
        for itm in items:
            if itm.group in self.menu_items:
                # Only add the menu item if we don't already have it registered
                if itm not in self.menu_items[itm.group]['items']:
                    self.menu_items[itm.group]['items'].append(itm)
            else:
                logger.warning('Tried registering menu item to unknown group {}'.format(itm.group))
584085
def on_click(self, handler):
        ''' 

        '''
        self.on_event(ButtonClick, handler)
        self.on_event(MenuItemClick, handler)
304350
def attach_events(self, *events, **kwargs):
        """"""
        reg = self.registry
        insert = 'insert' in kwargs
        for e in events:
            cregexp = e.compile(self.config)
            regexp = getattr(e.regexp, 're', e.regexp)
            if regexp not in reg.events[e.iotype]:
                if insert:
                    reg.events_re[e.iotype].insert(0, (regexp, cregexp))
                else:
                    reg.events_re[e.iotype].append((regexp, cregexp))
            if insert:
                reg.events[e.iotype][regexp].insert(0, e)
            else:
                reg.events[e.iotype][regexp].append(e)