- Timestamp:
- 2022-05-04T20:34:54+02:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/projection/CustomProjectionChoice.java
r18365 r18438 17 17 import javax.swing.JLabel; 18 18 import javax.swing.JPanel; 19 import javax.swing.plaf.basic.BasicComboBoxEditor;20 19 21 20 import org.openstreetmap.josm.data.projection.CustomProjection; … … 24 23 import org.openstreetmap.josm.data.projection.Projections; 25 24 import org.openstreetmap.josm.gui.ExtendedDialog; 26 import org.openstreetmap.josm.gui.tagging.ac.AutoCompTextField;27 25 import org.openstreetmap.josm.gui.widgets.AbstractTextComponentValidator; 28 26 import org.openstreetmap.josm.gui.widgets.HistoryComboBox; 29 27 import org.openstreetmap.josm.gui.widgets.HtmlPanel; 30 import org.openstreetmap.josm.gui.widgets.JosmTextField;31 28 import org.openstreetmap.josm.tools.GBC; 32 29 import org.openstreetmap.josm.tools.ImageProvider; … … 54 51 private static class PreferencePanel extends JPanel { 55 52 56 public AutoCompTextField<String> input;57 53 private HistoryComboBox cbInput; 58 54 … … 62 58 63 59 private void build(String initialText, final ActionListener listener) { 64 input = new AutoCompTextField<>(30);65 60 cbInput = new HistoryComboBox(); 66 cbInput.setEditor(new BasicComboBoxEditor() { 67 @Override 68 protected JosmTextField createEditorComponent() { 69 return input; 70 } 71 }); 61 cbInput.getEditorComponent().setColumns(30); 72 62 List<String> samples = Arrays.asList( 73 63 "+proj=lonlat +ellps=WGS84 +datum=WGS84 +bounds=-180,-90,180,90", … … 81 71 valStatus.setVisible(false); 82 72 83 final AbstractTextComponentValidator val = new AbstractTextComponentValidator( input, false, false, false) {73 final AbstractTextComponentValidator val = new AbstractTextComponentValidator(cbInput.getEditorComponent(), false, false, false) { 84 74 85 75 private String error; … … 99 89 try { 100 90 CustomProjection test = new CustomProjection(); 101 test.update( input.getText());91 test.update(cbInput.getEditorComponent().getText()); 102 92 } catch (ProjectionConfigurationException ex) { 103 93 Logging.warn(ex); … … 222 212 } 223 213 PreferencePanel prefPanel = (PreferencePanel) panel; 224 String pref = prefPanel. input.getText();214 String pref = prefPanel.cbInput.getEditorComponent().getText(); 225 215 prefPanel.rememberHistory(); 226 216 return Collections.singleton(pref);
Note:
See TracChangeset
for help on using the changeset viewer.