Update selected_ids on click on index cell.
494087
def setData(self, index: QModelIndex, value, role=None):
        """"""
        if not (index.isValid() and role == Qt.CheckStateRole):
            return False
        c_id = self.get_item(index).Id
        self._set_id(c_id, value == Qt.Checked, index)
        return True
1109420
function(ids) {
        var me = this,
            selected = [];
        $.each(ids, function(index, value) {
            var item = me.$rightListBody.find(':checkbox[data-id="' + value + '"]');
            if (item.length > 0) {
                selected.push(item[0]);
            }
        });
        if (selected.length > 0) {
            this.moveLeft(selected, null);
        }
    }
665665
function updateTableData( columnIndex ) {
  let cell;
  const rows = this.ui.tableBody.querySelectorAll( 'tr' );
  this.tableData = [];
  columnIndex = columnIndex || this.sortColumnIndex;

  for ( let i = 0, len = rows.length; i < len; ++i ) {
    cell = rows[i].cells[columnIndex];
    if ( cell ) {
      cell = cell.textContent.trim();
    }
    this.tableData.push( [ cell, rows[i] ] );
  }

  const sortType = this.ui.sortButton.getAttribute( 'data-sort_type' );
  this.tableData.sort( this.tableDataSorter( this.sortDirection, sortType ) );

  return this.tableData;
}
567211
protected void update() {
        int sz = dataModel.getSize();
        int[] selected = helperList.getSelectedIndices();
        ArrayList sourceItems = new ArrayList(sz);
        ArrayList chosenItems = new ArrayList(selected.length);

        // Start with the source items filled from our data model
        for (int i = 0; i < sz; i++) {
            sourceItems.add(dataModel.getElementAt(i));
        }

        // Now move the selected items to the chosen list
        for (int i = selected.length - 1; i >= 0; i--) {
            chosenItems.add(sourceItems.remove(selected[i]));
        }

        Collections.reverse(chosenItems); // We built it backwards

        // Now install the two new lists
        sourceList.setListData(sourceItems.toArray());
        chosenList.setListData(chosenItems.toArray());
    }
666679
function (newValues) {
            var arrayUtil = ariaUtilsArray;

            this._stopUpdates();
            var newlySelectedIndexes = [];
            var newlyUnselectedIndexes = [];

            // Loop through all of the items and update the selection status for each item,
            // depending on the new array of selected values
            var selectedIndex = -1;
            var data = this._data;
            var items = data.items;
            var maxSelectedCount = this._getTrueMaxSelectedCount(items);
            var selectedCount = 0;
            for (var idx = 0, length = items.length; idx < length; idx++) {
                var item = items[idx];
                var selected = arrayUtil.contains(newValues, item.value);
                if (selected) {
                    if (selectedCount == maxSelectedCount) {
                        // cancel selection when there is more than what is allowed
                        selected = false;
                    } else if (selectedIndex == -1) {
                        selectedCount = 1;
                        selectedIndex = idx;
                    } else {
                        selectedCount++;
                        selectedIndex = null;
                    }
                }
                if (data.preselect === "none" || item.selected != selected) {
                    // selection has changed
                    (selected ? newlySelectedIndexes : newlyUnselectedIndexes).push(idx);
                    this.json.setValue(items[idx], "selected", selected);
                }
            }
            this.json.setValue(data, "selectedIndex", selectedIndex);
            this.json.setValue(data, "selectedCount", selectedCount);

            // James removed this because if more than one item is selected, data. selectedIndex is set to null.
            // Also, in the case of the multi-select we don't necessarily
            // Want to focus a selected item - need to check this on the list.
            // this.json.setValue(data, "focusIndex", selectedIndex);
            // this.setFocus(data.focusIndex);

            this._updateCurrentlyDisabled(items);
            this._resumeUpdates();
            if (newlySelectedIndexes.length > 0 || newlyUnselectedIndexes.length > 0) {
                this._raiseOnChangeEvent(newlySelectedIndexes, newlyUnselectedIndexes);
            }
        }
