/** * Converts the selection to model coordinates. This is used when * the model changes or the sorter changes. */ private int[] convertSelectionToModel(RowSorterEvent e) { int[] selection = list.getSelectedIndices(); for (int i = selection.length - 1; i >= 0; i--) { selection[i] = convertRowIndexToModel(e, selection[i]); } return selection; }
/** * Converts the selection to model coordinates. This is used when * the model changes or the sorter changes. */ private int[] convertSelectionToModel(RowSorterEvent e) { int[] selection = list.getSelectedIndices(); for (int i = selection.length - 1; i >= 0; i--) { selection[i] = convertRowIndexToModel(e, selection[i]); } return selection; }
/** * Converts the selection to model coordinates. This is used when * the model changes or the sorter changes. */ private int[] convertSelectionToModel(RowSorterEvent e) { int[] selection = list.getSelectedIndices(); for (int i = selection.length - 1; i >= 0; i--) { selection[i] = convertRowIndexToModel(e, selection[i]); } return selection; }
/** * Converts the selection to model coordinates. This is used when * the model changes or the sorter changes. */ private int[] convertSelectionToModel(RowSorterEvent e) { int[] selection = list.getSelectedIndices(); for (int i = selection.length - 1; i >= 0; i--) { selection[i] = convertRowIndexToModel(e, selection[i]); } return selection; }
/** * Returns an array of all the selected values, in increasing order based * on their indices in the list and taking into account sourting and filtering. * * @return the selected values, or an empty array if nothing is selected * @see #isSelectedIndex * @see #getModel * @see #addListSelectionListener */ @Override public Object[] getSelectedValues() { int[] selectedIndexes = getSelectedIndices(); Object[] selectedValues = new Object[selectedIndexes.length]; for (int i = 0; i < selectedIndexes.length; i++) { selectedValues[i] = getElementAt(selectedIndexes[i]); } return selectedValues; }
/** * Returns an array of all the selected values, in increasing order based * on their indices in the list and taking into account sourting and filtering. * * @return the selected values, or an empty array if nothing is selected * @see #isSelectedIndex * @see #getModel * @see #addListSelectionListener */ @Override public Object[] getSelectedValues() { int[] selectedIndexes = getSelectedIndices(); Object[] selectedValues = new Object[selectedIndexes.length]; for (int i = 0; i < selectedIndexes.length; i++) { selectedValues[i] = getElementAt(selectedIndexes[i]); } return selectedValues; }
/** * Returns an array of all the selected values, in increasing order based * on their indices in the list and taking into account sourting and filtering. * * @return the selected values, or an empty array if nothing is selected * @see #isSelectedIndex * @see #getModel * @see #addListSelectionListener */ @Override public Object[] getSelectedValues() { int[] selectedIndexes = getSelectedIndices(); Object[] selectedValues = new Object[selectedIndexes.length]; for (int i = 0; i < selectedIndexes.length; i++) { selectedValues[i] = getElementAt(selectedIndexes[i]); } return selectedValues; }
/** * Returns an array of all the selected values, in increasing order based * on their indices in the list and taking into account sourting and filtering. * * @return the selected values, or an empty array if nothing is selected * @see #isSelectedIndex * @see #getModel * @see #addListSelectionListener */ @Override public Object[] getSelectedValues() { int[] selectedIndexes = getSelectedIndices(); Object[] selectedValues = new Object[selectedIndexes.length]; for (int i = 0; i < selectedIndexes.length; i++) { selectedValues[i] = getElementAt(selectedIndexes[i]); } return selectedValues; }
@Override protected boolean validateInput() { // Either there is only one matching row, or there is one selected row. return list.getRowSorter().getViewRowCount() == 1 || list.getSelectedIndices().length == 1; }