Changeset 6767 in josm for trunk/src/org/openstreetmap/josm/gui/preferences/advanced/PrefEntry.java
- Timestamp:
- 2014-01-29T16:18:16+01:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/advanced/PrefEntry.java
r6022 r6767 6 6 7 7 /** 8 * Class to store single preference line for the table 9 * @since 6021 : extracted from AdvancedPreference class8 * Class to store single preference line for the table. 9 * @since 6021 10 10 */ 11 11 public class PrefEntry implements Comparable<PrefEntry> { … … 16 16 private boolean changed; 17 17 18 /** 19 * Constructs a new {@code PrefEntry}. 20 * @param key The preference key 21 * @param value The preference value 22 * @param defaultValue The preference default value 23 * @param isDefault determines if the current value is the default value 24 */ 18 25 public PrefEntry(String key, Preferences.Setting value, Preferences.Setting defaultValue, boolean isDefault) { 19 26 CheckParameterUtil.ensureParameterNotNull(key); … … 26 33 } 27 34 35 /** 36 * Returns the preference key. 37 * @return the preference key 38 */ 28 39 public String getKey() { 29 40 return key; 30 41 } 31 42 43 /** 44 * Returns the preference value. 45 * @return the preference value 46 */ 32 47 public Preferences.Setting getValue() { 33 48 return value; 34 49 } 35 50 51 /** 52 * Returns the preference default value. 53 * @return the preference default value 54 */ 36 55 public Preferences.Setting getDefaultValue() { 37 56 return defaultValue; 38 57 } 39 58 59 /** 60 * Sets the preference value. 61 * @param value the preference value 62 */ 40 63 public void setValue(Preferences.Setting value) { 41 64 this.value = value; … … 44 67 } 45 68 69 /** 70 * Determines if the current value is the default value. 71 * @return {@code true} if the current value is the default value, {@code false} otherwise 72 */ 46 73 public boolean isDefault() { 47 74 return isDefault; 48 75 } 49 76 77 /** 78 * Determines if this preference entry has been modified. 79 * @return {@code true} if this preference entry has been modified, {@code false} otherwise 80 */ 50 81 public boolean isChanged() { 51 82 return changed; 52 83 } 53 84 85 /** 86 * Marks this preference entry as modified. 87 */ 54 88 public void markAsChanged() { 55 89 changed = true; 56 90 } 57 91 92 /** 93 * Resets this preference entry to default state. 94 */ 58 95 public void reset() { 59 96 value = defaultValue;
Note:
See TracChangeset
for help on using the changeset viewer.