Package org.zkoss.zk.ui.util

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


          sses.add(ss);
      }
    }

    //Process configuration
    final ThemeProvider themeProvider = config.getThemeProvider();
    if (themeProvider != null) {
      final List orgss = new LinkedList();
      for (Iterator it =  sses.iterator(); it.hasNext();) {
        final StyleSheet ss = (StyleSheet)it.next();
        final String href = ss.getHref();
        if (href != null && href.length() > 0)
          orgss.add(ss.getMedia() != null ? ss: (Object)href); //we don't support getContent
      }

      final String[] hrefs = config.getThemeURIs();
      for (int j = 0; j < hrefs.length; ++j)
        orgss.add(hrefs[j]);

      sses.clear();
      final Collection res = themeProvider.getThemeURIs(exec, orgss);
      if (res != null) {
        for (Iterator it = res.iterator(); it.hasNext();) {
          final Object re = it.next();
          sses.add(re instanceof StyleSheet ? (StyleSheet)re:
            new StyleSheet((String)re, "text/css"));
View Full Code Here


      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

Related Classes of org.zkoss.zk.ui.util.ThemeProvider

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.