JAL-3616 show name of structure viewer in ‘new view’ button
authorJim Procter <j.procter@dundee.ac.uk>
Fri, 1 Oct 2021 16:36:35 +0000 (17:36 +0100)
committerJim Procter <j.procter@dundee.ac.uk>
Fri, 1 Oct 2021 16:36:48 +0000 (17:36 +0100)
resources/lang/Messages.properties
src/jalview/gui/StructureViewer.java
src/jalview/jbgui/GStructureChooser.java

index 555bfbf..46ebb73 100644 (file)
@@ -118,6 +118,7 @@ action.paste_annotations = Paste Annotations
 action.format = Format
 action.select = Select
 action.new_view = New View
+action.new_structure_view_with = Open new structure view with {0}
 action.close = Close
 action.add = Add
 action.save_as = Save as...
index 617706a..7b1864b 100644 (file)
@@ -80,6 +80,7 @@ public class StructureViewer
     return sv;
   }
 
+  
   @Override
   public String toString()
   {
@@ -89,7 +90,11 @@ public class StructureViewer
     }
     return "New View";
   }
-  public ViewerType getViewerType()
+  /**
+   * 
+   * @return ViewerType for currently configured structure viewer 
+   */
+  public static ViewerType getViewerType()
   {
     String viewType = Cache.getDefault(Preferences.STRUCTURE_DISPLAY,
             ViewerType.JMOL.name());
@@ -366,6 +371,7 @@ public class StructureViewer
     return viewer;
   }
 
+
   public boolean isBusy()
   {
     if (sview != null)
index ccccfb4..70d99c1 100644 (file)
@@ -465,7 +465,9 @@ public abstract class GStructureChooser extends JPanel
       }
     });
 
-    btn_newView = new JButton(MessageManager.getString("action.new_view"));
+    btn_newView = new JButton(
+            MessageManager.formatMessage("action.new_structure_view_with",
+                    StructureViewer.getViewerType().toString()));
     btn_newView.setFont(VERDANA_12);
     btn_newView.addActionListener(new java.awt.event.ActionListener()
     {
@@ -486,6 +488,8 @@ public abstract class GStructureChooser extends JPanel
         }
       }
     });
+    
+    // TODO: JAL-3898 - get list of available external programs to view structures with
 
     btn_add = new JButton(MessageManager.getString("action.add"));
     btn_add.setFont(VERDANA_12);