Ticket #12454: PreferencesSetDefaultValues.2.patch

File PreferencesSetDefaultValues.2.patch, 3.7 KB (added by kolesar, 5 years ago)
  • src/org/openstreetmap/josm/data/preferences/BooleanProperty.java

    diff --git a/src/org/openstreetmap/josm/data/preferences/BooleanProperty.java b/src/org/openstreetmap/josm/data/preferences/BooleanProperty.java
    index 3e466f0..578edca 100644
    a b public class BooleanProperty extends AbstractProperty<Boolean> { 
    1515     */
    1616    public BooleanProperty(String key, boolean defaultValue) {
    1717        super(key, defaultValue);
     18        if (Main.pref != null) {
     19            get();
     20        }
    1821    }
    1922
    2023    @Override
  • src/org/openstreetmap/josm/data/preferences/CollectionProperty.java

    diff --git a/src/org/openstreetmap/josm/data/preferences/CollectionProperty.java b/src/org/openstreetmap/josm/data/preferences/CollectionProperty.java
    index dabd3c7..0b5c854 100644
    a b public class CollectionProperty extends AbstractProperty<Collection<String>> { 
    1717     */
    1818    public CollectionProperty(String key, Collection<String> defaultValue) {
    1919        super(key, defaultValue);
     20        if (Main.pref != null) {
     21            get();
     22        }
    2023    }
    2124
    2225    @Override
  • src/org/openstreetmap/josm/data/preferences/ColorProperty.java

    diff --git a/src/org/openstreetmap/josm/data/preferences/ColorProperty.java b/src/org/openstreetmap/josm/data/preferences/ColorProperty.java
    index 8c1794b..b597bb2 100644
    a b public class ColorProperty extends AbstractProperty<Color> implements ColorKey { 
    2323    public ColorProperty(String colName, Color defaultValue) {
    2424        super(getColorKey(colName), defaultValue);
    2525        this.name = colName;
     26        if (Main.pref != null) {
     27            get();
     28        }
    2629    }
    2730
    2831    @Override
  • src/org/openstreetmap/josm/data/preferences/IntegerProperty.java

    diff --git a/src/org/openstreetmap/josm/data/preferences/IntegerProperty.java b/src/org/openstreetmap/josm/data/preferences/IntegerProperty.java
    index 342b3ba..f15d082 100644
    a b public class IntegerProperty extends AbstractProperty<Integer> { 
    1616     */
    1717    public IntegerProperty(String key, int defaultValue) {
    1818        super(key, defaultValue);
     19        if (Main.pref != null) {
     20            get();
     21        }
    1922    }
    2023
    2124    @Override
  • src/org/openstreetmap/josm/data/preferences/ParametrizedEnumProperty.java

    diff --git a/src/org/openstreetmap/josm/data/preferences/ParametrizedEnumProperty.java b/src/org/openstreetmap/josm/data/preferences/ParametrizedEnumProperty.java
    index 094a745..84dc7ba 100644
    a b public abstract class ParametrizedEnumProperty<T extends Enum<T>> { 
    1111    public ParametrizedEnumProperty(Class<T> enumClass, T defaultValue) {
    1212        this.defaultValue = defaultValue;
    1313        this.enumClass = enumClass;
     14        if (Main.pref != null) {
     15            get();
     16        }
    1417    }
    1518
    1619    protected abstract String getKey(String... params);
  • src/org/openstreetmap/josm/data/preferences/StringProperty.java

    diff --git a/src/org/openstreetmap/josm/data/preferences/StringProperty.java b/src/org/openstreetmap/josm/data/preferences/StringProperty.java
    index 1e352ad..25e42a1 100644
    a b public class StringProperty extends AbstractProperty<String> { 
    1515     */
    1616    public StringProperty(String key, String defaultValue) {
    1717        super(key, defaultValue);
     18        if (Main.pref != null) {
     19            get();
     20        }
    1821    }
    1922
    2023    @Override