private Note getSelectedNote() {
   return tableModel.getNote(table.getSelectedRow());
 }
 private void updateControls() {
   Note note = tableModel.getNote(table.getSelectedRow());
   deleteNoteButton.setEnabled(note != null && note.isCustom());
 }