Sets the selection to the specified index and updates the buttons
to reflect the change. This does not update the model.
483898
protected void updateSelection (int selidx)
    {
        // do nothing if this element is already selected
        if (selidx == _selectedIndex) {
            return;
        }

        // unhighlight the old component
        if (_selectedIndex != -1) {
            JLabel but = (JLabel)getComponent(_selectedIndex);
            but.setBorder(DESELECTED_BORDER);
        }

        // save the new selection
        _selectedIndex = selidx;

        // if the selection is valid, highlight the new component
        if (_selectedIndex != -1) {
            JLabel but = (JLabel)getComponent(_selectedIndex);
            but.setBorder(SELECTED_BORDER);
        }

        // fire an action performed to let listeners know about our
        // changed selection
        fireActionPerformed();

        repaint();
    }
1350242
def updates_selection(update_selection):
    
    def handle_update(selection, *args, **kwargs):
        """Check for changes in the selection

        If the selection is changed by the decorated method, the internal core element lists are updated and a signal is
        emitted with the old and new selection as well as the name of the method that caused the change..
        """
        old_selection = selection.get_all()
        update_selection(selection, *args, **kwargs)
        new_selection = selection.get_all()

        affected_models = old_selection ^ new_selection
        if len(affected_models) != 0:  # The selection was updated
            deselected_models = old_selection - new_selection
            selected_models = new_selection - old_selection
            map(selection.relieve_model, deselected_models)
            map(selection.observe_model, selected_models)

            # Maintain internal lists for fast access
            selection.update_core_element_lists()

            # Clear focus if no longer in selection
            if selection.focus and selection.focus not in new_selection:
                del selection.focus

            # Send notifications about changes
            affected_classes = set(model.core_element.__class__ for model in affected_models)
            msg_namedtuple = SelectionChangedSignalMsg(update_selection.__name__, new_selection, old_selection,
                                                       affected_classes)
            selection.selection_changed_signal.emit(msg_namedtuple)
            if selection.parent_signal is not None:
                selection.parent_signal.emit(msg_namedtuple)
    return handle_update
1216554
public void setSelectionStyle(ThemeUtil.ButtonStyle selectionStyle) {
        if (activePane != null) {
            activePane.updateSelectionStyle(this.selectionStyle, selectionStyle);
        }
        
        this.selectionStyle = selectionStyle;
    }
811785
protected void selectionChanged() {
		if (getSelectionProvider() == null)
			return;
		INode element = computeHighlightRangeSourceReference();
		// if
		// (getPreferenceStore().getBoolean(PreferenceConstants.EDITOR_SYNC_OUTLINE_ON_CURSOR_MOVE))
		synchronizeOutlinePage(element);
		// if (fIsBreadcrumbVisible && fBreadcrumb != null &&
		// !fBreadcrumb.isActive())
		// setBreadcrumbInput(element);
		setSelection(element, false);
		// if (!fSelectionChangedViaGotoAnnotation)
		// updateStatusLine();
		// fSelectionChangedViaGotoAnnotation= false;

	}
667455
private void updateDomainAxisRange()
    {
        int count = dataSet.getSeries(0).getItemCount();
        if (count < SHOW_FIXED_GENERATIONS)
        {
            domainAxis.setRangeWithMargins(0, SHOW_FIXED_GENERATIONS);
        }
        else if (allDataButton.isSelected())
        {
            domainAxis.setRangeWithMargins(0, Math.max(SHOW_FIXED_GENERATIONS, count));
        }
        else
        {
            domainAxis.setRangeWithMargins(count - SHOW_FIXED_GENERATIONS, count);
        }
    }
1083775
private void updateListActivity(boolean setSelection) {
        activityListModel.clear();
        if (getDialogObject() != null) {
            List<String> activities = new ArrayList<String>(getDialogObject().getActivities());
            Collections.sort(activities);
            for (String activity : activities) {
                activityListModel.addElement(activity);
            }
        }
        if (!activityListModel.isEmpty() && setSelection) {
            activityList.setSelectedIndex(0);
        }
    }
752013
public final void setSelected(boolean selected) {
		if (isExclusiveGroupMember()) {
			boolean oldState = isSelected();
			exclusiveController.handleSelectionRequest(this, selected);
			// set back button state if controller didn't change this command;
			// needed b/c of natural button check box toggling in swing
			if (oldState == isSelected()) {
				Iterator iter = buttonIterator();
				while (iter.hasNext()) {
					AbstractButton button = (AbstractButton)iter.next();
					button.setSelected(isSelected());
				}
			}
		}
		else {
			requestSetSelection(selected);
		}
	}
2040
def setCurrentIndex(self, currentIndex):
        
        selectionModel = self.selectionModel()
        selectionFlags = (QtCore.QItemSelectionModel.ClearAndSelect |
                          QtCore.QItemSelectionModel.Rows)
        selectionModel.setCurrentIndex(currentIndex, selectionFlags)
389179
def set_select(self, selector, updates):
        ''' 

        '''
        for obj in self.select(selector):
            for key, val in updates.items():
                setattr(obj, key, val)
47235
@Override
	public void setSelected(boolean selected) {
		if (selected) {
			((ToolbarModalAction) toolbarAction).onSelect(null);
		} else {
			((ToolbarModalAction) toolbarAction).onDeselect(null);
		}
	}
66621
public function setActiveSelectionByIndex($iIdx)
    {
        if (($aSelections = $this->getSelections())) {
            $iSelIdx = 0;
            foreach ($aSelections as $oSelection) {
                $oSelection->setActiveState($iSelIdx == $iIdx);
                if ($iSelIdx == $iIdx) {
                    $this->_oActiveSelection = $oSelection;
                }
                $iSelIdx++;
            }
        }
    }
1141289
private void updateValue() {
        if (list != null) {
            int oldCount = this.count;
            this.count = list.getSelectedIndices().length;
            maybeNotifyListeners(oldCount, count);
        }
    }
97036
private void updateSelection() {
        Dateitem selectedItem = getSelectedItem();
        
        if (selectedItem == null) {
            addStyle("color", "gray");
        } else {
            addStyle("color", "inherit");
        }
        
        setFocus(false);
    }
273690
def _set_selected_action(self, action):
        """"""
        assert action in self._action_sets

        if self._selected_action is not None:
            raise ValueError("The action has already been selected.")
        self._selected_action = action
538592
def updateUi(self):
        
        index = self._slideshow.currentIndex()
        count = self._slideshow.count()
        
        self._previousButton.setVisible(index != 0)
        self._nextButton.setText('Finish' if index == count - 1 else 'Next')
        self.autoLayout()
347512
void addSelectionBinding(ReadOnlyObjectProperty<Change> currentChange) {
    currentChange.addListener(
        (observable, oldValue, newValue) -> getSelectionModel().select(newValue)
    );
  }
196847
public void setSorting(boolean value) {
        model.setSortingCategories(value);
        model.setSortingProperties(value);
        sortButton.setSelected(value);
    }