From: James Procter Date: Mon, 23 Oct 2023 13:03:45 +0000 (+0100) Subject: JAL-4310 let the user know when model pages are not available for a 3d-beacons struct... X-Git-Tag: Release_2_11_4_0~124^2~3 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=7fa567506eea0a202c71e6939b961962f515dcec;p=jalview.git JAL-4310 let the user know when model pages are not available for a 3d-beacons structure (and log URLs when they are opened). --- diff --git a/src/jalview/gui/Desktop.java b/src/jalview/gui/Desktop.java index 35afb69..070e67d 100644 --- a/src/jalview/gui/Desktop.java +++ b/src/jalview/gui/Desktop.java @@ -3067,7 +3067,13 @@ public class Desktop extends jalview.jbgui.GDesktop */ public static void showUrl(final String url) { - showUrl(url, Desktop.instance); + if (url!=null && !url.trim().equals("")) { + jalview.bin.Console.info("Opening URL: "+url); + showUrl(url, Desktop.instance); + } else { + jalview.bin.Console.warn("Ignoring attempt to show an empty URL."); + } + } /** diff --git a/src/jalview/gui/StructureChooser.java b/src/jalview/gui/StructureChooser.java index a72e221..8135019 100644 --- a/src/jalview/gui/StructureChooser.java +++ b/src/jalview/gui/StructureChooser.java @@ -1008,8 +1008,13 @@ public class StructureChooser extends GStructureChooser .getFTSDataFor(getResultTable(), selectedRow, discoveredStructuresSet); String pageUrl = row.getModelViewUrl(); + JPopupMenu popup = new JPopupMenu("3D Beacons"); JMenuItem viewUrl = new JMenuItem("View model web page"); + if (pageUrl == null || "".equals(pageUrl.trim())) { + viewUrl.setEnabled(false); + viewUrl.setText("No model page available."); + } viewUrl.addActionListener(new ActionListener() { @Override