Ignore:
Timestamp:
2012-08-11T23:03:55+02:00 (12 years ago)
Author:
Don-vip
Message:

fix #7917 - Control the number of items displayed at once in all comboboxes (20 by default, configurable with gui.combobox.maximum-row-count)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java

    r5405 r5429  
    1010import java.awt.Font;
    1111import java.awt.GridBagLayout;
    12 import java.awt.Image;
    1312import java.awt.Insets;
    1413import java.awt.event.ActionEvent;
     
    3635import javax.swing.Action;
    3736import javax.swing.ImageIcon;
    38 import javax.swing.JComboBox;
    3937import javax.swing.JComponent;
    4038import javax.swing.JLabel;
     
    7472import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionList;
    7573import org.openstreetmap.josm.gui.util.GuiHelper;
     74import org.openstreetmap.josm.gui.widgets.JosmComboBox;
    7675import org.openstreetmap.josm.io.MirroredInputStream;
    7776import org.openstreetmap.josm.tools.GBC;
     
    396395            } else {
    397396                // the objects have different values
    398                 JComboBox comboBox = new JComboBox(usage.values.toArray());
     397                JosmComboBox comboBox = new JosmComboBox(usage.values.toArray());
    399398                comboBox.setEditable(true);
    400399                comboBox.setEditor(textField);
     
    421420
    422421            // return if unchanged
    423             String v = (value instanceof JComboBox)
    424                     ? ((JComboBox) value).getEditor().getItem().toString()
     422            String v = (value instanceof JosmComboBox)
     423                    ? ((JosmComboBox) value).getEditor().getItem().toString()
    425424                            : ((JTextField) value).getText();
    426425                    v = v.trim();
     
    800799
    801800        public boolean editable = true;
    802         protected JComboBox combo;
     801        protected JosmComboBox combo;
    803802
    804803        public Combo() {
     
    820819            lhm.put("", new PresetListEntry(""));
    821820
    822             combo = new JComboBox(lhm.values().toArray());
     821            combo = new JosmComboBox(lhm.values().toArray());
    823822            component = combo;
    824823            combo.setRenderer(getListCellRenderer());
    825824            combo.setEditable(editable);
    826             combo.setMaximumRowCount(13);
     825            //combo.setMaximumRowCount(13);
    827826            AutoCompletingTextField tf = new AutoCompletingTextField();
    828827            initAutoCompletionField(tf, key);
Note: See TracChangeset for help on using the changeset viewer.