508622
def update_event_types(self):
        """"""
        self.idx_evt_type.clear()
        self.idx_evt_type.setSelectionMode(QAbstractItemView.ExtendedSelection)
        event_types = sorted(self.parent.notes.annot.event_types,
                             key=str.lower)

        for ty in event_types:
            item = QListWidgetItem(ty)
            self.idx_evt_type.addItem(item)
178659
def _updateItemComboBoxIndex(self, item, column, num):
        """"""
        item._combobox_current_index[column] = num
        item._combobox_current_value[column] = item._combobox_option_list[column][num][0]
896014
void onColumnSelect(final int index, final boolean selected) {
        final DataColumnDef columnDef = acceptableColumns.get(index);
        if (selected) {
            listEditor.getList().add(columnDef.clone());
        } else {
            listEditor.getList().remove(columnDef);
        }
        columnsChangedEvent.fire(new ColumnsChangedEvent(this, listEditor.getList()));
    }
535537
def update_ids(self, docids):
        """"""
        logger.info("updating %i id mappings" % len(docids))
        for docid in docids:
            if docid is not None:
                pos = self.id2pos.get(docid, None)
                if pos is not None:
                    logger.info("replacing existing document %r in %s" % (docid, self))
                    del self.pos2id[pos]
                self.id2pos[docid] = self.length
                try:
                    del self.id2sims[docid]
                except:
                    pass
            self.length += 1
        self.id2sims.sync()
        self.update_mappings()
562367
function click(d) {
      if (d.children) {
        d._children = d.children;
        d.children = null;
      } else {
        d.children = d._children;
        d._children = null;
      }
      update(d);
    }
758865
function select (index) {
    // force form to update state for validation
    $mdUtil.nextTick(function () {
      getDisplayValue(ctrl.matches[ index ]).then(function (val) {
        var ngModel = elements.$.input.controller('ngModel');
        $mdLiveAnnouncer.announce(val + ' ' + ctrl.selectedMessage, 'assertive');
        ngModel.$setViewValue(val);
        ngModel.$render();
      }).finally(function () {
        $scope.selectedItem = ctrl.matches[ index ];
        setLoading(false);
      });
    }, false);
  }
300365
def refresh(self, index=None):
        """"""
        if index is None:
            index = self.get_stack_index()
        # Set current editor
        if self.get_stack_count():
            index = self.get_stack_index()
            finfo = self.data[index]
            editor = finfo.editor
            editor.setFocus()
            self._refresh_outlineexplorer(index, update=False)
            self.__refresh_statusbar(index)
            self.__refresh_readonly(index)
            self.__check_file_status(index)
            self.__modify_stack_title()
            self.update_plugin_title.emit()
        else:
            editor = None
        # Update the modification-state-dependent parameters
        self.modification_changed()
        # Update FindReplace binding
        self.find_widget.set_editor(editor, refresh=False)
1208626
def _update(self):
        """"""
        self.dataChanged.emit(self.createIndex(0, 0), self.createIndex(
            len(self.collection), len(self.header)))
629427
def OnRefreshSelectedCells(self, event):
        """"""

        self.grid.actions.refresh_selected_frozen_cells()
        self.grid.ForceRefresh()

        event.Skip()
1252600
void switchTwoColumnHeaders(int columnIndex, int columnToIndex) {
        Object cellData = getColumnHeaders()[columnToIndex];
        getColumnHeaders()[columnToIndex] = getColumnHeaders()[columnIndex];
        getColumnHeaders()[columnIndex] = cellData;
    }
248078
function(ids) {
        var me = this,
            selected = [];
        $.each(ids, function(index, value) {
            var item = me.$leftListBody.find(':checkbox[data-id="' + value + '"]');
            if (item.length > 0 && !item.prop('disabled')) {
                selected.push(item[0]);
            }
        });
        if (selected.length > 0) {
            this.moveRight(selected, null);
        }
    }
877914
function _updateListItemSelection(listItem, selectedFile) {
        var shouldBeSelected = (selectedFile && $(listItem).data(_FILE_KEY).fullPath === selectedFile.fullPath);
        ViewUtils.toggleClass($(listItem), "selected", shouldBeSelected);
    }