import jalview.gui.Desktop;
import jalview.util.GroupUrlLink;
+import java.awt.Component;
import java.awt.Cursor;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
*/
private void addshowLink(JMenu linkMenu, String label, String descr, final GroupUrlLink urlgenerator, final Object[] urlstub)
{
+ Component[] jmi=linkMenu.getMenuComponents();
+ for (int i=0; i<jmi.length; i++)
+ {
+ if (jmi[i] instanceof JMenuItem && ((JMenuItem)jmi[i]).getText().equalsIgnoreCase(label))
+ {
+ // don't add this - its a repeat of an existing URL.
+ return;
+ }
+ }
JMenuItem item = new JMenuItem(label);
item.setToolTipText("Submit ("+urlgenerator.getNumberInvolved(urlstub)+" seqs) to workflow: "+descr);
item.addActionListener(new java.awt.event.ActionListener()