X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FWsPreferences.java;fp=src%2Fjalview%2Fgui%2FWsPreferences.java;h=cf88718fe166bf659f43fd2f54b0da1dadf32ebe;hb=586ade46bdcd05ff028a1cff82c3c527326d28ec;hp=51b40dd63ad709fb1346db8f94c6c80600f7cf94;hpb=adcef27f5747b4e70e89a56c3735bc3afb8ce9bf;p=jalview.git diff --git a/src/jalview/gui/WsPreferences.java b/src/jalview/gui/WsPreferences.java index 51b40dd..cf88718 100644 --- a/src/jalview/gui/WsPreferences.java +++ b/src/jalview/gui/WsPreferences.java @@ -20,12 +20,6 @@ */ package jalview.gui; -import jalview.bin.Cache; -import jalview.jbgui.GWsPreferences; -import jalview.util.MessageManager; -import jalview.ws.WSDiscovererI; -import jalview.ws.jws2.Jws2Discoverer; -import jalview.ws.rest.RestServiceDescription; import java.awt.BorderLayout; import java.awt.Color; @@ -45,6 +39,13 @@ import javax.swing.JTextField; import javax.swing.table.AbstractTableModel; import javax.swing.table.TableCellRenderer; +import jalview.bin.Cache; +import jalview.jbgui.GWsPreferences; +import jalview.util.MessageManager; +import jalview.ws.WSDiscovererI; +import jalview.ws.jws2.Jws2Discoverer; +import jalview.ws.rest.RestServiceDescription; + public class WsPreferences extends GWsPreferences { @@ -66,7 +67,7 @@ public class WsPreferences extends GWsPreferences private void initFromPreferences() { - wsUrls = Jws2Discoverer.getDiscoverer().getServiceUrls(); + wsUrls = Jws2Discoverer.getInstance().getServiceUrls(); if (!wsUrls.isEmpty()) { oldUrls = new Vector(wsUrls); @@ -123,7 +124,7 @@ public class WsPreferences extends GWsPreferences int r = 0; for (String url : wsUrls) { - int status = Jws2Discoverer.getDiscoverer().getServerStatusFor(url); + int status = Jws2Discoverer.getInstance().getServerStatusFor(url); tdat[r][1] = Integer.valueOf(status); tdat[r++][0] = url; } @@ -243,7 +244,7 @@ public class WsPreferences extends GWsPreferences private void updateServiceList() { - Jws2Discoverer.getDiscoverer().setServiceUrls(wsUrls); + Jws2Discoverer.getInstance().setServiceUrls(wsUrls); } private void updateRsbsServiceList() @@ -456,7 +457,7 @@ public class WsPreferences extends GWsPreferences boolean valid = false; int resp = JvOptionPane.CANCEL_OPTION; while (!valid && (resp = JvOptionPane.showInternalConfirmDialog( - Desktop.desktop, panel, title, + Desktop.getDesktopPane(), panel, title, JvOptionPane.OK_CANCEL_OPTION)) == JvOptionPane.OK_OPTION) { try @@ -474,26 +475,26 @@ public class WsPreferences extends GWsPreferences } catch (Exception e) { valid = false; - JvOptionPane.showInternalMessageDialog(Desktop.desktop, + JvOptionPane.showInternalMessageDialog(Desktop.getDesktopPane(), MessageManager.getString("label.invalid_url")); } } if (valid && resp == JvOptionPane.OK_OPTION) { - int validate = JvOptionPane.showInternalConfirmDialog(Desktop.desktop, + int validate = JvOptionPane.showInternalConfirmDialog(Desktop.getDesktopPane(), MessageManager.getString("info.validate_jabaws_server"), MessageManager.getString("label.test_server"), JvOptionPane.YES_NO_OPTION); if (validate == JvOptionPane.OK_OPTION) { - if (Jws2Discoverer.getDiscoverer().testServiceUrl(foo)) + if (Jws2Discoverer.getInstance().testServiceUrl(foo)) { return foo.toString(); } else { - int opt = JvOptionPane.showInternalOptionDialog(Desktop.desktop, + int opt = JvOptionPane.showInternalOptionDialog(Desktop.getDesktopPane(), "The Server '" + foo.toString() + "' failed validation,\ndo you want to add it anyway? ", "Server Validation Failed", JvOptionPane.YES_NO_OPTION, @@ -504,7 +505,7 @@ public class WsPreferences extends GWsPreferences } else { - JvOptionPane.showInternalMessageDialog(Desktop.desktop, + JvOptionPane.showInternalMessageDialog(Desktop.getDesktopPane(), MessageManager.getString( "warn.server_didnt_pass_validation")); } @@ -597,7 +598,7 @@ public class WsPreferences extends GWsPreferences if (lastrefresh != update) { lastrefresh = update; - Desktop.instance.startServiceDiscovery(true); // wait around for all + Desktop.getInstance().startServiceDiscovery(true); // wait around for all // threads to complete updateList(); @@ -618,15 +619,15 @@ public class WsPreferences extends GWsPreferences public void run() { long ct = System.currentTimeMillis(); - Desktop.instance.setProgressBar(MessageManager + Desktop.getInstance().setProgressBar(MessageManager .getString("status.refreshing_web_service_menus"), ct); if (lastrefresh != update) { lastrefresh = update; - Desktop.instance.startServiceDiscovery(true); + Desktop.getInstance().startServiceDiscovery(true); updateList(); } - Desktop.instance.setProgressBar(null, ct); + Desktop.getInstance().setProgressBar(null, ct); } }).start(); @@ -648,8 +649,8 @@ public class WsPreferences extends GWsPreferences @Override protected void resetWs_actionPerformed(ActionEvent e) { - Jws2Discoverer.getDiscoverer().setServiceUrls(null); - List nwsUrls = Jws2Discoverer.getDiscoverer().getServiceUrls(); + Jws2Discoverer.getInstance().setServiceUrls(null); + List nwsUrls = Jws2Discoverer.getInstance().getServiceUrls(); if (!wsUrls.equals(nwsUrls)) { update++;