Examples of ThemeProvider


Examples of org.zkoss.zk.ui.util.ThemeProvider

      olde = Executions.getCurrent();
    ExecutionsCtrl.setCurrent(exec);
     ((ExecutionCtrl)exec).onActivate();
    try {
      int hours = 8760;
      final ThemeProvider tp = getWebApp().getConfiguration().getThemeProvider();
      if (tp != null) {
        try {
          final String p = "~." + path;
          if (tp.beforeWCS(exec, p) == null) {
            response.setContentType("text/css;charset=UTF-8");
            return; //skip the whole file
          }
          hours = tp.getWCSCacheControl(exec, p);
        } catch (AbstractMethodError ex) { //ignore it (backward compatible)
        }
      }
      if (hours > 0)
        JspFns.setCacheControl(getServletContext(), request, response,
          "org.zkoss.web.classWebResource.cache", hours);

      for (int j = 0; j < wi.items.length; ++j) {
        final Object o = wi.items[j];
        if (o instanceof String) {
          String uri = (String)o;
          if (tp != null) {
            try {
              uri = tp.beforeWidgetCSS(exec, uri);
              if (uri == null)
                continue; //skip it
            } catch (AbstractMethodError ex) { //ignore it (backward compatible)
            }
          }

          try {
            _webctx.include(request, HttpBufferedResponse.getInstance(response, sw), uri, null);
          } catch (Throwable ex) {
            log.realCauseBriefly("Unable to load "+wi.items[j], ex);
          }
        } else { //static method
          sw.write(invoke((MethodInfo)o));
        }
        sw.write('\n');
      }

      for (Iterator it = wi.langdef.getCSSURIs().iterator(); it.hasNext();) {
        String uri = (String)it.next();
        if (tp != null) {
          try {
            uri = tp.beforeWidgetCSS(exec, uri);
            if (uri == null)
              continue; //skip it
          } catch (AbstractMethodError ex) { //ignore it (backward compatible)
          }
        }
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.