Small hack for avoiding listview selection
968213
@Override
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {

        int topOffset = 0;

        View messageView = findMessageView();
        int padding = Screen.dp(8);
        if (showAvatar) {
            padding += Screen.dp(48);
        }
        measureChildWithMargins(messageView, widthMeasureSpec, padding, heightMeasureSpec, 0);

        if (showDateDiv) {
            measureChild(dateDiv, widthMeasureSpec, heightMeasureSpec);
            topOffset += Screen.dp(16) + dateDiv.getMeasuredHeight();
        }

        if (showUnreadDiv) {
            measureChild(unreadDiv, widthMeasureSpec, heightMeasureSpec);
            topOffset += Screen.dp(16) + unreadDiv.getMeasuredHeight();
        }

        if (showAvatar) {
            measureChild(avatarView, widthMeasureSpec, heightMeasureSpec);
        }

        setMeasuredDimension(MeasureSpec.getSize(widthMeasureSpec), messageView.getMeasuredHeight() + topOffset);
    }
1002189
protected void onClickOk() {

        String radioButtonName = m_radioGroup.getSelectedButton().getName();
        INFO selectedItemInfo = m_infosByName.get(radioButtonName);
        handleSelection(selectedItemInfo);
        hide();
    }
897389
private void doMoveSelectedEntriesInList(int moveBy)
	{
		PlayListEntry [] selected = playList.getSelectedEntries();
		if (selected!=null)
		{
			playlistUpdateThread.halt();
			try
			{
				if (moveBy < 0)
				{
					// Moveup --> Still possible?
					if ((selected[0].getIndexInPlaylist() + moveBy) < 0)
						moveBy = selected[0].getIndexInPlaylist();
					if (moveBy == 0) return;
					
					for (int i=0; i<selected.length; i++)
					{
						int fromIndex = selected[i].getIndexInPlaylist();
						playList.move(fromIndex, fromIndex + moveBy);
					}
				}
				else
				{
					// Movedown --> Still possible?
					int lastIndex = selected.length - 1;
					if ((selected[lastIndex].getIndexInPlaylist() + moveBy) >= playList.size())
						moveBy = playList.size() - 1 - selected[lastIndex].getIndexInPlaylist();
					if (moveBy == 0) return;
					
					for (int i=lastIndex; i>=0; i--)
					{
						int fromIndex = selected[i].getIndexInPlaylist();
						playList.move(fromIndex, fromIndex + moveBy);
					}
				}
				int showIndex = (moveBy<0)?selected[0].getIndexInPlaylist()-PLUS_LINES_VISABLE:selected[selected.length-1].getIndexInPlaylist()+PLUS_LINES_VISABLE;   
				createList(showIndex);
				firePlaylistChanged();
			}
			finally
			{
				playlistUpdateThread.restart();
			}
		}
	}
380913
function _listbox()
{
  at.write(VT_SAVE_CURSOR); // save

  at.write(CSI + (LAST + 2) + ';' + (AGAIN - 2) + 'r');
  at.moveto(1, LAST + 2);
  //at.write(CSI + 'J'); // erase down

  KEYS.forEach(function(line, idx) {
    if (selected === idx) at.reverse();
    var ll = line.substr(0, process.stdout.columns - 2);
    at.write(CSI + '4G' + ll + ESC + 'D');
    if (selected === idx) at.reset();
  });

  _resetscroll();
  at.write(VT_RESTORE_CURSOR); // restore
  at.reset();
}
587834
def on_tblFunctions1_itemSelectionChanged(self):
        
        # Clear the selection on the 2nd matrix
        self.parent.step_fc_functions2.tblFunctions2.clearContents()
        self.parent.step_fc_functions2.lblAvailableFunctions2.clear()
        self.parent.pbnNext.setEnabled(True)

        # Put a dot to the selected cell - note there is no way
        # to center an icon without using a custom ItemDelegate
        selection = self.tblFunctions1.selectedItems()
        selItem = (len(selection) == 1) and selection[0] or None
        for row in range(self.tblFunctions1.rowCount()):
            for column in range(self.tblFunctions1.columnCount()):
                item = self.tblFunctions1.item(row, column)
                item.setText((item == selItem) and '•' or '')
