ST-TURN-IIL blue|255,0,255|absolute|20.0|95.0|below|66.0
-GAMMA-TURN-CLASSIC red|0,255,255|20.0|95.0|below|66.0
+GAMMA-TURN-CLASSIC lightGray|0,255,255|20.0|95.0|below|66.0
BETA-TURN-IR 9a6a94
BETA-TURN-IL d6a6ca
BETA-BULGE 1dc451
label.insert = Insert:
action.seq_id = $SEQUENCE_ID$
action.db_acc = $DB_ACCESSION$
-label.default = On Click
+label.primary = On Click
label.inmenu = In Menu
label.id = ID
label.urltooltip = Only one url, which must use a sequence id, can be selected for the 'On Click' option
label.insert = Insert:
action.seq_id = $SEQUENCE_ID$
action.db_acc = $DB_ACCESSION$
-label.default = On Click
+label.primary = On Click
label.inmenu = In Menu
label.id = ID
label.urltooltip = Only one url, which must use a sequence id, can be selected for the 'On Click' option
Menu menu1 = new Menu();
public APopupMenu(AlignmentPanel apanel, final SequenceI seq,
- Vector<String> links)
+ List<String> links)
{
// /////////////////////////////////////////////////////////
// If this is activated from the sequence panel, the user may want to
import java.awt.event.MouseMotionListener;
import java.util.HashMap;
import java.util.List;
-import java.util.Vector;
public class IdPanel extends Panel implements MouseListener,
MouseMotionListener
String id = sq.getName();
// get the default url with the sequence details filled in
- String url = urlProvider.getDefaultUrl(id);
- String target = urlProvider.getDefaultTarget(id);
+ String url = urlProvider.getPrimaryUrl(id);
+ String target = urlProvider.getPrimaryTarget(id);
try
{
alignPanel.alignFrame.showURL(url, target);
// build a new links menu based on the current links + any non-positional
// features
- Vector<String> nlinks = urlProvider.getLinksForMenu();
+ List<String> nlinks = urlProvider.getLinksForMenu();
SequenceFeature sf[] = sq == null ? null : sq.getSequenceFeatures();
for (int sl = 0; sf != null && sl < sf.length; sl++)
{
for (int l = 0, lSize = sf[sl].links.size(); l < lSize; l++)
{
- nlinks.addElement(sf[sl].links.elementAt(l));
+ nlinks.add(sf[sl].links.elementAt(l));
}
}
}
import jalview.util.Platform;
import jalview.util.UrlConstants;
import jalview.viewmodel.AlignmentViewport;
-import jalview.ws.UrlDownloadClient;
import jalview.ws.params.ParamManager;
+import jalview.ws.utils.UrlDownloadClient;
import java.awt.BorderLayout;
import java.awt.Color;
{
// check what the actual links are - if it's just the default don't
// bother with the warning
- Vector<String> links = Preferences.sequenceUrlLinks
+ List<String> links = Preferences.sequenceUrlLinks
.getLinksForMenu();
// only need to check links if there is one with a
import java.awt.event.MouseWheelEvent;
import java.awt.event.MouseWheelListener;
import java.util.List;
-import java.util.Vector;
-import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
import javax.swing.ToolTipManager;
int seq = alignPanel.getSeqPanel().findSeq(e);
String id = av.getAlignment().getSequenceAt(seq).getName();
- String url = Preferences.sequenceUrlLinks.getDefaultUrl(id);
+ String url = Preferences.sequenceUrlLinks.getPrimaryUrl(id);
try
{
Sequence sq = (Sequence) av.getAlignment().getSequenceAt(seq2);
// build a new links menu based on the current links + any non-positional
// features
- Vector<String> nlinks = Preferences.sequenceUrlLinks.getLinksForMenu();
+ List<String> nlinks = Preferences.sequenceUrlLinks.getLinksForMenu();
SequenceFeature sfs[] = sq == null ? null : sq.getSequenceFeatures();
if (sfs != null)
{
{
for (int l = 0, lSize = sf.links.size(); l < lSize; l++)
{
- nlinks.addElement(sf.links.elementAt(l));
+ nlinks.add(sf.links.elementAt(l));
}
}
}
List<RowSorter.SortKey> sortKeys = new ArrayList<>();
UrlLinkTableModel m = (UrlLinkTableModel) linkUrlTable.getModel();
- sortKeys.add(new RowSorter.SortKey(m.getDefaultColumn(),
+ sortKeys.add(new RowSorter.SortKey(m.getPrimaryColumn(),
SortOrder.DESCENDING));
sortKeys.add(new RowSorter.SortKey(m.getSelectedColumn(),
SortOrder.DESCENDING));
// set up radio buttons
int onClickCol = ((UrlLinkTableModel) linkUrlTable.getModel())
- .getDefaultColumn();
+ .getPrimaryColumn();
String onClickName = linkUrlTable.getColumnName(onClickCol);
linkUrlTable.getColumn(onClickName).setCellRenderer(
new RadioButtonRenderer());
}
Cache.applicationProperties.setProperty("DEFAULT_URL",
- sequenceUrlLinks.getDefaultUrlId());
+ sequenceUrlLinks.getPrimaryUrlId());
Cache.applicationProperties.setProperty("USE_PROXY",
Boolean.toString(useProxy.isSelected()));
}
@Override
- public boolean setDefaultUrl(String id)
+ public boolean setPrimaryUrl(String id)
{
if (selectedUrls.containsKey(id))
{
- defaultUrl = id;
+ primaryUrl = id;
}
else if (nonselectedUrls.containsKey(id))
{
- defaultUrl = id;
+ primaryUrl = id;
}
else
{
- defaultUrl = null;
+ primaryUrl = null;
}
- return (defaultUrl != null);
+ return (primaryUrl != null);
}
@Override
}
@Override
- public String getDefaultUrl(String seqid)
+ public String getPrimaryUrl(String seqid)
{
- String result = super.getDefaultUrl(seqid, selectedUrls);
+ String result = super.getPrimaryUrl(seqid, selectedUrls);
if (result == null)
{
- result = super.getDefaultUrl(seqid, nonselectedUrls);
+ result = super.getPrimaryUrl(seqid, nonselectedUrls);
}
return result;
}
@Override
- public String getDefaultUrlId()
+ public String getPrimaryUrlId()
{
- return defaultUrl;
+ return primaryUrl;
}
@Override
- public String getDefaultTarget(String seqid)
+ public String getPrimaryTarget(String seqid)
{
- return selectedUrls.get(defaultUrl).getTarget();
+ return selectedUrls.get(primaryUrl).getTarget();
}
@Override
unselurls.put(link.getId(), new UrlLink(link.getName() + SEP
+ link.getUrl()));
}
- // sort out default and selected ids
- if (link.getIsDefault())
+ // sort out primary and selected ids
+ if (link.getIsPrimary())
{
- setDefaultUrl(link.getId());
+ setPrimaryUrl(link.getId());
}
}
}
@Override
- public String chooseDefaultUrl()
+ public String choosePrimaryUrl()
{
- // unilaterally set the default id to the EMBL_EBI link
+ // unilaterally set the primary id to the EMBL_EBI link
if ((!nonselectedUrls.containsKey(UrlConstants.DEFAULT_LABEL))
&& (!selectedUrls.containsKey(UrlConstants.DEFAULT_LABEL)))
{
selectedUrls.put(UrlConstants.DEFAULT_LABEL, new UrlLink(
UrlConstants.DEFAULT_STRING));
}
- defaultUrl = UrlConstants.DEFAULT_LABEL;
+ primaryUrl = UrlConstants.DEFAULT_LABEL;
return UrlConstants.DEFAULT_LABEL;
}
}
// reset defaultUrl in case it is no longer selected
- setDefaultUrl(defaultUrl);
+ setPrimaryUrl(primaryUrl);
}
@Override
- public boolean setDefaultUrl(String id)
+ public boolean setPrimaryUrl(String id)
{
if (urls.containsKey(id))
{
- defaultUrl = id;
+ primaryUrl = id;
}
else
{
- defaultUrl = null;
+ primaryUrl = null;
}
return urls.containsKey(id);
{
selectedUrls.add(link.getId());
}
- if (link.getIsDefault())
+ if (link.getIsPrimary())
{
- setDefaultUrl(link.getId());
+ setPrimaryUrl(link.getId());
}
}
}
}
@Override
- public String getDefaultUrl(String seqid)
+ public String getPrimaryUrl(String seqid)
{
- return super.getDefaultUrl(seqid, urls);
+ return super.getPrimaryUrl(seqid, urls);
}
@Override
- public String getDefaultUrlId()
+ public String getPrimaryUrlId()
{
- return defaultUrl;
+ return primaryUrl;
}
@Override
- public String getDefaultTarget(String seqid)
+ public String getPrimaryTarget(String seqid)
{
return null;
}
@Override
- public String chooseDefaultUrl()
+ public String choosePrimaryUrl()
{
return null;
}
private String id; // id is not supplied to display, but used to identify
// entries when saved
- private boolean isDefault;
+ private boolean isPrimary;
private boolean isSelected;
add(MessageManager.formatMessage("label.name"));
add(MessageManager.formatMessage("label.url"));
add(MessageManager.formatMessage("label.inmenu"));
- add(MessageManager.formatMessage("label.default"));
+ add(MessageManager.formatMessage("label.primary"));
add(MessageManager.formatMessage("label.id"));
}
};
public final static int SELECTED = 2;
- public final static int DEFAULT = 3;
+ public final static int PRIMARY = 3;
public final static int ID = 4;
boolean rowSelected, boolean rowDefault)
{
id = rowId;
- isDefault = rowDefault;
+ isPrimary = rowDefault;
isSelected = rowSelected;
link = rowLink;
return link.getUrlWithToken();
}
- public boolean getIsDefault()
+ public boolean getIsPrimary()
{
- return isDefault;
+ return isPrimary;
}
public boolean getIsSelected()
public void setIsDefault(boolean rowDefault)
{
- isDefault = rowDefault;
+ isPrimary = rowDefault;
}
public void setIsSelected(boolean rowSelected)
return id;
case URL:
return getUrl();
- case DEFAULT:
- return isDefault;
+ case PRIMARY:
+ return isPrimary;
case SELECTED:
return isSelected;
case NAME:
case URL:
setUrl((String) value);
break;
- case DEFAULT:
- isDefault = (boolean) value;
+ case PRIMARY:
+ isPrimary = (boolean) value;
break;
case SELECTED:
isSelected = (boolean) value;
*/
public boolean isEditable(int index)
{
- if (index == DEFAULT)
+ if (index == PRIMARY)
{
- // default link must not be a $DB_ACCESSION$ link
+ // primary link must not be a $DB_ACCESSION$ link
// so only allow editing if it is not
return (!link.usesDBAccession());
}
// list of columns to display in table in correct order
private List<String> displayColumns;
- // row in table which is currently the default
- private int defaultRow;
+ // row in table which is currently the primary
+ private int primaryRow;
/**
* UrlLinkTableModel constructor
data = baseData.getLinksForTable();
displayColumns = UrlLinkDisplay.getDisplayColumnNames();
- // find the default row
- defaultRow = 0;
+ // find the primary row
+ primaryRow = 0;
Iterator<UrlLinkDisplay> it = data.iterator();
while (it.hasNext())
{
- if (it.next().getIsDefault())
+ if (it.next().getIsPrimary())
{
break;
}
else
{
- defaultRow++;
+ primaryRow++;
}
}
{
// to delete, row must be a user entered row, and not the default row
return (dataProvider.isUserEntry(data.get(rowIndex).getId()) && !data
- .get(rowIndex).getIsDefault());
+ .get(rowIndex).getIsPrimary());
}
@Override
public void setValueAt(Object aValue, int rowIndex, int columnIndex)
{
- if (columnIndex == UrlLinkDisplay.DEFAULT)
+ if (columnIndex == UrlLinkDisplay.PRIMARY)
{
// Default url column: exactly one row must always be true
- if (rowIndex != defaultRow)
+ if (rowIndex != primaryRow)
{
// selected row is not currently the default
// set the current default to false
- data.get(defaultRow).setValue(columnIndex, false);
- fireTableRowsUpdated(defaultRow, defaultRow);
+ data.get(primaryRow).setValue(columnIndex, false);
+ fireTableRowsUpdated(primaryRow, primaryRow);
// set the default to be the selected row
- defaultRow = rowIndex;
+ primaryRow = rowIndex;
data.get(rowIndex).setValue(columnIndex, aValue);
fireTableRowsUpdated(rowIndex, rowIndex);
data.remove(rowIndex);
// update default row
- if (defaultRow > rowIndex)
+ if (primaryRow > rowIndex)
{
- defaultRow--;
+ primaryRow--;
}
// fire update which will update data source
return index;
}
- public int getDefaultColumn()
+ public int getPrimaryColumn()
{
- return UrlLinkDisplay.DEFAULT;
+ return UrlLinkDisplay.PRIMARY;
}
public int getNameColumn()
{
// if the defaultUrl can't be found in any of the providers
// set up a custom default url
- chooseDefaultUrl();
+ choosePrimaryUrl();
}
else
{
- setDefaultUrl(defaultUrlString);
+ setPrimaryUrl(defaultUrlString);
}
}
{
for (UrlProviderI p : providers)
{
- if (p.getClass().equals(CustomUrlProvider.class))
+ if (p instanceof CustomUrlProvider)
{
return p;
}
}
@Override
- public boolean setDefaultUrl(String id)
+ public boolean setPrimaryUrl(String id)
{
boolean outcome = false;
for (UrlProviderI p : providers)
{
- if (p.setDefaultUrl(id))
+ if (p.setPrimaryUrl(id))
{
outcome = true;
}
}
@Override
- public String getDefaultUrl(String seqid)
+ public String getPrimaryUrl(String seqid)
{
String link = null;
for (UrlProviderI p : providers)
{
- if (p.getDefaultUrl(seqid) == null)
+ if (p.getPrimaryUrl(seqid) == null)
{
continue;
}
else
{
- link = p.getDefaultUrl(seqid);
+ link = p.getPrimaryUrl(seqid);
break;
}
}
}
@Override
- public String getDefaultUrlId()
+ public String getPrimaryUrlId()
{
String id = null;
for (UrlProviderI p : providers)
{
- if (p.getDefaultUrlId() == null)
+ if (p.getPrimaryUrlId() == null)
{
continue;
}
else
{
- id = p.getDefaultUrlId();
+ id = p.getPrimaryUrlId();
break;
}
}
}
@Override
- public String getDefaultTarget(String seqid)
+ public String getPrimaryTarget(String seqid)
{
String target = null;
for (UrlProviderI p : providers)
{
- if (p.getDefaultTarget(seqid) == null)
+ if (p.getPrimaryTarget(seqid) == null)
{
continue;
}
else
{
- target = p.getDefaultTarget(seqid);
+ target = p.getPrimaryTarget(seqid);
break;
}
}
}
@Override
- public String chooseDefaultUrl()
+ public String choosePrimaryUrl()
{
// choose a custom url default
- return customProvider.chooseDefaultUrl();
+ return customProvider.choosePrimaryUrl();
}
@Override
private static final Pattern MIRIAM_PATTERN = Pattern
.compile("^MIR:\\d{8}$");
- protected String defaultUrl;
+ protected String primaryUrl;
- protected String getDefaultUrl(String seqid, HashMap<String, UrlLink> urls)
+ protected String getPrimaryUrl(String seqid, HashMap<String, UrlLink> urls)
{
if (seqid.length() < MIN_SUBST_LENGTH)
{
return null;
}
- else if (defaultUrl == null)
+ else if (primaryUrl == null)
{
return null;
}
- else if (!urls.containsKey(defaultUrl))
+ else if (!urls.containsKey(primaryUrl))
{
return null;
}
else
{
String url = null;
- UrlLink urlLink = urls.get(defaultUrl);
- String[] defaultUrls = urlLink.makeUrls(seqid, true);
- if (defaultUrls == null || defaultUrls[0] == null
- || defaultUrls[0].length() < MIN_SUBST_LENGTH)
+ UrlLink urlLink = urls.get(primaryUrl);
+ String[] primaryUrls = urlLink.makeUrls(seqid, true);
+ if (primaryUrls == null || primaryUrls[0] == null
+ || primaryUrls[0].length() < MIN_SUBST_LENGTH)
{
url = null;
}
else
{
// just take first URL made from regex
- url = defaultUrls[1];
+ url = primaryUrls[1];
}
return url;
}
for (Entry<String, UrlLink> entry : urls.entrySet())
{
String key = entry.getKey();
- boolean isDefault = (key.equals(defaultUrl));
+ boolean isPrimary = (key.equals(primaryUrl));
boolean isSelected;
if (selectedUrls != null)
{
isSelected = selected;
}
displayLinks.add(new UrlLinkDisplay(key, entry.getValue(),
- isSelected, isDefault));
+ isSelected, isPrimary));
}
return displayLinks;
}
import jalview.urls.UrlLinkDisplay;
import java.util.List;
-import java.util.Vector;
/**
* Methods for providing consistent access to up-to-date URLs
* Get names and urls in the UrlProvider as strings for display
*
*/
- Vector<String> getLinksForMenu();
+ List<String> getLinksForMenu();
/**
* Get names and urls as strings for display
void setUrlData(List<UrlLinkDisplay> links);
/**
- * Get the link for the default URL
+ * Get the link for the primary URL
*
* @seqid sequence id for which to build link
- * @return link for the default URL
+ * @return link for the primary URL
*/
- String getDefaultUrl(String seqid);
+ String getPrimaryUrl(String seqid);
/**
- * Get the default URL id
+ * Get the primary URL id
*
- * @return id for default URL
+ * @return id for primary URL
*/
- String getDefaultUrlId();
+ String getPrimaryUrlId();
/**
- * Get the target of the link for the default URL
+ * Get the target of the link for the primary URL
*
* @seqid sequence id for which to build link
- * @return target of link for the default URL
+ * @return target of link for the primary URL
*/
- String getDefaultTarget(String seqid);
+ String getPrimaryTarget(String seqid);
/**
- * Set the default URL
+ * Set the primary URL: if only one URL can be used, this URL is the one which
+ * should be chosen, e.g. provides the URL to be used on double-click of a
+ * sequence id
*
* @param id
- * the id of the URL to set as default
+ * the id of the URL to set as primary
* @return true if setting is successful
* @throws IllegalArgumentException
* if id does not exist as a url in the UrlProvider
*/
- boolean setDefaultUrl(String id) throws IllegalArgumentException;
+ boolean setPrimaryUrl(String id) throws IllegalArgumentException;
/**
* Test if UrlProvider contains a url
String writeUrlsAsString(boolean selected);
/**
- * Choose the default URL in the event of the selected default being
+ * Choose the primary URL in the event of the selected primary being
* unavailable
*
- * @return id of chosen default url
+ * @return id of chosen primary url
*/
- String chooseDefaultUrl();
+ String choosePrimaryUrl();
/**
* Determine if id is for a user-defined URL
* The Jalview Authors are detailed in the 'AUTHORS' file.
*/
-package jalview.ws;
+package jalview.ws.utils;
import java.io.FileOutputStream;
import java.io.IOException;
}
/**
- * Download persistent database URLs from identifiers.org
+ * Download and save a file from a URL
*
* @param urlstring
* url to download from, as string
UrlProviderI prov = factory.createUrlProvider();
// default url correctly set
- Assert.assertEquals(prov.getDefaultUrlId(), "Test2");
- Assert.assertEquals(prov.getDefaultUrl("FER_CAPAN"),
+ Assert.assertEquals(prov.getPrimaryUrlId(), "Test2");
+ Assert.assertEquals(prov.getPrimaryUrl("FER_CAPAN"),
defaultUrl.replace("$SEQUENCE_ID$",
"FER_CAPAN"));
Assert.assertEquals(allLinks.get(0).getName(), "Test1");
Assert.assertEquals(allLinks.get(0).getUrl(),
"http://identifiers.org/uniprot/$DB_ACCESSION$");
- Assert.assertFalse(allLinks.get(0).getIsDefault());
+ Assert.assertFalse(allLinks.get(0).getIsPrimary());
Assert.assertTrue(allLinks.get(0).getIsSelected());
// second link set correctly
Assert.assertEquals(allLinks.get(1).getId(), "Test2");
Assert.assertEquals(allLinks.get(1).getName(), "Test2");
Assert.assertEquals(allLinks.get(1).getUrl(), defaultUrl);
- Assert.assertTrue(allLinks.get(1).getIsDefault());
+ Assert.assertTrue(allLinks.get(1).getIsPrimary());
Assert.assertTrue(allLinks.get(1).getIsSelected());
}
}
unselectedList);
// default url can be set
- assertTrue(customProv.setDefaultUrl("ANOTHER"));
+ assertTrue(customProv.setPrimaryUrl("ANOTHER"));
// supplied replacement id must be more than 4 chars
- String result = customProv.getDefaultUrl("123");
+ String result = customProv.getPrimaryUrl("123");
assertEquals(null, result);
// default url can be retrieved given a sequence id
- result = customProv.getDefaultUrl("seqid");
+ result = customProv.getPrimaryUrl("seqid");
assertEquals("http://test/tseqid", result);
// if there is no default url it sets the default to null
- assertFalse(customProv.setDefaultUrl("No default"));
- result = customProv.getDefaultUrl("testid");
+ assertFalse(customProv.setPrimaryUrl("No default"));
+ result = customProv.getPrimaryUrl("testid");
assertEquals(null, result);
// choosing the default picks the DEFAULT_STRING option
- customProv.chooseDefaultUrl();
- result = customProv.getDefaultUrl("seqid");
+ customProv.choosePrimaryUrl();
+ result = customProv.getPrimaryUrl("seqid");
assertEquals(
UrlConstants.DEFAULT_STRING.split("\\|")[1].split("\\$")[0]
+ "seqid",
import java.io.FileWriter;
import java.io.IOException;
import java.util.List;
-import java.util.Vector;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
UrlProviderI prov = factory.createUrlProvider();
// default url correctly set
- Assert.assertEquals(prov.getDefaultUrlId(), "Test1");
- Assert.assertEquals(prov.getDefaultUrl("FER_CAPAN"),
+ Assert.assertEquals(prov.getPrimaryUrlId(), "Test1");
+ Assert.assertEquals(prov.getPrimaryUrl("FER_CAPAN"),
defaultUrl.replace("$SEQUENCE_ID$", "FER_CAPAN"));
- Vector<String> menulinks = prov.getLinksForMenu();
+ List<String> menulinks = prov.getLinksForMenu();
List<UrlLinkDisplay> allLinks = prov.getLinksForTable();
// 8 links in provider - 4 from id file, 4 custom links
UrlProviderI idProv = new IdentifiersUrlProvider(idList);
// initially no default
- assertEquals(null, idProv.getDefaultUrl("seqid"));
+ assertEquals(null, idProv.getPrimaryUrl("seqid"));
// set and then retrieve default
- assertTrue(idProv.setDefaultUrl("MIR:00000005"));
+ assertTrue(idProv.setPrimaryUrl("MIR:00000005"));
assertEquals("http://identifiers.org/uniprot/seqid",
- idProv.getDefaultUrl("seqid"));
+ idProv.getPrimaryUrl("seqid"));
// ids less than length 4 return null
assertEquals(null,
- idProv.getDefaultUrl("123"));
+ idProv.getPrimaryUrl("123"));
// attempt to set bad default
- assertFalse(idProv.setDefaultUrl("MIR:00001234"));
+ assertFalse(idProv.setPrimaryUrl("MIR:00001234"));
// default set to null (as default should have been set elsewhere)
- assertEquals(null, idProv.getDefaultUrl("seqid"));
+ assertEquals(null, idProv.getPrimaryUrl("seqid"));
// chooseDefaultUrl not implemented for IdentifiersUrlProvider
- assertEquals(null, idProv.chooseDefaultUrl());
+ assertEquals(null, idProv.choosePrimaryUrl());
}
}
"http://identifiers.org/$DB_ACCESSION$");
UrlLinkDisplay u = new UrlLinkDisplay("Test", link, false, false);
- Assert.assertFalse((boolean) u.getValue(UrlLinkDisplay.DEFAULT));
+ Assert.assertFalse((boolean) u.getValue(UrlLinkDisplay.PRIMARY));
Assert.assertEquals(u.getValue(UrlLinkDisplay.ID), "Test");
Assert.assertEquals(u.getValue(UrlLinkDisplay.NAME), "Test Url");
Assert.assertFalse((boolean) u.getValue(UrlLinkDisplay.SELECTED));
"http://identifiers.org/$DB_ACCESSION$");
UrlLinkDisplay u = new UrlLinkDisplay("Test", link, false, false);
- Assert.assertFalse(u.isEditable(UrlLinkDisplay.DEFAULT));
+ Assert.assertFalse(u.isEditable(UrlLinkDisplay.PRIMARY));
Assert.assertTrue(u.isEditable(UrlLinkDisplay.SELECTED));
Assert.assertFalse(u.isEditable(UrlLinkDisplay.ID));
Assert.assertFalse(u.isEditable(UrlLinkDisplay.URL));
"http://myurl/$SEQUENCE_ID$");
UrlLinkDisplay v = new UrlLinkDisplay("Test", vlink, false, false);
- Assert.assertTrue(v.isEditable(UrlLinkDisplay.DEFAULT));
+ Assert.assertTrue(v.isEditable(UrlLinkDisplay.PRIMARY));
Assert.assertTrue(v.isEditable(UrlLinkDisplay.SELECTED));
Assert.assertFalse(v.isEditable(UrlLinkDisplay.ID));
Assert.assertFalse(v.isEditable(UrlLinkDisplay.URL));
"http://identifiers.org/$DB_ACCESSION$");
UrlLinkDisplay u = new UrlLinkDisplay("Test", link, false, false);
- Assert.assertFalse((boolean) u.getValue(UrlLinkDisplay.DEFAULT));
+ Assert.assertFalse((boolean) u.getValue(UrlLinkDisplay.PRIMARY));
Assert.assertFalse((boolean) u.getValue(UrlLinkDisplay.SELECTED));
Assert.assertEquals(u.getValue(UrlLinkDisplay.NAME), "Test Url");
Assert.assertEquals(u.getValue(UrlLinkDisplay.ID), "Test");
Assert.assertEquals(u.getValue(UrlLinkDisplay.URL),
"http://identifiers.org/$DB_ACCESSION$");
- u.setValue(UrlLinkDisplay.DEFAULT, true);
- Assert.assertTrue((boolean) u.getValue(UrlLinkDisplay.DEFAULT));
+ u.setValue(UrlLinkDisplay.PRIMARY, true);
+ Assert.assertTrue((boolean) u.getValue(UrlLinkDisplay.PRIMARY));
u.setValue(UrlLinkDisplay.SELECTED, true);
Assert.assertTrue((boolean) u.getValue(UrlLinkDisplay.SELECTED));
Assert.assertEquals(m.getColumnName(2),
MessageManager.formatMessage("label.inmenu"));
Assert.assertEquals(m.getColumnName(3),
- MessageManager.formatMessage("label.default"));
+ MessageManager.formatMessage("label.primary"));
// check column classes
Assert.assertEquals(m.getColumnClass(0), String.class);
Assert.assertTrue(prov.writeUrlsAsString(true).contains(m.getValueAt(7,0) + SEP + "urlchanged"));
Assert.assertTrue(prov.writeUrlsAsString(false).contains(
(String) m.getValueAt(8, 0)));
- Assert.assertEquals(prov.getDefaultUrl("seqid"), m.getValueAt(6, 1)
+ Assert.assertEquals(prov.getPrimaryUrl("seqid"), m.getValueAt(6, 1)
.toString().replace(DELIM + SEQUENCE_ID + DELIM, "seqid"));
}
import java.io.FileWriter;
import java.io.IOException;
import java.util.List;
-import java.util.Vector;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
UrlConstants.DEFAULT_STRING.length());
// chooses EMBL url when default Url id does not exist in provided url lists
- Assert.assertEquals(prov.getDefaultUrlId(), UrlConstants.DEFAULT_LABEL);
- Assert.assertEquals(prov.getDefaultUrl("FER_CAPAN"),
+ Assert.assertEquals(prov.getPrimaryUrlId(), UrlConstants.DEFAULT_LABEL);
+ Assert.assertEquals(prov.getPrimaryUrl("FER_CAPAN"),
emblUrl.replace("$SEQUENCE_ID$", "FER_CAPAN"));
- Vector<String> menulinks = prov.getLinksForMenu();
+ List<String> menulinks = prov.getLinksForMenu();
List<UrlLinkDisplay> allLinks = prov.getLinksForTable();
// 9 links in provider - 4 from id file, 4 custom links, 1 additional
public void testSetDefaultUrl()
{
// set custom url as default
- Assert.assertTrue(prov.setDefaultUrl("Test1"));
- Assert.assertEquals(prov.getDefaultUrlId(), "Test1");
+ Assert.assertTrue(prov.setPrimaryUrl("Test1"));
+ Assert.assertEquals(prov.getPrimaryUrlId(), "Test1");
// set identifiers url as default
- Assert.assertTrue(prov.setDefaultUrl("MIR:00000011"));
- Assert.assertEquals(prov.getDefaultUrlId(), "MIR:00000011");
+ Assert.assertTrue(prov.setPrimaryUrl("MIR:00000011"));
+ Assert.assertEquals(prov.getPrimaryUrlId(), "MIR:00000011");
}
@Test(
public void testSetDefaultUrlWrongly()
{
// don't allow default to be a non-key
- prov.setDefaultUrl("not-a-key");
+ prov.setPrimaryUrl("not-a-key");
}
}
* along with Jalview. If not, see <http://www.gnu.org/licenses/>.
* The Jalview Authors are detailed in the 'AUTHORS' file.
*/
-package jalview.ws;
+package jalview.ws.utils;
import java.io.File;
import java.io.IOException;