@Override public void removeSelectionInterval(int index0, int index1) { if (allowDeselect) { super.removeSelectionInterval(index0, index1); } }
protected void removeSelectionIntervalWithoutFire(int index0, int index1) { if (index0 > index1) { int tmp = index1; index1 = index0; index0 = tmp; } for (int i = index0; i <= index1; i++) { if (selectedValues.size() > i && i != -1) { selectedValues.remove(i); } } super.removeSelectionInterval(index0, index1); }
protected void removeSelectionIntervalWithoutFire(int index0, int index1) { if (index0 > index1) { int tmp = index1; index1 = index0; index0 = tmp; } for (int i=index0;i<=index1;i++) { if (selectedValues.size() > i && i != -1) { selectedValues.remove(i); } } super.removeSelectionInterval(index0, index1); }
public void removeSelectionInterval(int index0, int index1) { logger.info("removeSelectionInterval"); super.removeSelectionInterval(index0, index1); aliSelectionModel.removeSequenceSelection(index0, index1); //aliSelectionModel.fireSelectionChanged(); }
public void setSelectionInterval(int index0, int index1) { if(isSelectedIndex(index0)) { super.removeSelectionInterval(index0, index1); } else { super.setSelectionInterval(index0, index1); } } });
public void setSelectionInterval(int index0, int index1) { if(isSelectedIndex(index0)) { super.removeSelectionInterval(index0, index1); } else { super.setSelectionInterval(index0, index1); } } });
public void setSelectionInterval(int index0, int index1) { if(isSelectedIndex(index0)) { super.removeSelectionInterval(index0, index1); } else { super.setSelectionInterval(index0, index1); } } });
public void setSelectionInterval(int index0, int index1) { if(isSelectedIndex(index0)) { super.removeSelectionInterval(index0, index1); } else { super.setSelectionInterval(index0, index1); } } });
JTable table = new JTable(); // your table instance TableModel dataModel = new DefaultTableModel(); // table model DefaultListSelectionModel selectionModel = new DefaultListSelectionModel(); //table selection model table.setModel(dataModel); table.setSelectionModel(selectionModel); int desiredRow = 0; // row which you want to deselect selectionModel.removeSelectionInterval(desiredRow, desiredRow); // Removing selection for desired row
if (index0==index1) { if (isSelectedIndex(index0)) { removeSelectionInterval(index0, index0); return; if (index0==index1) { if (isSelectedIndex(index0)) { removeSelectionInterval(index0, index0); return;
@Override public void removeSelectionInterval(int index0, int index1) { boolean adjusting = getValueIsAdjusting(); setValueIsAdjusting(true); try { if (!unselectAll(index0, index1)) { if (getAllEntryIndex() >= 0) { super.removeSelectionInterval(getAllEntryIndex(), getAllEntryIndex()); } super.removeSelectionInterval(index0, index1); } } finally { setValueIsAdjusting(adjusting); } } }
protected void updateFromDja() { if (isInternalUpdate_) { return; } isInternalUpdate_ = true; for (int i = getSize() - 1; i >= 0; i--) { boolean selected = isSelectedInDjaVector(i); if (selected && !model_.isSelectedIndex(i)) { model_.addSelectionInterval(i, i); } else if (!selected && model_.isSelectedIndex(i)) { model_.removeSelectionInterval(i, i); } } isInternalUpdate_ = false; }
@Override public void setSelectionInterval(int index0, int index1) { // Toggle only one element while the user is dragging the mouse if (!gestureStarted) { if (isSelectedIndex(index0)) { super.removeSelectionInterval(index0, index1); } else { if (getSelectionMode() == SINGLE_SELECTION) { super.setSelectionInterval(index0, index1); } else { super.addSelectionInterval(index0, index1); } } } // Disable toggling till the adjusting is over, or keep it // enabled in case setSelectionInterval was called directly. gestureStarted = getValueIsAdjusting(); }
/** * Respond to a change in the view selection by updating the view selection. * * @param firstIndex the first view index that changed, inclusive * @param lastIndex the last view index that changed, inclusive */ private void mapTowardsModel(int firstIndex, int lastIndex) { int safeFirstIndex = Math.max(0, firstIndex); // Fix for #855-swingx: JXList AIOOB on select after remove/add data items int safeLastIndex = getSafeLastIndex(lastIndex); for (int i = safeFirstIndex; i <= safeLastIndex; i++) { int modelIndex = convertToModel(i); if (viewSelection.isSelectedIndex(i)) { modelSelection.addSelectionInterval(modelIndex, modelIndex); } else { modelSelection.removeSelectionInterval(modelIndex, modelIndex); } } int lead = viewSelection.getLeadSelectionIndex(); if (lead >= 0) { modelSelection.moveLeadSelectionIndex(convertToModel(lead)); } }
@Override public void removeSelectionInterval(int index0, int index1) { super.removeSelectionInterval(index0, index1); int contentSize = informer.getContentSize(); InsetPart part0 = inset.toInnerSpace(index0, contentSize); InsetPart part1 = inset.toInnerSpace(index1, contentSize); if (part0.getKind() == InsetPart.PartKind.CONTENT || part1.getKind() == InsetPart.PartKind.CONTENT || (part0.getKind() == InsetPart.PartKind.BEFORE && part1.getKind() == InsetPart.PartKind.AFTER)) { if (part0.getKind() == InsetPart.PartKind.BEFORE) { index0 = 0; } else { index0 = part0.getValue(); } if (part1.getKind() == InsetPart.PartKind.AFTER) { index1 = contentSize - 1; } else { index1 = part1.getValue(); } delegate.removeSelectionInterval(index0, index1); }//else ... }