void updateWsMenuConfig(boolean old) {
if (old) {
wsUrls = (oldUrls==null) ? null : new Vector(oldUrls);
+ } else {
+
}
Cache.setProperty("SHOW_ENFIN_SERVICES", Boolean.valueOf(old ? oldEnfin : enableEnfinServices.isSelected()).toString());
Cache.setProperty("SHOW_JWS1_SERVICES", Boolean.valueOf(old ? oldJws1 : enableJws1Services.isSelected()).toString());
}
if (valid && resp==JOptionPane.OK_OPTION)
{
- int validate = JOptionPane.showInternalConfirmDialog(Desktop.desktop, null, "Validate JabaWS Server ?\n(Look in console output for results)", JOptionPane.YES_NO_OPTION);
+ int validate = JOptionPane.showInternalConfirmDialog(Desktop.desktop, "Validate JabaWS Server ?\n(Look in console output for results)", "Test Server?", JOptionPane.YES_NO_OPTION);
if (validate == JOptionPane.OK_OPTION)
{
if (jalview.ws.jws2.Jws2Discoverer.testServiceUrl(foo))
{
return foo.toString();
+ } else {
+ JOptionPane.showInternalMessageDialog(Desktop.desktop, "Service did not pass validation.\nCheck the Jalview Console for more details.");
}
+ } else {
+ // just return the URL anyway
+ return foo.toString();
}
}
return initUrl;
}).start();
}
-
+ /**
+ *
+ * @param showProgress show progress in dialog or on desktop
+ */
protected void refreshWsMenu(boolean showProgress)
{
if (showProgress)
public void run()
{
- Desktop.instance.startServiceDiscovery(false);
+ long ct = System.currentTimeMillis();
+ Desktop.instance.setProgressBar("Refreshing Web Service Menus", ct);
+ Desktop.instance.startServiceDiscovery(true);
+ Desktop.instance.setProgressBar("Refreshing Web Service Menus", ct);
}
}).start();
updateList();
}
protected void ok_ActionPerformed(ActionEvent e) {
- updateWsMenuConfig(false);
- // todo: work out if the ws list needs updating ?
- updateServiceList();
- refreshWsMenu(false);
+ // update everything regardless.
+ updateAndRefreshWsMenuConfig(false);
+ }
+ public void updateAndRefreshWsMenuConfig(final boolean showProgressInDialog)
+ {
+ new Thread(new Runnable() {
+
+ public void run()
+ {
+ updateWsMenuConfig(false);
+ refreshWsMenu(showProgressInDialog);
+ }
+ }).start();
+
}
}