mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-12 23:30:59 +00:00
Added supportsStore method to decide if a SettingsStorageManager can
handle save
This commit is contained in:
1 parent
f54ba0803e
commit
e7e09a0895
3 files changed
+12
No files matched your search
+2
@@ -18,6 +18,8 @@ import com.sap.sse.common.settings.generic.GenericSerializableSettings;
|
||||
* @see ComponentContextWithSettingsStorage
|
||||
*/
|
||||
public interface SettingsStorageManager<S extends Settings> {
|
||||
|
||||
boolean supportsStore();
|
||||
|
||||
/**
|
||||
* Retrieves the {@link Settings} of the root component using the provided callback.
|
||||
|
||||
+5
@@ -20,6 +20,11 @@ import com.sap.sse.gwt.settings.SettingsToUrlSerializer;
|
||||
*/
|
||||
public class SimpleSettingsStorageManager<S extends Settings> implements SettingsStorageManager<S> {
|
||||
private final SettingsToUrlSerializer urlSerializer = new SettingsToUrlSerializer();
|
||||
|
||||
@Override
|
||||
public boolean supportsStore() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
|
||||
+5
@@ -72,6 +72,11 @@ public class UserSettingsStorageManager<S extends Settings> implements SettingsS
|
||||
this.storageGlobalKey = globalDefinitionId;
|
||||
this.storageContextSpecificKey = this.storageGlobalKey + "#" + contextDefinitionId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsStore() {
|
||||
return true;
|
||||
}
|
||||
|
||||
private void storeContextSpecificSettingsJsonOnLocalStorage(String serializedContextSpecificSettings) {
|
||||
Storage localStorage = Storage.getLocalStorageIfSupported();
|
||||
|
||||
Reference in new issue
Block a user