Examples of IWidgetInstance


Examples of org.apache.wookie.beans.IWidgetInstance

   * the locale if the user has changed it.
   * @param request
   * @return the widget instance
   */
  private static IWidgetInstance getLocalizedWidgetInstance(HttpServletRequest request){
    IWidgetInstance instance = WidgetInstancesController.findWidgetInstance(request);
    if (instance != null){
      String locale = request.getParameter("locale");//$NON-NLS-1$
      // If the requested locale is different to the saved locale, update the "lang" attribute
      // of the widget instance and save it
      if (
          (locale == null && instance.getLang()!=null) ||
          (locale != null && instance.getLang()==null) ||          
          (locale != null && !instance.getLang().equals(locale))
      ){
        IPersistenceManager persistenceManager = PersistenceManagerFactory.getPersistenceManager();
        instance.setLang(locale);
        persistenceManager.save(instance);
      }
    }
    return instance;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.