Changeset 7931 in josm for trunk/src/org


Ignore:
Timestamp:
2015-01-07T00:44:39+01:00 (10 years ago)
Author:
Don-vip
Message:

fix #10941 - fix handling of rows attribute for multiselect preset item

File:
1 edited

Legend:

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

    r7811 r7931  
    13271327    public static class MultiSelect extends ComboMultiSelect {
    13281328
    1329         public long rows = -1;
     1329        /**
     1330         * Number of rows to display (positive integer, optional).
     1331         */
     1332        public String rows;
    13301333        protected ConcatenatingJList list;
    13311334
     
    13541357            // if a number of rows has been specified in the preset,
    13551358            // modify preferred height of scroll pane to match that row count.
    1356             if (rows != -1) {
     1359            if (rows != null) {
    13571360                double height = renderer.getListCellRendererComponent(list,
    1358                         new PresetListEntry("x"), 0, false, false).getPreferredSize().getHeight() * rows;
     1361                        new PresetListEntry("x"), 0, false, false).getPreferredSize().getHeight() * Integer.valueOf(rows);
    13591362                sp.setPreferredSize(new Dimension((int) sp.getPreferredSize().getWidth(), (int) height));
    13601363            }
Note: See TracChangeset for help on using the changeset viewer.