- HashMap<String, UrlLink> newurls = new HashMap<String, UrlLink>();
-
- // should check that lists are same length but this function is likely
- // to change once the Preferences dialog is rebuilt
-
- for (int i = 0; i < names.size(); ++i)
- {
- // don't allow MIRIAM ids as custom url names (as the links will overwrite
- // each other)
- // unlikely user would try to do this, but...
- if (isMiriamId(names.elementAt(i)))
- {
- throw new IllegalArgumentException(MessageManager.formatMessage(
- "exception.url_cannot_have_miriam_id", names.elementAt(i)));
- }
- // don't allow duplicate key names as entries will be overwritten
- if (newurls.containsKey(names.elementAt(i)))
- {
- throw new IllegalArgumentException(MessageManager.formatMessage(
- "exception.url_cannot_have_duplicate_id",
- names.elementAt(i)));
- }
- newurls.put(names.elementAt(i), new UrlLink(names.elementAt(i) + SEP
- + urlstrings.elementAt(i)));
- }
-
- // don't update until we're sure this set is ok
- urls = newurls;
-