- MCview.PDBfile pdbfile = new MCview.PDBfile(choice, protocol);
-
- if (pdbfile.id == null)
- {
- String reply = null;
-
- if (prompt)
- {
- reply = JOptionPane
- .showInternalInputDialog(
- Desktop.desktop,
- MessageManager.getString("label.couldnt_find_pdb_id_in_file"),
- MessageManager.getString("label.no_pdb_id_in_file"), JOptionPane.QUESTION_MESSAGE);
- }
- if (reply == null)
- {
- return null;
- }
-
- entry.setId(reply);
- }
- else
- {
- entry.setId(pdbfile.id);
- }
- } catch (java.io.IOException ex)
+ // stacktrace already thrown so just return
+ return null;
+ }
+ String id = pdbfile.getId();
+ if (id == null && (id = (prompt
+ ? JvOptionPane.showInternalInputDialog(Desktop.getDesktopPane(),
+ MessageManager
+ .getString("label.couldnt_find_pdb_id_in_file"),
+ MessageManager.getString("label.no_pdb_id_in_file"),
+ JvOptionPane.QUESTION_MESSAGE)
+ : null)) == null)