@Override public void setLeadSelectionIndex(int index) { delegate.setLeadSelectionIndex(index); }
@Override public void setLeadSelectionIndex(int index) { delegate.setLeadSelectionIndex(index); }
public void setLeadSelectionIndex(final int pIndex) { mListSelectionModel.setLeadSelectionIndex(pIndex); }
@Override public void setLeadSelectionIndex(int index) { delegate.setLeadSelectionIndex(index); }
public void setLeadSelectionIndex(final int pIndex) { mListSelectionModel.setLeadSelectionIndex(pIndex); handleListSelection(); }
public void setLeadSelectionIndex(final int pIndex) { mListSelectionModel.setLeadSelectionIndex(pIndex); handleListSelection(); }
public void setLeadSelectionIndex(int index) { int uindex = constraint.unconstraint(index); delegate.setLeadSelectionIndex(uindex); }
public void run() { final JTable table = getTable(); table.getSelectionModel().setLeadSelectionIndex(row); table.getColumnModel().getSelectionModel().setLeadSelectionIndex(column); table.requestFocus(); } });
/** * */ private void clearViewSelection() { // TODO: JW - hmm... clearSelection doesn't reset the lead/anchor. Why not? viewSelection.clearSelection(); viewSelection.setAnchorSelectionIndex(-1); viewSelection.setLeadSelectionIndex(-1); }
/** * Устанавливает колонку содержащую фокус * @param col колонка с фокусом */ public void setFocusedColumn(int col){ int colcnt = getColumnCount(); if( col<0 )return; if( col>=colcnt )return; getColumnModel().getSelectionModel().setLeadSelectionIndex(col); } //</editor-fold>
/** * @see AbstractReadableWritableProperty#setValue(Object) */ @Override public void setValue(Integer value) { Integer effectiveValue = value; if (effectiveValue == null) { effectiveValue = -1; } if (!isNotifyingListeners()) { if (updatingFromComponent) { Integer oldValue = this.value; this.value = effectiveValue; maybeNotifyListeners(oldValue, this.value); } else if (effectiveValue < 0) { table.getSelectionModel().clearSelection(); } else { table.getSelectionModel().setLeadSelectionIndex(effectiveValue); table.getSelectionModel().setSelectionInterval(effectiveValue, effectiveValue); } } } }
@Override public void run() { int row = getCache().indexOf(val); if( row<0 )return; row = mapRowToOutside(row); if( row<0 )return; /*if( getTable().getColumnSelectionAllowed() ){*/ getTable().getColumnModel().getSelectionModel().addSelectionInterval(0, 0); getTable().getColumnModel().getSelectionModel().setLeadSelectionIndex(0); /*}*/ getTable().getSelectionModel().addSelectionInterval(row, row); getTable().getSelectionModel().setLeadSelectionIndex(row); }};
public void setTo(ListSelectionModel sm) { sm.clearSelection(); sm.setSelectionMode(selectionMode); for (int[] itv : intervals) { sm.addSelectionInterval(itv[0], itv[1]); } sm.setAnchorSelectionIndex(anchor); sm.setLeadSelectionIndex(lead); } }
@Override public void mousePressed(MouseEvent e) { int index = locationToIndex(e.getPoint()); Rectangle rect = getCellBounds(index, index); if (!rect.contains(e.getPoint())) { clearSelection(); getSelectionModel().setAnchorSelectionIndex(-1); getSelectionModel().setLeadSelectionIndex(-1); setFocusable(false); } else { setFocusable(true); } }
private void resetListSelection() { ListSelectionModel selectionModel = list.getSelectionModel(); selectionModel.setValueIsAdjusting(true); selectionModel.clearSelection(); selectionModel.setAnchorSelectionIndex(-1); selectionModel.setLeadSelectionIndex(-1); selectionModel.setValueIsAdjusting(false); }
private void resetListSelection() { ListSelectionModel selectionModel = list.getSelectionModel(); selectionModel.setValueIsAdjusting(true); selectionModel.clearSelection(); selectionModel.setAnchorSelectionIndex(-1); selectionModel.setLeadSelectionIndex(-1); selectionModel.setValueIsAdjusting(false); }
private void clearSelectionAndLeadAnchor() { selectionModel.setValueIsAdjusting(true); ressourceModel.getSelectionModel().setValueIsAdjusting(true); clearSelection(); selectionModel.setAnchorSelectionIndex(-1); selectionModel.setLeadSelectionIndex(-1); ressourceModel.getSelectionModel().setAnchorSelectionIndex(-1); ressourceModel.getSelectionModel().setLeadSelectionIndex(-1); selectionModel.setValueIsAdjusting(false); ressourceModel.getSelectionModel().setValueIsAdjusting(false); }
/** * Trying to hack around #172-swingx: lead/anchor of row selection model is * not adjusted to valid (not even model indices!) in the usual * clearSelection after dataChanged/structureChanged. * * Note: as of jdk1.5U6 the anchor/lead of the view selectionModel is * unconditionally set to -1 after data/structureChanged. * * @param e */ private void hackLeadAnchor(TableModelEvent e) { int lead = getSelectionModel().getLeadSelectionIndex(); int anchor = getSelectionModel().getAnchorSelectionIndex(); int lastRow = getModel().getRowCount() - 1; if ((lead > lastRow) || (anchor > lastRow)) { lead = lastRow; getSelectionModel().setAnchorSelectionIndex(lead); getSelectionModel().setLeadSelectionIndex(lead); } }
private void resetSelection() { if (getList() == null) { return; } getList().getSelectionModel().setAnchorSelectionIndex(-1); // has to call setAnchor first getList().getSelectionModel().setLeadSelectionIndex(-1); getList().getSelectionModel().clearSelection(); }
/** * Указывает строку содержащую фокус * @param row строка * @param clearSelection очистить список выбранных строк * @param addSelection добавить строку в писок выделенных */ public void setFocusedRow(int row,boolean clearSelection,boolean addSelection){ if( row<0 )return; int rc = getRowCount(); if( row>=rc )return; if( clearSelection ){ getSelectionModel().clearSelection(); getColumnModel().getSelectionModel().clearSelection(); } if( addSelection ){ getSelectionModel().addSelectionInterval(row, row); getColumnModel().getSelectionModel().addSelectionInterval(0, 0); } getColumnModel().getSelectionModel().setLeadSelectionIndex(0); getSelectionModel().setLeadSelectionIndex(row); } //</editor-fold>