Example usage for com.google.gwt.storage.client Storage getLocalStorageIfSupported

List of usage examples for com.google.gwt.storage.client Storage getLocalStorageIfSupported

Introduction

In this page you can find the example usage for com.google.gwt.storage.client Storage getLocalStorageIfSupported.

Prototype

public static Storage getLocalStorageIfSupported() 

Source Link

Document

Returns a Local Storage.

Usage

From source file:ch.gbrain.gwtstorage.manager.StorageManager.java

License:Apache License

/**
 * Retrieve a reference to the local Storage (Browsers HTML5 key-value store)
 * //from   w w w .j  a va2  s.  c o m
 * @return The local storage or null if not supported
 */
public Storage getLocalStorage() {
    if (localStorage == null) {
        localStorage = Storage.getLocalStorageIfSupported();
        if (localStorage == null) {
            logger.log(Level.SEVERE, "No LocalStorage available!!!!!!!!!!!!!");
        }
    }
    return localStorage;
}

From source file:ch.takoyaki.email.html.client.service.FileServiceImpl.java

License:Open Source License

private Storage s() {
    return Storage.getLocalStorageIfSupported();
}

From source file:com.ait.tooling.nativetools.client.storage.LocalStorage.java

License:Open Source License

private LocalStorage() {
    super(CacheType.LOCAL, Storage.getLocalStorageIfSupported());
}

From source file:com.akjava.gwt.subplayer.client.SubPlayerPreference.java

License:Apache License

public SubPlayerPreference() {
    storage = Storage.getLocalStorageIfSupported();
}

From source file:com.akjava.gwt.subplayer.client.SubPlayerPreference.java

License:Apache License

public void initialize() {//TODO make exception
    storage = Storage.getLocalStorageIfSupported();
    if (storage == null) {
        throw new RuntimeException("storage not supported");
    }//from   ww w  .  j a va  2  s .  co  m
    voiceName = toStringValue(storage.getItem(KEY_VOICE_NAME), "");
    voiceRate = toDouble(storage.getItem(KEY_VOICE_RATE), 1.0);
    voicePitch = toDouble(storage.getItem(KEY_VOICE_PITCH), 1.0);

    srtText = toStringValue(storage.getItem(KEY_CURRENT_SRT), "");
    srtSelectIndex = toInt(storage.getItem(KEY_SRT_INDEX), 0);
}

From source file:com.appspot.hommkmessage.client.LocalStorage.java

License:Open Source License

public LocalStorage() {
    storage = Storage.getLocalStorageIfSupported();
}

From source file:com.data2semantics.yasgui.client.helpers.LocalStorageHelper.java

License:Open Source License

private static StorageMap getStorageMap() {
    StorageMap storageMap = null;//from  www  .  j ava 2s  .c om
    Storage html5Storage = Storage.getLocalStorageIfSupported();
    if (html5Storage != null) {
        storageMap = new StorageMap(html5Storage);
    }
    return storageMap;
}

From source file:com.data2semantics.yasgui.client.helpers.LocalStorageHelper.java

License:Open Source License

private static void removeLocalStorageKey(String key) {
    Storage html5Storage = Storage.getLocalStorageIfSupported();
    String domain = Helper.getCurrentHost();
    html5Storage.removeItem(domain + "_" + key);
}

From source file:com.data2semantics.yasgui.client.helpers.LocalStorageHelper.java

License:Open Source License

public static void setInLocalStorage(String key, String value) {
    if (Storage.isLocalStorageSupported()) {
        Storage html5Storage = Storage.getLocalStorageIfSupported();
        html5Storage.setItem(Helper.getCurrentHost() + "_" + key, value);
    }/*from  ww w .ja v a2  s  .  c  om*/
}

From source file:com.dawg6.web.dhcalc.client.BasePanel.java

License:Open Source License

protected String getFieldValue(String field, String defaultValue) {
    if (Storage.isLocalStorageSupported()) {
        Storage storage = Storage.getLocalStorageIfSupported();
        String value = storage.getItem(field);

        return (value != null) ? value : defaultValue;
    } else {//  ww  w.ja  v  a 2s .  c o  m
        return getCookie(field, defaultValue);
    }
}