aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/web/client/model/UserSettingsProperties.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2013-02-20 23:58:19 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2013-02-20 23:58:19 +1300
commitb26e487f3c65808d349c7a53c0ea2a3981b61bac (patch)
tree57873f966be2953f3cb6b6f518cd44ea1adf720c /src/org/traccar/web/client/model/UserSettingsProperties.java
parent6801698dfc9c99b34d7ed081ebcfbec4a8853868 (diff)
downloadtrackermap-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.java20
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;
+ }
+ }
+
+ }
+
}