Ignore:
Timestamp:
2014-08-30T13:42:09+02:00 (10 years ago)
Author:
donvip
Message:

[josm_openinghours] fix #josm10402 - change key text field by a combo box with known values, defaulting to opening_hours

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/OpeningHoursEditor/src/org/openstreetmap/josm/plugins/ohe/OhePlugin.java

    r30114 r30609  
    2222import javax.swing.ButtonGroup;
    2323import javax.swing.JCheckBox;
     24import javax.swing.JComboBox;
    2425import javax.swing.JDialog;
    2526import javax.swing.JLabel;
     
    2930import javax.swing.JScrollPane;
    3031import javax.swing.JTable;
    31 import javax.swing.JTextField;
    3232import javax.swing.ListSelectionModel;
    3333import javax.swing.table.DefaultTableCellRenderer;
     
    195195            sp.setViewportView(propertyTable);
    196196
    197             final JTextField newTagField = new JTextField();
     197            final JComboBox<String> newTagField = new JComboBox<>(new String[]{
     198                    "opening_hours", "collection_times", "collection_times:local", "service_times", "lit"});
    198199
    199200            JRadioButton editButton = new JRadioButton(new AbstractAction(tr("edit existing tag")) {
     
    250251                propertyTable.setEnabled(false);
    251252                newTagField.setEnabled(true);
    252                 newTagField.setText(preSelectedKey);
     253                newTagField.setSelectedItem(preSelectedKey);
    253254                newButton.setSelected(true);
    254255            }
     
    284285                    valuesToEdit = propertyData.getValueAt(propertyTable.getSelectedRow(), 1);
    285286                } else if (newButton.isSelected()) {
    286                     keyToEdit = newTagField.getText();
     287                    keyToEdit = newTagField.getSelectedItem().toString();
    287288                }
    288289            if (keyToEdit == null)
Note: See TracChangeset for help on using the changeset viewer.