Merge branch 'hotfix/JAL-1521' into Release_2_8_2_Branch
[jalview.git] / src / jalview / gui / WsPreferences.java
index d4663a2..876d157 100644 (file)
@@ -6,14 +6,16 @@
  * 
  * Jalview is free software: you can redistribute it and/or
  * modify it under the terms of the GNU General Public License 
- * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
  *  
  * Jalview is distributed in the hope that it will be useful, but 
  * WITHOUT ANY WARRANTY; without even the implied warranty 
  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
  * PURPOSE.  See the GNU General Public License for more details.
  * 
- * You should have received a copy of the GNU General Public License along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
  * The Jalview Authors are detailed in the 'AUTHORS' file.
  */
 package jalview.gui;
@@ -123,7 +125,7 @@ public class WsPreferences extends GWsPreferences
     }
 
     wsList.setModel(new WsUrlTableModel(tdat));
-    wsList.getColumn("Status").setMinWidth(10);
+    wsList.getColumn(MessageManager.getString("label.status")).setMinWidth(10);
   }
 
   private class JabaWSStatusRenderer extends JPanel implements
@@ -182,6 +184,8 @@ public class WsPreferences extends GWsPreferences
   {
 
     private Object[][] data;
+    private String[] columnNames = new String[]
+    { MessageManager.getString("label.service_url"), MessageManager.getString("label.status") };
 
     public WsUrlTableModel(Object[][] tdat)
     {
@@ -197,11 +201,7 @@ public class WsPreferences extends GWsPreferences
     @Override
     public String getColumnName(int column)
     {
-      if (column == 1)
-      {
-        return "Status";
-      }
-      return "Service URL";
+        return columnNames[column];
     }
 
     @Override
@@ -274,7 +274,7 @@ public class WsPreferences extends GWsPreferences
     int sel = wsList.getSelectedRow();
     if (sel > -1)
     {
-      String url = editUrl(wsUrls.elementAt(sel), "Edit JABAWS URL");
+      String url = editUrl(wsUrls.elementAt(sel), MessageManager.getString("label.edit_jabaws_url"));
       if (url != null)
       {
         int present = wsUrls.indexOf(url);
@@ -300,7 +300,7 @@ public class WsPreferences extends GWsPreferences
   protected void newSbrsUrl_actionPerformed(ActionEvent e)
   {
     RestServiceEditorPane rse = new RestServiceEditorPane();
-    rse.showDialog("Add a new Simple Bioinformatics Rest Service");
+    rse.showDialog(MessageManager.getString("label.add_new_sbrs_service"));
     String rservice = rse.getEditedRestService();
     if (rservice != null && !rsbsUrls.contains(rservice))
     {
@@ -318,7 +318,7 @@ public class WsPreferences extends GWsPreferences
     {
       RestServiceEditorPane rse = new RestServiceEditorPane(
               new RestServiceDescription(rsbsUrls.elementAt(sel)));
-      rse.showDialog("Edit Simple Bioinformatics Rest Service entry");
+      rse.showDialog(MessageManager.getString("label.edit_sbrs_entry"));
       String rservice = rse.getEditedRestService();
       if (rservice != null)
       {
@@ -447,7 +447,8 @@ public class WsPreferences extends GWsPreferences
     JTextField urltf = new JTextField(url, 40);
     JPanel panel = new JPanel(new BorderLayout());
     JPanel pane12 = new JPanel(new BorderLayout());
-    pane12.add(new JLabel(MessageManager.getString("label.url")), BorderLayout.CENTER);
+    pane12.add(new JLabel(MessageManager.getString("label.url")),
+            BorderLayout.CENTER);
     pane12.add(urltf, BorderLayout.EAST);
     panel.add(pane12, BorderLayout.NORTH);
     boolean valid = false;
@@ -481,8 +482,8 @@ public class WsPreferences extends GWsPreferences
       int validate = JOptionPane
               .showInternalConfirmDialog(
                       Desktop.desktop,
-                      "Validate JabaWS Server ?\n(Look in console output for results)",
-                      "Test Server?", JOptionPane.YES_NO_OPTION);
+                      MessageManager.getString("info.validate_jabaws_server"),
+                      MessageManager.getString("label.test_server"), JOptionPane.YES_NO_OPTION);
       if (validate == JOptionPane.OK_OPTION)
       {
         if (jalview.ws.jws2.Jws2Discoverer.testServiceUrl(foo))
@@ -494,7 +495,7 @@ public class WsPreferences extends GWsPreferences
           JOptionPane
                   .showInternalMessageDialog(
                           Desktop.desktop,
-                          "Service did not pass validation.\nCheck the Jalview Console for more details.");
+                          MessageManager.getString("warn.server_didnt_pass_validation"));
         }
       }
       else
@@ -515,7 +516,7 @@ public class WsPreferences extends GWsPreferences
   @Override
   protected void newWsUrl_actionPerformed(ActionEvent e)
   {
-    String url = editUrl(null, "Add new JABAWS URL");
+    String url = editUrl(null, MessageManager.getString("label.add_jabaws_url"));
     if (url != null)
     {
       if (!wsUrls.contains(url))
@@ -600,7 +601,7 @@ public class WsPreferences extends GWsPreferences
         public void run()
         {
           long ct = System.currentTimeMillis();
-          Desktop.instance.setProgressBar("Refreshing Web Service Menus",
+          Desktop.instance.setProgressBar(MessageManager.getString("status.refreshing_web_service_menus"),
                   ct);
           if (lastrefresh != update)
           {