512227
function() {
				var oSelectedItem = this._getList().getSelectedItem();

				if (oSelectedItem) {
					this._toggleListItem(oSelectedItem, false);
					setTimeout(this._scrollPageTo.bind(this, 0, 0), 0);
				}
			}
829941
function (itemIndex) {
            // Don't do anything if the widget is disabled
            if (!this._data.disabled) {
                var newVal = !this._data.items[itemIndex].selected;
                this.setSelection(itemIndex, newVal);
                return newVal;
            } else {
                return this._data.items[itemIndex].selected;
            }
        }
543594
public void select(final boolean considerSelectableFlag) {
        mFastAdapter.recursive(new AdapterPredicate<Item>() {
            @Override
            public boolean apply(@NonNull IAdapter<Item> lastParentAdapter, int lastParentPosition, Item item, int position) {
                select(lastParentAdapter, item, -1, false, considerSelectableFlag);
                return false;
            }
        }, false);
        mFastAdapter.notifyDataSetChanged();
    }
555814
function () {
                for (var key in this.$selectionMap) {
                    if (this.$selectionMap.hasOwnProperty(key)) {
                        delete this.$selectionMap[key];
                    }
                }
                if (!this.$.selectedItems.isEmpty()) {
                    this.$.selectedItems.clear({silent: true});
                }
                this.$currentSelectionIndex = -1;

                this.trigger('selectionChanged');
            }
1014781
function( e ) {
		e && e.preventDefault();
		if( this.isMaximised === true ) {
			this.layoutManager._$minimiseItem( this );
		} else {
			this.layoutManager._$maximiseItem( this );
		}

		this.isMaximised = !this.isMaximised;
		this.emitBubblingEvent( 'stateChanged' );
	}
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,)
717198
private void attachAdapter() {
        if (listView != null) {
            if (adapter != null) {
                listView.setHasFixedSize(false);
                listView.setLayoutManager(layoutManager);
                listView.setAdapter(adapter);
                listView.setVisibility(adapter != null ? View.VISIBLE : View.GONE);
                adapter.setOnItemSelectedListener(listViewItemSelectedListener);
                initializeSelectionListener();
                initializeCheckedItems();
                adaptItemColor();
                adaptItemTypeface();
            } else {
                if (inflatedCustomView) {
                    getDialog().setView(null);
                }

                listView = null;
            }
        }
    }
1240474
def clear_selection
      return if @selected_indices.nil? || @selected_indices.empty?
      arr = @selected_indices.dup # to un highlight
      @selected_indices.clear
      arr.each {|i| @obj.fire_row_changed(i) }
      @selected_index = nil
      @old_selected_index = nil
      #  User should ignore first two params
      lse = ListSelectionEvent.new(0, arr.size, @obj, :CLEAR)
      @obj.fire_handler :LIST_SELECTION_EVENT, lse
      arr = nil
    end
1335115
public void dismiss() {
        mPopup.dismiss();
        removePromptView();
        mPopup.setContentView(null);
        mDropDownList = null;
        mHandler.removeCallbacks(mResizePopupRunnable);
    }
858922
public void onItemClick() {
        if (selected) {
            selected = false;
            getView().reset();

            if (onResetCommand != null) {
                onResetCommand.execute();
            }
        }
        else {
            selected = true;
            getView().select();

            if (onSelectCommand != null) {
                onSelectCommand.execute();
            }
        }
    }
568549
def _resetSelection(self, moveToTop=False):
        
        ancor, pos = self._qpart.selectedPosition
        dst = min(ancor, pos) if moveToTop else pos
        self._qpart.cursorPosition = dst
704359
function(e) {
			if (!e.target.classList.contains("treeTableRow")) return;
			if(this.setSelection(this.currentModel(), true, true)) {
				e.preventDefault();
			}
		}