diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2013-02-20 23:58:19 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2013-02-20 23:58:19 +1300 |
commit | b26e487f3c65808d349c7a53c0ea2a3981b61bac (patch) | |
tree | 57873f966be2953f3cb6b6f518cd44ea1adf720c /src/org/traccar/web/client/model/UserSettingsProperties.java | |
parent | 6801698dfc9c99b34d7ed081ebcfbec4a8853868 (diff) | |
download | trackermap-web-b26e487f3c65808d349c7a53c0ea2a3981b61bac.tar.gz trackermap-web-b26e487f3c65808d349c7a53c0ea2a3981b61bac.tar.bz2 trackermap-web-b26e487f3c65808d349c7a53c0ea2a3981b61bac.zip |
Add user preferences
Diffstat (limited to 'src/org/traccar/web/client/model/UserSettingsProperties.java')
-rw-r--r-- | src/org/traccar/web/client/model/UserSettingsProperties.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/org/traccar/web/client/model/UserSettingsProperties.java b/src/org/traccar/web/client/model/UserSettingsProperties.java index ad7e8e0d..dad7111d 100644 --- a/src/org/traccar/web/client/model/UserSettingsProperties.java +++ b/src/org/traccar/web/client/model/UserSettingsProperties.java @@ -16,8 +16,10 @@ package org.traccar.web.client.model; import org.traccar.web.shared.model.UserSettings; +import org.traccar.web.shared.model.UserSettings.SpeedUnit; import com.sencha.gxt.core.client.ValueProvider; +import com.sencha.gxt.data.shared.LabelProvider; import com.sencha.gxt.data.shared.ModelKeyProvider; import com.sencha.gxt.data.shared.PropertyAccess; @@ -27,4 +29,22 @@ public interface UserSettingsProperties extends PropertyAccess<UserSettings> { ValueProvider<UserSettings, UserSettings.SpeedUnit> speedUnit(); + public static class SpeedUnitLabelProvider implements LabelProvider<UserSettings.SpeedUnit> { + + @Override + public String getLabel(SpeedUnit item) { + switch (item) { + case kilometersPerHour: + return "km/h"; + case knots: + return "knots"; + case milesPerHour: + return "mph"; + default: + return null; + } + } + + } + } |