Package org.apache.myfaces.tobago.internal.context

Examples of org.apache.myfaces.tobago.internal.context.MeasureValue


  public Measure getThemeMeasure(FacesContext facesContext, String rendererType, Markup markup, String name) {

    ClientPropertiesKey clientKey = ClientPropertiesKey.get(facesContext);
    ThemeConfigCacheKey cacheKey = new ThemeConfigCacheKey(clientKey, rendererType, markup, name);

    MeasureValue result = themeCache.get(cacheKey);

    if (result == null) {
      List properties = getPaths(clientKey, "", PROPERTY, "tobago-theme-config", "",
          false, true, false, rendererType + "." + name, true, true);
      if (properties != null) {
        Measure measure = Measure.valueOf(properties.get(0));

        if (markup != null) {
          for (String m : markup) {
            List mProperties = getPaths(clientKey, "", PROPERTY, "tobago-theme-config", "",
                false, true, false, rendererType + "[" + m + "]" + "." + name, true, true);
            if (mProperties != null) {
              final Measure summand = Measure.valueOf(mProperties.get(0));
              measure = measure.add(summand);
            }
          }
        }

        result = new MeasureValue(measure);
      } else {
        result = MeasureValue.NULL;  // to mark and cache that this value is undefined.
      }
      themeCache.put(cacheKey, result);
    }
    return result.getValue();
  }
View Full Code Here

TOP

Related Classes of org.apache.myfaces.tobago.internal.context.MeasureValue

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.