- Timestamp:
- 2017-09-26T21:52:28+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/download
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/download/DownloadDialog.java
r12900 r12903 365 365 public void rememberSettings() { 366 366 DOWNLOAD_TAB.put(tpDownloadAreaSelectors.getSelectedIndex()); 367 downloadSourcesTab.getAllPanels().forEach(AbstractDownloadSourcePanel::rememberSettings); 367 368 downloadSourcesTab.getSelectedPanel().ifPresent(panel -> DOWNLOAD_SOURCE_TAB.put(panel.getSimpleName())); 368 369 DOWNLOAD_NEWLAYER.put(cbNewLayer.isSelected()); -
trunk/src/org/openstreetmap/josm/gui/download/OverpassDownloadSource.java
r12900 r12903 8 8 import java.awt.GridBagLayout; 9 9 import java.awt.event.ActionEvent; 10 import java.awt.event.FocusAdapter; 10 11 import java.awt.event.FocusEvent; 11 import java.awt.event.FocusListener;12 12 import java.util.Collection; 13 13 import java.util.concurrent.Future; … … 15 15 16 16 import javax.swing.AbstractAction; 17 import javax.swing.Action;18 17 import javax.swing.Icon; 19 18 import javax.swing.JButton; … … 32 31 import org.openstreetmap.josm.data.preferences.BooleanProperty; 33 32 import org.openstreetmap.josm.data.preferences.IntegerProperty; 33 import org.openstreetmap.josm.data.preferences.StringProperty; 34 34 import org.openstreetmap.josm.gui.ConditionalOptionPaneUtil; 35 35 import org.openstreetmap.josm.gui.MainApplication; … … 90 90 private static final String ACTION_IMG_SUBDIR = "dialogs"; 91 91 92 private static final StringProperty DOWNLOAD_QUERY = new StringProperty("download.overpass.query", 93 "/*\n" + tr("Place your Overpass query below or generate one using the Overpass Turbo Query Wizard") + "\n*/"); 94 92 95 private final JosmTextArea overpassQuery; 93 96 private final UserQueryList overpassQueryList; … … 102 105 103 106 String tooltip = tr("Build an Overpass query using the Overpass Turbo Query Wizard tool"); 104 Action queryWizardAction = new AbstractAction() { 107 108 JButton openQueryWizard = new JButton(tr("Query Wizard")); 109 openQueryWizard.setToolTipText(tooltip); 110 openQueryWizard.addActionListener(new AbstractAction() { 105 111 @Override 106 112 public void actionPerformed(ActionEvent e) { 107 113 new OverpassQueryWizardDialog(OverpassDownloadSourcePanel.this).showDialog(); 108 114 } 109 }; 110 111 JButton openQueryWizard = new JButton(tr("Query Wizard")); 112 openQueryWizard.setToolTipText(tooltip); 113 openQueryWizard.addActionListener(queryWizardAction); 114 115 // CHECKSTYLE.OFF: LineLength 116 this.overpassQuery = new JosmTextArea( 117 "/*\n" + 118 tr("Place your Overpass query below or generate one using the Overpass Turbo Query Wizard") 119 + "\n*/", 120 8, 80); 121 // CHECKSTYLE.ON: LineLength 115 }); 116 117 this.overpassQuery = new JosmTextArea(DOWNLOAD_QUERY.get(), 8, 80); 122 118 this.overpassQuery.setFont(GuiHelper.getMonospacedFont(overpassQuery)); 123 this.overpassQuery.addFocusListener(new Focus Listener() {119 this.overpassQuery.addFocusListener(new FocusAdapter() { 124 120 @Override 125 121 public void focusGained(FocusEvent e) { 126 122 overpassQuery.selectAll(); 127 123 } 128 129 @Override130 public void focusLost(FocusEvent e) {131 // ignored132 }133 124 }); 134 135 125 136 126 this.overpassQueryList = new UserQueryList(this, this.overpassQuery, "download.overpass.query"); … … 207 197 @Override 208 198 public void rememberSettings() { 209 // nothing199 DOWNLOAD_QUERY.put(overpassQuery.getText()); 210 200 } 211 201 212 202 @Override 213 203 public void restoreSettings() { 214 // nothing204 overpassQuery.setText(DOWNLOAD_QUERY.get()); 215 205 } 216 206 -
trunk/src/org/openstreetmap/josm/gui/download/OverpassQueryWizardDialog.java
r12841 r12903 9 9 import java.util.Arrays; 10 10 import java.util.Collections; 11 import java.util.List; 11 12 import java.util.Optional; 12 13 … … 89 90 panel.add(scroll, GBC.eol().fill(GBC.BOTH).anchor(GBC.CENTER)); 90 91 91 queryWizard.setPossibleItems(OVERPASS_WIZARD_HISTORY.get()); 92 List<String> items = OVERPASS_WIZARD_HISTORY.get(); 93 Collections.reverse(items); 94 queryWizard.setPossibleItems(items); 95 if (!items.isEmpty()) { 96 queryWizard.setText(items.get(0)); 97 } 92 98 93 99 setCancelButton(CANCEL + 1);
Note:
See TracChangeset
for help on using the changeset viewer.