git://source.jalview.org
/
jalview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4b1d754
)
JAL-2282 Better check for existing url links
author
kiramt
<k.mourao@dundee.ac.uk>
Fri, 4 Nov 2016 14:28:57 +0000
(14:28 +0000)
committer
kiramt
<k.mourao@dundee.ac.uk>
Fri, 4 Nov 2016 14:28:57 +0000
(14:28 +0000)
src/jalview/gui/Desktop.java
patch
|
blob
|
history
diff --git
a/src/jalview/gui/Desktop.java
b/src/jalview/gui/Desktop.java
index
4d10cc8
..
d06dd26
100644
(file)
--- a/
src/jalview/gui/Desktop.java
+++ b/
src/jalview/gui/Desktop.java
@@
-21,6
+21,7
@@
package jalview.gui;
import static jalview.util.UrlConstants.EMBLEBI_STRING;
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 jalview.api.AlignViewportI;
import jalview.api.AlignmentViewPanel;
@@
-77,6
+78,7
@@
import java.net.URL;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;
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;
import java.util.StringTokenizer;
import java.util.Vector;
import java.util.concurrent.ExecutorService;
@@
-2276,20
+2278,24
@@
public class Desktop extends jalview.jbgui.GDesktop implements
// check what the actual links are - if it's just the default don't
// bother with the warning
Vector<String> links = Preferences.sequenceURLLinks;
// 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;
}
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());
JPanel msgPanel = new JPanel();
msgPanel.setLayout(new BoxLayout(msgPanel, BoxLayout.PAGE_AXIS));
msgPanel.add(Box.createVerticalGlue());
@@
-2306,7
+2312,6
@@
public class Desktop extends jalview.jbgui.GDesktop implements
MessageManager.getString("label.do_not_display_again"));
jcb.addActionListener(new ActionListener()
{
MessageManager.getString("label.do_not_display_again"));
jcb.addActionListener(new ActionListener()
{
-
@Override
public void actionPerformed(ActionEvent e)
{
@Override
public void actionPerformed(ActionEvent e)
{
@@
-2327,7
+2332,6
@@
public class Desktop extends jalview.jbgui.GDesktop implements
MessageManager
.getString("label.SEQUENCE_ID_no_longer_used"),
JOptionPane.WARNING_MESSAGE);
MessageManager
.getString("label.SEQUENCE_ID_no_longer_used"),
JOptionPane.WARNING_MESSAGE);
-
}
}
});
}
}
});