class PTable extends JBTable implements DataProvider, DeleteProvider, CutProvider, CopyProvider, PasteProvider {

  public void restoreSelection(int previousSelectedRow, @Nullable PTableItem previousSelectedItem) {
    int selectedRow = 0;
    if (previousSelectedItem != null) {
      PTableItem item =
        previousSelectedRow >= 0 && previousSelectedRow < getRowCount() ? (PTableItem)getValueAt(previousSelectedRow, 0) : null;
      if (Objects.equals(item, previousSelectedItem)) {
        selectedRow = previousSelectedRow;
      }
      else {
        for (int row = 0; row < getRowCount(); row++) {
          item = (PTableItem)getValueAt(row, 0);
          if (item.equals(previousSelectedItem)) {
            selectedRow = row;
            break;
          }
        }
      }
    }
    if (selectedRow < getRowCount()) {
      addRowSelectionInterval(selectedRow, selectedRow);
    }
  }

  public  PTable(@NotNull PTableModel model);
  public  PTable(@NotNull PTableModel model, @NotNull CopyPasteManager copyPasteManager);

}