aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/web/client/model/UserSettingsProperties.java
diff options
context:
space:
mode:
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;
+ }
+ }
+
+ }
+
}