int threshold = Cache.getDefault("THRESHOLD_WARN_UNIPROT_FETCH",
THRESHOLD_WARN_UNIPROT_FETCH_NEEDED);
Console.debug("Using Uniprot fetch threshold of " + threshold);
+ boolean runThread = false;
if (ignoreGui || seqsWithoutSourceDBRef.size() < threshold)
{
+ runThread = true;
+ }
+ // need cancel and no to result in the discoverPDB action - mocked is
+ // 'cancel' TODO: mock should be OK
+ if (!runThread)
+ {
+ int answer = JvOptionPane.showOptionDialog(this,
+
+ MessageManager.formatMessage(
+ "label.fetch_references_for_3dbeacons",
+ seqsWithoutSourceDBRef.size()),
+
+ MessageManager.getString("label.3dbeacons"),
+
+ JvOptionPane.YES_NO_OPTION,
+
+ JvOptionPane.PLAIN_MESSAGE,
+
+ null,
+
+ new Object[]
+ { MessageManager.getString("action.ok"),
+ MessageManager.getString("action.cancel") },
+
+ MessageManager.getString("action.ok")
+
+ );
+ runThread = (answer == JvOptionPane.OK_OPTION);
+ }
+ if (runThread)
+ {
Executors.defaultThreadFactory().newThread(discoverCanonicalDBrefs)
.start();
return;
}
- // need cancel and no to result in the discoverPDB action - mocked is
- // 'cancel' TODO: mock should be OK
- JvOptionPane.newOptionDialog(this)
- .setResponseHandler(JvOptionPane.OK_OPTION,
- discoverCanonicalDBrefs)
- .setResponseHandler(JvOptionPane.CANCEL_OPTION, revertview)
- .setResponseHandler(JvOptionPane.NO_OPTION, revertview)
- .showDialog(
- MessageManager.formatMessage(
- "label.fetch_references_for_3dbeacons",
- seqsWithoutSourceDBRef.size()),
- MessageManager.getString("label.3dbeacons"),
- JvOptionPane.YES_NO_OPTION, JvOptionPane.PLAIN_MESSAGE,
- null, new Object[]
- { MessageManager.getString("action.ok"),
- MessageManager.getString("action.cancel") },
- MessageManager.getString("action.ok"));
+ else
+ {
+ revertview.run();
+ }
}
/**