@NotNull public List<T> getSelectedElements() { final List<T> elements = new ArrayList<T>(); final int[] selectedRows = myTable.getSelectedRows(); for (int selectedRow : selectedRows) { if (selectedRow < 0) { continue; } elements.add(myTableModel.getElementAt(selectedRow)); } return elements; }
@NotNull public List<T> getMarkedElements() { final int count = myTableModel.getRowCount(); List<T> elements = new ArrayList<T>(); for (int idx = 0; idx < count; idx++) { final T element = myTableModel.getElementAt(idx); if (myTableModel.isElementMarked(idx)) { elements.add(element); } } return elements; }
public T getElementAt(int row) { return myTableModel.getElementAt(row); }
@Nullable public T getSelectedElement() { final int selectedRow = getSelectedElementRow(); return selectedRow < 0 ? null : myTableModel.getElementAt(selectedRow); }