@Override public void valueChanged(ListSelectionEvent e) { defaultListSelectionModel.clearSelection(); } });
@Override public void clearSelection() { if (allowDeselect) { super.clearSelection(); } }
@Override public void clearSelection() { super.clearSelection(); delegate.clearSelection(); }
@Override public void clearSelection() { Collection<B> oldValue = Lists.newArrayList(selectedValues); selectedValues.clear(); super.clearSelection(); fireSelectionRemoved(oldValue); firePropertyChange(PROPERTY_SELECTED_VALUE, oldValue, selectedValues); }
@Override public void clearSelection() { Collection<B> oldValue = Lists.newArrayList(selectedValues); selectedValues.clear(); super.clearSelection(); fireSelectionRemoved(oldValue); firePropertyChange(PROPERTY_SELECTED_VALUE, oldValue, selectedValues); }
public void clearModelSelection() { if(modelSelection == null) return; // TODO: JW: need to reset anchor/lead? modelSelection.clearSelection(); modelSelection.setAnchorSelectionIndex(-1); modelSelection.setLeadSelectionIndex(-1); }
private void onMoveDown() { int[] selRows = _panel.tblOrder.getSelectedRows(); if (null == selRows || 0 == selRows.length) { return; } SortedColumnsTableModel model = (SortedColumnsTableModel) _panel.tblOrder.getModel(); int[] newSelRows = model.moveDown(selRows); DefaultListSelectionModel selectionModel = (DefaultListSelectionModel) _panel.tblOrder.getSelectionModel(); selectionModel.clearSelection(); for (int newSelRow : newSelRows) { selectionModel.addSelectionInterval(newSelRow, newSelRow); } _panel.tblOrder.scrollRectToVisible(_panel.tblOrder.getCellRect(newSelRows[newSelRows.length-1], 0, false)); }
private void onMoveUp() { int[] selRows = _panel.tblOrder.getSelectedRows(); if (null == selRows || 0 == selRows.length) { return; } SortedColumnsTableModel model = (SortedColumnsTableModel) _panel.tblOrder.getModel(); int[] newSelRows = model.moveUp(selRows); DefaultListSelectionModel selectionModel = (DefaultListSelectionModel) _panel.tblOrder.getSelectionModel(); selectionModel.clearSelection(); for (int newSelRow : newSelRows) { selectionModel.addSelectionInterval(newSelRow, newSelRow); } _panel.tblOrder.scrollRectToVisible(_panel.tblOrder.getCellRect(newSelRows[0], 0, false)); }
/** Impl of selection policy. Tasks which are not in sleep mode and * user initiated are preferred for selection. */ void updateSelection () { // don't touch selection if explicit if (explicit != null) { return; } InternalHandle oldSelected = getSelectedHandle(); // keep selection if possible if (oldSelected != null && !oldSelected.isInSleepMode()) { return; } // select last added that is not in sleep mode and preferrably userInitiated InternalHandle toSelect = null; synchronized (model) { for (int i = 0; i < model.size(); i++) { InternalHandle curHandle = (InternalHandle) model.getElementAt(i); if (getSelectionRating(curHandle) >= getSelectionRating(toSelect)) { toSelect = curHandle; } } if (toSelect != null) { selectionModel.setSelectionInterval(model.indexOf(toSelect), model.indexOf(toSelect)); } else { selectionModel.clearSelection(); } } }