Changeset 104 in josm for src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java
- Timestamp:
- 2006-07-03T00:31:24+02:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/org/openstreetmap/josm/gui/dialogs/SelectionListDialog.java
r103 r104 1 1 package org.openstreetmap.josm.gui.dialogs; 2 3 import static org.openstreetmap.josm.tools.I18n.tr; 2 4 3 5 import java.awt.BorderLayout; … … 53 55 */ 54 56 public class SelectionListDialog extends ToggleDialog implements SelectionChangedListener { 55 56 57 public static enum SearchMode {replace, add, remove} 57 58 … … 62 63 private OsmIdReader idReader = new OsmIdReader(); 63 64 public SelectionWebsiteLoader(String urlStr, SearchMode mode) { 64 super( "Load Selection");65 super(tr("Load Selection")); 65 66 this.mode = mode; 66 67 URL u = null; … … 69 70 } 70 71 @Override protected void realRun() { 71 currentAction.setText( "Contact "+url.getHost()+"...");72 currentAction.setText(tr("Contact {0}...", url.getHost())); 72 73 sel = mode != SearchMode.remove ? new LinkedList<OsmPrimitive>() : Main.ds.allNonDeletedPrimitives(); 73 74 try { 74 75 URLConnection con = url.openConnection(); 75 76 InputStream in = new ProgressReader(con, progress, currentAction); 76 currentAction.setText( "Downloading...");77 currentAction.setText(tr("Downloading...")); 77 78 Map<Long, String> ids = idReader.parseIds(in); 78 79 for (OsmPrimitive osm : Main.ds.allNonDeletedPrimitives()) { … … 86 87 } catch (IOException e) { 87 88 e.printStackTrace(); 88 JOptionPane.showMessageDialog(Main.parent, "Could not read from url: '"+url+"'");89 JOptionPane.showMessageDialog(Main.parent, tr("Could not read from url: '{0}'",url)); 89 90 } catch (SAXException e) { 90 91 e.printStackTrace(); 91 JOptionPane.showMessageDialog(Main.parent, "Parsing error in url: '"+url+"'");92 JOptionPane.showMessageDialog(Main.parent,tr("Parsing error in url: '{0}'",url)); 92 93 } 93 94 } … … 116 117 */ 117 118 public SelectionListDialog(MapFrame mapFrame) { 118 super( "Current Selection", "selectionlist", "Open a selection list window.", KeyEvent.VK_E);119 super(tr("Current Selection"), "selectionlist", tr("Open a selection list window."), KeyEvent.VK_E); 119 120 setPreferredSize(new Dimension(320,150)); 120 121 displaylist.setCellRenderer(new OsmPrimitivRenderer()); … … 132 133 JPanel buttonPanel = new JPanel(new GridLayout(1,2)); 133 134 134 JButton button = new JButton( "Select", ImageProvider.get("mapmode", "selection"));135 button.setToolTipText( "Set the selected elements on the map to the selected items in the list above.");135 JButton button = new JButton(tr("Select"), ImageProvider.get("mapmode/selection/select")); 136 button.setToolTipText(tr("Set the selected elements on the map to the selected items in the list above.")); 136 137 button.addActionListener(new ActionListener(){ 137 138 public void actionPerformed(ActionEvent e) { … … 141 142 buttonPanel.add(button); 142 143 143 button = new JButton( "Reload", ImageProvider.get("dialogs", "refresh"));144 button.setToolTipText( "Refresh the selection list.");144 button = new JButton(tr("Reload"), ImageProvider.get("dialogs", "refresh")); 145 button.setToolTipText(tr("Refresh the selection list.")); 145 146 button.addActionListener(new ActionListener(){ 146 147 public void actionPerformed(ActionEvent e) { … … 150 151 buttonPanel.add(button); 151 152 152 button = new JButton( "Search", ImageProvider.get("dialogs", "search"));153 button.setToolTipText( "Search for objects.");153 button = new JButton(tr("Search"), ImageProvider.get("dialogs", "search")); 154 button.setToolTipText(tr("Search for objects.")); 154 155 button.addActionListener(new ActionListener(){ 155 156 private String lastSearch = ""; 156 157 public void actionPerformed(ActionEvent e) { 157 JLabel label = new JLabel( "Please enter a search string.");158 JLabel label = new JLabel(tr("Please enter a search string.")); 158 159 final JTextField input = new JTextField(lastSearch); 159 input.setToolTipText( "<html>Fulltext search.<ul>" +160 input.setToolTipText(tr("<html>Fulltext search.<ul>" + 160 161 "<li><code>Baker Street</code> - 'Baker' and 'Street' in any key or name.</li>" + 161 162 "<li><code>\"Baker Street\"</code> - 'Baker Street' in any key or name.</li>" + … … 163 164 "<li><code>-name:Bak</code> - not 'Bak' in the name.</li>" + 164 165 "<li><code>foot:</code> - key=foot set to any value." + 165 "</ul></html>") ;166 167 JRadioButton replace = new JRadioButton( "replace selection", true);168 JRadioButton add = new JRadioButton( "add to selection", false);169 JRadioButton remove = new JRadioButton( "remove from selection", false);166 "</ul></html>")); 167 168 JRadioButton replace = new JRadioButton(tr("replace selection"), true); 169 JRadioButton add = new JRadioButton(tr("add to selection"), false); 170 JRadioButton remove = new JRadioButton(tr("remove from selection"), false); 170 171 ButtonGroup bg = new ButtonGroup(); 171 172 bg.add(replace); … … 184 185 } 185 186 }; 186 pane.createDialog(Main.parent, "Search").setVisible(true);187 pane.createDialog(Main.parent,tr("Search")).setVisible(true); 187 188 if (!Integer.valueOf(JOptionPane.OK_OPTION).equals(pane.getValue())) 188 189 return;
Note:
See TracChangeset
for help on using the changeset viewer.