import javax.swing.JPopupMenu;
import javax.swing.JProgressBar;
import javax.swing.SwingUtilities;
+import javax.swing.event.HyperlinkEvent;
import javax.swing.event.MenuEvent;
import javax.swing.event.MenuListener;
+import javax.swing.event.HyperlinkEvent.EventType;
/**
* Jalview Desktop
return wsparamManager;
}
+ /**
+ * static hyperlink handler proxy method for use by Jalview's internal windows
+ * @param e
+ */
+ public static void hyperlinkUpdate(HyperlinkEvent e)
+ {
+ if (e.getEventType() == EventType.ACTIVATED)
+ {
+ String url=null;
+ try
+ {
+ url = e.getURL().toString();
+ Desktop.showUrl(url);
+ } catch (Exception x)
+ {
+ if (url!=null) {
+ if (Cache.log!=null) {
+ Cache.log.error("Couldn't handle string "+url+" as a URL.");
+ } else {
+ System.err.println("Couldn't handle string "+url+" as a URL.");
+ }
+ }
+ // ignore any exceptions due to dud links.
+ }
+
+ }
+ }
+
}
public void hyperlinkUpdate(HyperlinkEvent e)
{
- if (e.getEventType() == EventType.ACTIVATED)
- {
- String url=null;
- try
- {
- url = e.getURL().toString();
- Desktop.showUrl(url);
- } catch (Exception x)
- {
- if (url!=null) {
- Cache.log.error("Couldn't handle string "+url+" as a URL.");
- }
- // ignore any exceptions due to dud links.
- }
-
- }
+ Desktop.hyperlinkUpdate(e);
}
}