JAL-3253 preliminary static fixes for JavaScript part 3 of 3
[jalview.git] / src / jalview / gui / PopupMenu.java
index a356def..3145f7c 100644 (file)
@@ -304,7 +304,7 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener
   {
     try
     {
-      jalview.util.BrowserLauncher.openURL(url);
+      Platform.openURL(url);
     } catch (Exception ex)
     {
       JvOptionPane.showInternalMessageDialog(Desktop.getDesktopPane(),
@@ -317,7 +317,9 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener
   }
 
   /**
-   * add a late bound groupURL item to the given linkMenu
+   * For the popup menu on the idPanel.
+   * 
+   * Add a late bound groupURL item to the given linkMenu
    * 
    * @param linkMenu
    * @param label
@@ -349,6 +351,15 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener
           {
             try
             {
+              // Object[] { int[] { number of matches seqs },
+              // boolean[] { which matched },
+              // StringBuffer[] { segment generated from inputs },
+              // String[] { url }
+              // }
+
+              // TODO bug: urlstub is { int[], boolean[] } but constructFrom
+              // requires something else.
+
               showLink(urlgenerator.constructFrom(urlstub));
             } catch (UrlStringTooLongException e2)
             {
@@ -388,6 +399,7 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener
    *          non-positional features if in the Id panel, features at the
    *          clicked residue if in the sequence panel
    * @param groupLinks
+   *          not implemented -- empty list
    */
   public PopupMenu(final AlignmentPanel alignPanel, final SequenceI seq,
           List<SequenceFeature> features, List<String> groupLinks)
@@ -658,6 +670,7 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener
       // add any groupURLs to the groupURL submenu and make it visible
       if (groupLinks != null && groupLinks.size() > 0)
       {
+        // not implemented -- empty list
         buildGroupURLMenu(sg, groupLinks);
       }
       // Add a 'show all structures' for the current selection
@@ -983,6 +996,12 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener
     showOrHideMenu.add(item);
   }
 
+  /**
+   *
+   * @param sg
+   * @param groupLinks
+   *          not implemented -- empty list
+   */
   private void buildGroupURLMenu(SequenceGroup sg, List<String> groupLinks)
   {
 
@@ -1044,9 +1063,15 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener
         }
       }
     }
+    if (groupLinks.size() == 0)
+    {
+      return;
+    }
     // now create group links for all distinct ID/sequence sets.
     boolean addMenu = false; // indicates if there are any group links to give
                              // to user
+
+    // not implmeented -- empty list
     for (String link : groupLinks)
     {
       GroupUrlLink urlLink = null;
@@ -1099,6 +1124,7 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener
       {
         urlset = urlLink.makeUrlStubs(ids, seqstr,
                 "FromJalview" + System.currentTimeMillis(), false);
+        // { int[], boolean[] } only here
       } catch (UrlStringTooLongException e)
       {
       }
@@ -1127,7 +1153,6 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener
           groupLinksMenu.add(linkMenus[m]);
         }
       }
-
       groupMenu.add(groupLinksMenu);
     }
   }