JAL-3446 no actual changes; just using meaningful frame options
[jalview.git] / src / jalview / gui / SequenceFetcher.java
index 323fef9..3d09f99 100755 (executable)
@@ -145,8 +145,8 @@ public class SequenceFetcher extends JPanel implements Runnable
 
     frame = new JInternalFrame();
     frame.setContentPane(this);
-    Desktop.addInternalFrame(frame, getFrameTitle(), true, 400, 
-               Platform.isAMacAndNotJS() ? 240 : 180);
+    Desktop.addInternalFrame(frame, getFrameTitle(), Desktop.FRAME_MAKE_VISIBLE, 400, 
+               Platform.isAMacAndNotJS() ? 240 : 180, Desktop.FRAME_ALLOW_RESIZE, Desktop.FRAME_SET_MIN_SIZE_300);
   }
 
   private String getFrameTitle()
@@ -417,8 +417,8 @@ public class SequenceFetcher extends JPanel implements Runnable
     /*
      * tidy inputs and check there is something to search for
      */
-    String text = textArea.getText();
-    final String t0 = text;
+    String t0 = textArea.getText();
+    String text = t0.trim();
     if (replacePunctuation.isEnabled() && replacePunctuation.isSelected())
     {
       text = text.replace(",", ";");
@@ -436,6 +436,14 @@ public class SequenceFetcher extends JPanel implements Runnable
       resetDialog();
       return;
     }
+    if (database.getSelectedIndex() == 0)
+    {
+      // todo i18n
+      showErrorMessage("Please choose a database");
+      resetDialog();
+      return;
+    }
+
     exampleBtn.setEnabled(false);
     textArea.setEnabled(false);
     okBtn.setEnabled(false);
@@ -860,7 +868,7 @@ public class SequenceFetcher extends JPanel implements Runnable
       @Override
       public void run()
       {
-        JvOptionPane.showInternalMessageDialog(Desktop.desktop, error,
+        JvOptionPane.showInternalMessageDialog(Desktop.getDesktopPane(), error,
                 MessageManager.getString("label.error_retrieving_data"),
                 JvOptionPane.WARNING_MESSAGE);
       }