source: josm/src/org/openstreetmap/josm/gui/preferences/CsvPreference.java@ 319

Last change on this file since 319 was 319, checked in by imi, 17 years ago
  • removed MinML2 dependency (use javax.xml)
  • fixed reorder action (thanks Robert)
  • added backup files before saving (thanks Dave)
  • added search for last modifying user (thanks Dave)
  • fixed import of plugin list and added author field (thanks Shaun)
File size: 1.5 KB
Line 
1// License: GPL. Copyright 2007 by Immanuel Scholz and others
2package org.openstreetmap.josm.gui.preferences;
3
4import static org.openstreetmap.josm.tools.I18n.tr;
5
6import javax.swing.JLabel;
7import javax.swing.JTextField;
8
9import org.openstreetmap.josm.Main;
10import org.openstreetmap.josm.tools.GBC;
11
12public class CsvPreference implements PreferenceSetting {
13
14 /**
15 * Comma seperated import string specifier or <code>null</code> if the first
16 * data line should be interpreted as one.
17 */
18 private JTextField csvImportString = new JTextField(20);
19
20 public void addGui(PreferenceDialog gui) {
21 csvImportString.setText(Main.pref.get("csv.importstring"));
22 csvImportString.setToolTipText(tr("<html>Import string specification. lat/lon and time are imported.<br>" +
23 "<b>lat</b>: The latitude coordinate<br>" +
24 "<b>lon</b>: The longitude coordinate<br>" +
25 "<b>time</b>: The measured time as string<br>" +
26 "<b>ignore</b>: Skip this field<br>" +
27 "An example: \"ignore ignore lat lon\" will use ' ' as delimiter, skip the first two values and read then lat/lon.<br>" +
28 "Other example: \"lat,lon\" will just read lat/lon values comma seperated.</html>"));
29
30 gui.connection.add(new JLabel(tr("CSV import specification (empty: read from first line in data)")), GBC.eol());
31 gui.connection.add(csvImportString, GBC.eop().fill(GBC.HORIZONTAL));
32 }
33
34 public void ok() {
35 Main.pref.put("csv.importstring", csvImportString.getText());
36 }
37
38}
Note: See TracBrowser for help on using the repository browser.