aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/web/client/ApplicationContext.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/web/client/ApplicationContext.java')
-rw-r--r--src/org/traccar/web/client/ApplicationContext.java55
1 files changed, 55 insertions, 0 deletions
diff --git a/src/org/traccar/web/client/ApplicationContext.java b/src/org/traccar/web/client/ApplicationContext.java
new file mode 100644
index 00000000..f5053243
--- /dev/null
+++ b/src/org/traccar/web/client/ApplicationContext.java
@@ -0,0 +1,55 @@
+package org.traccar.web.client;
+
+import org.traccar.web.shared.model.ApplicationSettings;
+import org.traccar.web.shared.model.UserSettings;
+
+public class ApplicationContext {
+
+ private static final ApplicationContext context = new ApplicationContext();
+
+ public static ApplicationContext getInstance() {
+ return context;
+ }
+
+ private FormatterUtil formatterUtil;
+
+ public void setFormatterUtil(FormatterUtil formatterUtil) {
+ this.formatterUtil = formatterUtil;
+ }
+
+ public FormatterUtil getFormatterUtil() {
+ if (formatterUtil == null) {
+ formatterUtil = new FormatterUtil();
+ }
+ return formatterUtil;
+ }
+
+ private ApplicationSettings applicationSettings;
+
+ public void setApplicationSettings(ApplicationSettings applicationSettings) {
+ this.applicationSettings = applicationSettings;
+ }
+
+ public ApplicationSettings getApplicationSettings() {
+ if (applicationSettings != null) {
+ return applicationSettings;
+ } else {
+ return new ApplicationSettings(); // default settings
+ }
+ }
+
+ private UserSettings userSettings;
+
+ public void setUserSettings(UserSettings userSettings) {
+ this.userSettings = userSettings;
+ }
+
+ public UserSettings getUserSettings() {
+ if (userSettings != null) {
+ return userSettings;
+ } else {
+ return new UserSettings(); // default settings
+ }
+ }
+
+}