package jalview.gui;
import static jalview.util.UrlConstants.EMBLEBI_STRING;
+import static jalview.util.UrlConstants.SEQUENCE_ID;
import jalview.api.AlignViewportI;
import jalview.api.AlignmentViewPanel;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
+import java.util.ListIterator;
import java.util.StringTokenizer;
import java.util.Vector;
import java.util.concurrent.ExecutorService;
// check what the actual links are - if it's just the default don't
// bother with the warning
Vector<String> links = Preferences.sequenceURLLinks;
- if (links == null || links.size() < 1)
+
+ // only need to check links if there is one with a
+ // SEQUENCE_ID which is not the default EMBL_EBI link
+ ListIterator<String> li = links.listIterator();
+ Boolean check = false;
+ while (li.hasNext() && !check)
{
- // there are no links
- return;
+ String link = li.next();
+ check = (link.contains(SEQUENCE_ID) && !link
+ .equals(EMBLEBI_STRING));
}
- else if ((links.size() == 1)
- && links.get(0).equals(EMBLEBI_STRING))
+ if (!check)
{
- // the only link is the default EMBL-EBI link
return;
}
- // check in case URL links use old style tokens ($SEQUENCE_ID$ for
- // sequence id _or_ accession id)
+ // ask user to check in case URL links use old style tokens
+ // ($SEQUENCE_ID$ for sequence id _or_ accession id)
JPanel msgPanel = new JPanel();
msgPanel.setLayout(new BoxLayout(msgPanel, BoxLayout.PAGE_AXIS));
msgPanel.add(Box.createVerticalGlue());
MessageManager.getString("label.do_not_display_again"));
jcb.addActionListener(new ActionListener()
{
-
@Override
public void actionPerformed(ActionEvent e)
{
MessageManager
.getString("label.SEQUENCE_ID_no_longer_used"),
JOptionPane.WARNING_MESSAGE);
-
}
}
});