}
public void actionPerformed(ActionEvent actionEvent) {
if (selectionModel.getSelected().size() != 1)
return;
final BibtexEntry entry = selectionModel.getSelected().get(0);
String bibtexKey = entry.getCiteKey();
if (bibtexKey == null) {
int answer = JOptionPane.showConfirmDialog(frame, Globals
.lang("This entry has no BibTeX key. Generate key now?"), Globals
.lang("Download file"), JOptionPane.OK_CANCEL_OPTION,
JOptionPane.QUESTION_MESSAGE);
if (answer == JOptionPane.OK_OPTION) {
generateKeySelectedEntry();
bibtexKey = entry.getCiteKey();
} else
return; // Can't go on without the bibtex key.
}
final FileListTableModel model = new FileListTableModel();
String oldVal = entry.getField(GUIGlobals.FILE_FIELD);
if (oldVal != null)
model.setContent(oldVal);
// We have a static utility method for searching for all relevant
// links:
JDialog diag = new JDialog(ImportInspectionDialog.this, true);
FileListEditor.autoSetLinks(entry, model, metaData, new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (e.getID() > 0) {
entries.getReadWriteLock().writeLock().lock();
entry.setField(GUIGlobals.FILE_FIELD, model.getStringRepresentation());
entries.getReadWriteLock().writeLock().unlock();
glTable.repaint();
}
}
}, diag);