Handles when the user clicks on an item -- this method will listen
        for when the user clicks the 'add another item' item or when the
        user clicks on the remove icon next to the item.
165752
def handleClick(self, item, column):
        
        if item.text(0) == 'add another item':
            new_item = self.addEntry()
            self.setCurrentItem(new_item, 1)
            self.editItem(new_item, 1)
        
        elif column == 0:
            self.takeTopLevelItem(self.indexOfTopLevelItem(item))
211937
def _handle_double_click(self, event):
        
        if event.get_button()[1] == 1:  # Left mouse button
            path_info = self.view.tree_view.get_path_at_pos(int(event.x), int(event.y))
            if path_info:  # Valid entry was clicked on
                path = path_info[0]
                item_iter = self.tree_store.get_iter(path)

                # Toggle collapse status if applicable for this kind of state
                if self.view.tree_view.row_expanded(path):
                    self.view.tree_view.collapse_row(path)
                else:
                    if self.tree_store.iter_has_child(item_iter):
                        self.view.tree_view.expand_to_path(path)
1019872
@SuppressWarnings("unchecked")
    void onItemClick(MouseEvents.ClickEvent event, Object itemId, Object propertyId) {

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

            if (event.getButton().equals(MouseButton.LEFT)) {
                setValue(null);
            }
            changeValueIfNotMultiSelect(itemId);
            // don't interfere with multi-selection using control key
            if (event.getButton().equals(MouseButton.RIGHT) || (propertyId == null)) {
                m_menu.removeAllItems();
                fillContextMenu((Set<Logger>)getValue());
                m_menu.openForTable(event, itemId, propertyId, this);
            }

        }
    }
1236881
def _on_items_changed(self, change):
        
        if change['type'] != 'container':
            return
        op = change['operation']
        if op == 'append':
            i = len(change['value'])-1
            self.adapter.notifyItemInserted(i)
        elif op == 'insert':
            self.adapter.notifyItemInserted(change['index'])
        elif op in ('pop', '__delitem__'):
            self.adapter.notifyItemRemoved(change['index'])
        elif op == '__setitem__':
            self.adapter.notifyItemChanged(change['index'])
        elif op == 'extend':
            n = len(change['items'])
            i = len(change['value'])-n
            self.adapter.notifyItemRangeInserted(i, n)
        elif op in ('remove', 'reverse', 'sort'):
            # Reset everything for these
            self.adapter.notifyDataSetChanged()
565216
function (newItems) {

            var itemsListener = this._itemsListener;
            var json = this.json;
            var oldItems = this._data.items;
            var numberOfItems;

            if (oldItems == newItems) {
                // items did not change
                // return;
                numberOfItems = newItems.length;
            } else {
                if (oldItems) {
                    // remove the listener on the old items object:
                    for (var i = 0, l = oldItems.length; i < l; i++) {
                        json.removeListener(oldItems[i], null, itemsListener);
                    }
                }
                json.setValue(this._data, "items", newItems);

                if (newItems) {
                    numberOfItems = newItems.length;
                    // add the listener on the new items object:
                    for (var i = 0, l = newItems.length; i < l; i++) {
                        json.addListener(newItems[i], null, itemsListener);
                    }
                    var view = this._data.itemsView;
                    if (view) {
                        view.initialArray = newItems;
                        view.refresh(view.CHANGED_INITIAL_ARRAY);
                    }
                }
            }

            if (this._data.displayOptions) {
                this._calcRowCols(this._data.displayOptions.flowOrientation, this._data.numberOfRows, this._data.numberOfColumns, numberOfItems);
            }

        }
123165
def handleThumbDblClick( self, item ):
        
        if ( isinstance(item, RecordListWidgetItem) ):
            self.emitRecordDoubleClicked(item.record())
943688
def item_selected(self, item=None):
        """"""
        if item is None:
            item = self.currentItem()

        # stack history is in inverse order
        try:
            index = self.stack_history[-(self.currentRow()+1)]
        except IndexError:
            pass
        else:
            self.editor.set_stack_index(index)
            self.editor.current_changed(index)
        self.hide()
56586
async def handle_event(self, event: FacebookMessage):
        
        responder = FacebookResponder(self)
        await self._notify(event, responder)
