{
// Note that the data/cell address is constant,
// no matter where the cell appears onscreen.
- return col == 1 || col == 2;
+ // !isPDBID(row, col) ensures the PDB_Id cell is never editable as it
+ // serves as a unique id for each row.
+ return (col == 1 || col == 2) && !isPDBID(row, col);
}
+ /**
+ * Determines whether the data in a given cell is a PDB ID.
+ *
+ * @param row
+ * @param col
+ * @return
+ */
+
+ public boolean isPDBID(int row, int col)
+ {
+ boolean matched = false;
+ String name = getValueAt(row, 0).toString();
+ PDBDocField pdbField = map.get(name);
+ if (pdbField == PDBDocField.PDB_ID)
+ {
+ matched = true;
+ }
+ return matched;
+ }
+
/*
* Don't need to implement this method unless your table's data can change.
*/