From: kjvdheide Date: Mon, 20 Nov 2017 09:35:38 +0000 (+0000) Subject: JAL-281 added history box to tree url input window X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=505eeec74632afc5922d48c837d8fa14be0a8857;p=jalview.git JAL-281 added history box to tree url input window --- diff --git a/src/jalview/gui/AlignFrame.java b/src/jalview/gui/AlignFrame.java index 3d9e0bb..2040897 100644 --- a/src/jalview/gui/AlignFrame.java +++ b/src/jalview/gui/AlignFrame.java @@ -101,6 +101,8 @@ import jalview.ws.seqfetcher.DbSourceProxy; import java.awt.BorderLayout; import java.awt.Component; +import java.awt.Dimension; +import java.awt.GridLayout; import java.awt.Rectangle; import java.awt.Toolkit; import java.awt.datatransfer.Clipboard; @@ -135,14 +137,18 @@ import java.util.Deque; import java.util.Enumeration; import java.util.Hashtable; import java.util.List; +import java.util.StringTokenizer; import java.util.Vector; import javax.swing.JCheckBoxMenuItem; +import javax.swing.JComboBox; import javax.swing.JEditorPane; import javax.swing.JInternalFrame; +import javax.swing.JLabel; import javax.swing.JLayeredPane; import javax.swing.JMenu; import javax.swing.JMenuItem; +import javax.swing.JPanel; import javax.swing.JScrollPane; import javax.swing.SwingUtilities; @@ -3904,8 +3910,32 @@ public void chooseTreeFile() { { URL treeUrl; + JLabel label = new JLabel( + MessageManager.getString("label.tree_url_example")); + final JComboBox history = new JComboBox<>(); + + JPanel panel = new JPanel(new GridLayout(2, 1)); + panel.add(label); + panel.add(history); + history.setPreferredSize(new Dimension(400, 20)); + history.setEditable(true); + history.addItem("http://www."); + + String historyItems = jalview.bin.Cache.getProperty("RECENT_URL"); + + StringTokenizer st; + + if (historyItems != null) + { + st = new StringTokenizer(historyItems, "\t"); + + while (st.hasMoreTokens()) + { + history.addItem(st.nextToken()); + } + } String urlString = JvOptionPane.showInputDialog(this, - MessageManager.getString("label.tree_url_example"), + panel, MessageManager.getString("label.load_tree_url"), JvOptionPane.QUESTION_MESSAGE); if ((urlString != null) && (!urlString.isEmpty())) @@ -3929,6 +3959,8 @@ public void chooseTreeFile() { } + + // final String url_string = JOptionPane // .showInputDialog( this, // message,