import javax.swing.JFileChooser;
import javax.swing.JInternalFrame;
import javax.swing.JPanel;
+import javax.swing.JTabbedPane;
import javax.swing.JTextField;
import javax.swing.ListSelectionModel;
import javax.swing.RowFilter;
import jalview.util.FileUtils;
import ext.edu.ucsf.rbvi.strucviz2.StructureManager;
import jalview.analysis.AnnotationSorter.SequenceAnnotationOrder;
-import jalview.bin.ApplicationSingletonProvider;
import jalview.bin.ApplicationSingletonProvider.ApplicationSingletonI;
import jalview.bin.Cache;
import jalview.bin.Console;
import jalview.util.Platform;
import jalview.util.UrlConstants;
import jalview.ws.sifts.SiftsSettings;
+import jalview.ws2.client.api.WebServiceDiscovererI;
+import jalview.ws2.client.ebi.JobDispatcherWSDiscoverer;
+import jalview.ws2.client.jpred4.JPred4WSDiscoverer;
+import jalview.ws2.client.slivka.SlivkaWSDiscoverer;
/**
* DOCUMENT ME!
private WsPreferences wsPrefs;
- private SlivkaPreferences slivkaPrefs;
private OptionsParam promptEachTimeOpt = new OptionsParam(
MessageManager.getString("label.prompt_each_time"),
"Prompt each time");
wsTab.add(wsPrefs, BorderLayout.CENTER);
}
- slivkaPrefs = new SlivkaPreferences();
- slivkaTab.add(slivkaPrefs, BorderLayout.CENTER);
-
+ if (Cache.getDefault("SHOW_SLIVKA_SERVICES", true))
+ addWebServiceTab(tabbedPane, SlivkaWSDiscoverer.getInstance());
+ if (Cache.getDefault("SHOW_EBI_SERVICES", true))
+ addWebServiceTab(tabbedPane, JobDispatcherWSDiscoverer.getInstance());
+ if (Cache.getDefault("SHOW_JPRED4_SERVICES", true))
+ addWebServiceTab(tabbedPane, JPred4WSDiscoverer.getInstance());
+
int width = 500, height = 450;
if (Platform.isAMacAndNotJS())
{
loadLastSavedBackupsOptions();
}
+
+ private void addWebServiceTab(JTabbedPane tabs, WebServiceDiscovererI discoverer)
+ {
+ String name = discoverer.getName();
+ JPanel tab = new JPanel();
+ tab.setLayout(new BorderLayout());
+ tab.add(new WS2PreferencesPanel(discoverer), BorderLayout.CENTER);
+ tabs.add(tab, name + " services");
+ }
+
/**
* A helper method that sets the items and initial selection in a character
* rendering option list (Prompt each time/Lineart/Text)
import jalview.ws2.client.slivka.SlivkaWSDiscoverer;
@SuppressWarnings("serial")
-public class SlivkaPreferences extends JPanel
+public class WS2PreferencesPanel extends JPanel
{
{
setLayout(new BoxLayout(this, BoxLayout.PAGE_AXIS));
final int i = urlListTable.getSelectedRow();
if (i >= 0)
{
- urls.remove(i);
- statuses.remove(i);
+ URL url = urls.remove(i);
+ statuses.remove(url);
urlTableModel.fireTableRowsDeleted(i, i);
discoverer.setUrls(urls);
}
private void moveTableRow(int fromIndex, int toIndex)
{
URL url = urls.get(fromIndex);
- int status = statuses.get(fromIndex);
urls.set(fromIndex, urls.get(toIndex));
urls.set(toIndex, url);
if (urlListTable.getSelectedRow() == fromIndex)
add(progressBar);
}
- SlivkaPreferences()
+ WS2PreferencesPanel(WebServiceDiscovererI discoverer)
{
// Initial URLs loading
- discoverer = SlivkaWSDiscoverer.getInstance();
+ this.discoverer = discoverer;
urls.addAll(discoverer.getUrls());
for (URL url : urls)
{
*/
protected JPanel wsTab = new JPanel();
- protected JPanel slivkaTab = new JPanel();
/*
* Backups tab components
* a lot of these are member variables instead of local variables only so that they
protected JTextArea backupfilesExampleLabel = new JTextArea();
- private final JTabbedPane tabbedPane = new JTabbedPane();
+ protected final JTabbedPane tabbedPane = new JTabbedPane();
private JLabel messageLabel = new JLabel("", JLabel.CENTER);
tabbedPane.add(initStartupTab(),
MessageManager.getString("label.startup"));
wsTab.setLayout(new BorderLayout());
- tabbedPane.add(wsTab, MessageManager.getString("label.web_services"));
+ tabbedPane.add(wsTab, "JABAWS " + MessageManager.getString("label.web_services"));
}
-
- slivkaTab.setLayout(new BorderLayout());
- tabbedPane.add(slivkaTab, "Slivka Services");
/*
* Handler to validate a tab before leaving it - currently only for