188955
def OnItemSelected(self, event):
        """"""

        value = event.m_itemIndex
        self.startIndex = value

        self.switching = True
        post_command_event(self, self.GridActionTableSwitchMsg, newtable=value)
        self.switching = False

        event.Skip()
160571
function _handleClick() {
    perfBar.el.querySelector('.perfBar-bar').addEventListener('click', function(e) {
      perfBar.el.classList.toggle('perfBar-is-active')
    })
  }
421379
def on_button_press(self, event):
        
        if event.get_button()[1] not in self._buttons:
            return False  # Only handle events for registered buttons (left mouse clicks)

        if event.get_state()[1] & constants.RUBBERBAND_MODIFIER:
            return False  # Mouse clicks with pressed shift key are handled in another tool

        # Special case: moving the NameView
        # This is only allowed, if the hovered item is a NameView and the Ctrl-key is pressed and the only selected
        # item is the parental StateView. In this case, the selection and _item will no longer be looked at,
        # but only _move_name_v
        self._item = self.get_item()
        if isinstance(self._item, NameView):
            selected_items = self.view.selected_items
            if event.get_state()[1] & Gdk.ModifierType.CONTROL_MASK and len(selected_items) == 1 and next(iter(selected_items)) is \
                    self._item.parent:
                self._move_name_v = True
            else:
                self._item = self._item.parent

        if not self._move_name_v:
            self._old_selection = self.view.selected_items
            if self._item not in self.view.selected_items:
                # When items are to be moved, a button-press should not cause any deselection.
                # However, the selection is stored, in case no move operation is performed.
                self.view.handle_new_selection(self._item)

        if not self.view.is_focus():
            self.view.grab_focus()

        return True
772178
public void onClick(MenuItemClickEvent event) {
		if (editController.getEditMode() == EditMode.DRAG_MODE) {
			editController.setEditMode(EditMode.INSERT_MODE);
		} else {
			editController.setEditMode(EditMode.DRAG_MODE);
		}
	}
513910
function(item) {
            var $handle = $.data(item, 'select-handle');

            if ($handle) {
                $handle.removeData('select-item');
                this.removeAllListeners($handle);
            }

            $.removeData(item, 'select');
            $.removeData(item, 'select-handle');

            if (this.$focusedItem && this.$focusedItem[0] === item) {
                this.$focusedItem = null;
            }
        }
1328812
protected void onItemClick(ItemClickEvent event) {

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

            Set<String> nameSet = new LinkedHashSet<String>();

            CmsModuleRow moduleRow = (CmsModuleRow)(event.getItemId());
            select(moduleRow);
            nameSet.add(moduleRow.getModule().getName());
            if (event.getButton().equals(MouseButton.RIGHT) || (event.getPropertyId() == null)) {
                select(moduleRow);
                m_menu.setEntries(m_app.getMenuEntries(), nameSet);
                m_menu.openForTable(event, this);
            } else if (event.getButton().equals(MouseButton.LEFT) && "name".equals(event.getPropertyId())) {

                m_app.openModuleInfo(nameSet);
            }

        }
    }
887420
def onselection(self, widget):
        """"""
        self._selected_key = None
        for k in self.children:
            if self.children[k] == widget:  # widget is the selected ListItem
                self._selected_key = k
                if (self._selected_item is not None) and self._selectable:
                    self._selected_item.attributes['selected'] = False
                self._selected_item = self.children[self._selected_key]
                if self._selectable:
                    self._selected_item.attributes['selected'] = True
                break
        return (self._selected_key,)
1115290
protected void onClose() {

        if ((m_selectedItem != null)) {
            if (m_selectedItem.hasSubmenu()) {
                m_selectedItem.getSubMenu().onClose();
            }
            m_selectedItem.deselectItem();
        }
        m_popup.hide();
    }
491624
@SuppressWarnings("unchecked")
    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) || (propertyId == null)) {
                m_menu.setEntries(getMenuEntries(), (Set<String>)getValue());
                m_menu.openForTable(event, itemId, propertyId, this);
            } else if (event.getButton().equals(MouseButton.LEFT) && TableProperty.Name.equals(propertyId)) {
                String typeName = (String)itemId;
                openEditDialog(typeName);
            }
        }
    }