Ignore:
Timestamp:
2013-12-07T14:47:47+01:00 (10 years ago)
Author:
Don-vip
Message:

fix #9360 - listed Values in Enhanced Preferences cannot be removed completely

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/preferences/advanced/ListEditor.java

    r6021 r6452  
    2121import org.openstreetmap.josm.gui.widgets.JosmTextField;
    2222import org.openstreetmap.josm.tools.GBC;
     23import org.openstreetmap.josm.tools.Predicate;
     24import org.openstreetmap.josm.tools.Utils;
    2325import org.openstreetmap.josm.tools.WindowGeometry;
    2426
     
    2830    PrefEntry entry;
    2931
     32    /**
     33     * Constructs a new {@code ListEditor}.
     34     */
    3035    public ListEditor(final JComponent gui, PrefEntry entry, ListSetting setting) {
    3136        super(gui, tr("Change list setting"), new String[] {tr("OK"), tr("Cancel")});
     
    4247    }
    4348
     49    /**
     50     * Returns the list of values.
     51     * @return The list of values.
     52     */
    4453    public List<String> getData() {
    45         return data;
     54        return new ArrayList<String>(Utils.filter(data, new Predicate<String>() {
     55            @Override
     56            public boolean evaluate(String object) {
     57                return object != null && !object.isEmpty();
     58            }
     59        }));
    4660    }
    4761
     
    101115        }
    102116    }
    103 
    104117}
Note: See TracChangeset for help on using the changeset viewer.