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)

Location:
trunk/src/org/openstreetmap/josm/gui/preferences/display
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/preferences/display/GPXSettingsPanel.java

    r4968 r5429  
    1313import javax.swing.ButtonGroup;
    1414import javax.swing.JCheckBox;
    15 import javax.swing.JComboBox;
    1615import javax.swing.JLabel;
    1716import javax.swing.JOptionPane;
     
    2726import org.openstreetmap.josm.gui.layer.markerlayer.Marker.TemplateEntryProperty;
    2827import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane.ValidationListener;
     28import org.openstreetmap.josm.gui.widgets.JosmComboBox;
    2929import org.openstreetmap.josm.tools.GBC;
    3030import org.openstreetmap.josm.tools.template_engine.ParseError;
     
    5858    private JRadioButton colorTypeNone = new JRadioButton(tr("Single Color (can be customized for named layers)"));
    5959    private JRadioButton colorTypeGlobal  = new JRadioButton(tr("Use global settings"));
    60     private JComboBox colorTypeVelocityTune = new JComboBox(new String[] {tr("Car"), tr("Bicycle"), tr("Foot")});
     60    private JosmComboBox colorTypeVelocityTune = new JosmComboBox(new String[] {tr("Car"), tr("Bicycle"), tr("Foot")});
    6161    private JCheckBox makeAutoMarkers = new JCheckBox(tr("Create markers when reading GPX"));
    6262    private JCheckBox drawGpsArrows = new JCheckBox(tr("Draw Direction Arrows"));
     
    6464    private JTextField drawGpsArrowsMinDist = new JTextField(8);
    6565    private JCheckBox colorDynamic = new JCheckBox(tr("Dynamic color range based on data limits"));
    66     private JComboBox waypointLabel = new JComboBox(LABEL_PATTERN_DESC);
     66    private JosmComboBox waypointLabel = new JosmComboBox(LABEL_PATTERN_DESC);
    6767    private JTextField waypointLabelPattern = new JTextField();
    68     private JComboBox audioWaypointLabel = new JComboBox(LABEL_PATTERN_DESC);
     68    private JosmComboBox audioWaypointLabel = new JosmComboBox(LABEL_PATTERN_DESC);
    6969    private JTextField audioWaypointLabelPattern = new JTextField();
    7070
     
    414414    }
    415415
    416     private void updateWaypointLabelCombobox(JComboBox cb, JTextField tf, TemplateEntryProperty property) {
     416    private void updateWaypointLabelCombobox(JosmComboBox cb, JTextField tf, TemplateEntryProperty property) {
    417417        String labelPattern = property.getAsString();
    418418        boolean found = false;
     
    431431    }
    432432
    433     private void updateWaypointPattern(JComboBox cb, JTextField tf) {
     433    private void updateWaypointPattern(JosmComboBox cb, JTextField tf) {
    434434        if (cb.getSelectedIndex() == WAYPOINT_LABEL_CUSTOM) {
    435435            tf.setEnabled(true);
  • trunk/src/org/openstreetmap/josm/gui/preferences/display/LafPreference.java

    r4968 r5429  
    1111import javax.swing.DefaultListCellRenderer;
    1212import javax.swing.JCheckBox;
    13 import javax.swing.JComboBox;
    1413import javax.swing.JLabel;
    1514import javax.swing.JList;
     
    2726import org.openstreetmap.josm.gui.preferences.SubPreferenceSetting;
    2827import org.openstreetmap.josm.gui.preferences.TabPreferenceSetting;
     28import org.openstreetmap.josm.gui.widgets.JosmComboBox;
    2929import org.openstreetmap.josm.tools.GBC;
    3030
     
    4040     * ComboBox with all look and feels.
    4141     */
    42     private JComboBox lafCombo;
     42    private JosmComboBox lafCombo;
    4343    public JPanel panel;
    4444    private JCheckBox showSplashScreen = new JCheckBox(tr("Show splash screen at startup"));
     
    4949
    5050    public void addGui(PreferenceTabbedPane gui) {
    51         lafCombo = new JComboBox(UIManager.getInstalledLookAndFeels());
     51        lafCombo = new JosmComboBox(UIManager.getInstalledLookAndFeels());
    5252
    5353        // let's try to load additional LookAndFeels and put them into the list
  • trunk/src/org/openstreetmap/josm/gui/preferences/display/LanguagePreference.java

    r4968 r5429  
    1313import javax.swing.DefaultComboBoxModel;
    1414import javax.swing.DefaultListCellRenderer;
    15 import javax.swing.JComboBox;
    1615import javax.swing.JLabel;
    1716import javax.swing.JList;
     
    2524import org.openstreetmap.josm.gui.preferences.SubPreferenceSetting;
    2625import org.openstreetmap.josm.gui.preferences.TabPreferenceSetting;
     26import org.openstreetmap.josm.gui.widgets.JosmComboBox;
    2727import org.openstreetmap.josm.tools.GBC;
    2828import org.openstreetmap.josm.tools.I18n;
     
    3636
    3737    /** the combo box with the available locales */
    38     private JComboBox langCombo;
     38    private JosmComboBox langCombo;
    3939    /** the model for the combo box */
    4040    private LanguageComboBoxModel model;
     
    4545        // See http://stackoverflow.com/questions/3194958/fast-replacement-for-jcombobox-basiccomboboxui
    4646        model.selectLanguage(Main.pref.get("language"));
    47         langCombo = new JComboBox(model);
     47        langCombo = new JosmComboBox(model);
    4848        langCombo.setRenderer(new LanguageCellRenderer(langCombo.getRenderer()));
    4949
Note: See TracChangeset for help on using the changeset viewer.