Package com.google.code.gwt.storage.client

Examples of com.google.code.gwt.storage.client.Storage


    }
   
    // get the locale if stored in the browser
    String localeStored = "";
    if (Storage.isSupported()) {
      Storage localStorage = Storage.getLocalStorage();
      localeStored = localStorage.getItem("locale");
    }
   
    // select the right locale in the list if one is predefined
    if (localeStored != null) {
      for (int i = 0; i < languageSelector.getItemCount(); i++) {
        if ( localeStored.equals(languageSelector.getValue(i))) {
          languageSelector.setSelectedIndex(i);
        }
      }
    // otherwise provide the default
    else {
      for (int i = 0; i < languageSelector.getItemCount(); i++) {
        if (languageSelector.getValue(i).equals("default")) {
          languageSelector.setSelectedIndex(i);
        }
      }
    }
   
    sectionChangeLocale.add(titleCL);
    sectionChangeLocale.add(instructionCL);
    sectionChangeLocale.add(changeLocale);
    account.add(sectionChangeLocale);
   
    addWidgetRow(changeLocale, uiText.Language(), languageSelector);
   
    languageSelector.addChangeHandler(new ChangeHandler() {

      @Override
      public void onChange(ChangeEvent event) {
       
        String value = languageSelector.getValue(languageSelector.getSelectedIndex())
       
        // store the new default value if possible or remove the value in case
        // of default (English)
        if (Storage.isSupported()) {
          Storage localStorage = Storage.getLocalStorage();
         
          if (value.equals("default")) {
            localStorage.removeItem("locale");
          } else {
            localStorage.setItem("locale", value);
          }
         
        }
       
        // construct the new url with the locale parameter
View Full Code Here


            // store the username and password in the local storage
            // if remember me is selected
            if (Storage.isSupported()
                && rememberme.getValue() == true) {
              Storage localStorage = Storage.getLocalStorage();
              localStorage.setItem("username", usernameText
                  .getValue());
              localStorage.setItem("password", passwordText
                  .getValue());
            }

            complete();
          }
View Full Code Here

    History.addValueChangeHandler(new HistoryEventHandler());
    History.fireCurrentHistoryState();

    // Check local storage for username & password
    if (Storage.isSupported()) {
      Storage localStorage = Storage.getLocalStorage();
      String username = localStorage.getItem("username");
      String password = localStorage.getItem("password");
      if (username != null && password != null) {
        // if present automatically login
        login(username, password);
        return;
      }
View Full Code Here

    String localeUrl = Location.getParameter("locale");
   
    // get the locale from the storage
    String localeStored = "";
    if (Storage.isSupported()) {
      Storage localStorage = Storage.getLocalStorage();
      localeStored = localStorage.getItem("locale");
    }
   
    // if the locale is not present
    if (localeUrl == null && localeStored != null) {
     
View Full Code Here

TOP

Related Classes of com.google.code.gwt.storage.client.Storage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.