Examples of StyleProvider


Examples of org.apache.myfaces.trinidadinternal.style.StyleProvider

    FacesBean           bean) throws IOException
  {
    ResponseWriter writer = context.getResponseWriter();

    StyleContext sContext = ((CoreRenderingContext) arc).getStyleContext();
    StyleProvider provider = sContext.getStyleProvider();
    if (provider != null)
    {
      String href = provider.getStyleSheetURI(sContext);
      if (href != null)
      {
        ExternalContext externalContext = context.getExternalContext();
        String contextUri = externalContext.getRequestContextPath();
        String baseURL = contextUri + XhtmlConstants.STYLES_CACHE_DIRECTORY;
       
        String outputMode = arc.getOutputMode();
        // =-=AEW Don't like hardcoding facet names...
        if (XhtmlConstants.OUTPUT_MODE_PORTLET.equals(outputMode) &&
            supportsScripting(arc))
        {
          writer.startElement("script", null);
          writer.writeText("var _adfSS;if(!_adfSS){_adfSS=1;document.write(\"" +
                        "<link rel=\\\"stylesheet\\\" "+
                        "charset=\\\"UTF-8\\\" type=\\\"text/css\\\" " +
                        "href=\\\"",
            null);
          String uri = context.getExternalContext().encodeResourceURL(baseURL+href);
          writer.writeText(uri, null);
          writer.writeText("\\\">\")}", null);
          writer.endElement("script");
        }
        else
        {
          writer.startElement("link", null);
          renderId(context, comp);
          writer.writeAttribute("rel", "stylesheet", null);
          writer.writeAttribute("charset", "UTF-8", null);
         
          String type = provider.getContentStyleType(sContext);
          writer.writeAttribute("type", type, null);
         
          renderEncodedResourceURI(context, "href", baseURL + href);
          writer.endElement("link");
        }
View Full Code Here

Examples of org.apache.myfaces.trinidadinternal.style.StyleProvider

                                      targetDirectoryPath);

    // Get our cache of existing StyleProviders
    Map<ProviderKey, StyleProvider> providers = _getProviders();

    StyleProvider provider = null;

    synchronized (providers)
    {
      provider = providers.get(key);
View Full Code Here

Examples of org.apache.myfaces.trinidadinternal.style.StyleProvider

  private Style _getPaddingStyle(PaintContext context)
  {
    // First, get the StyleProvider from the context
    ImageContext imageContext = context.getImageContext();
    StyleContext styleContext = imageContext.getStyleContext();
    StyleProvider provider = styleContext.getStyleProvider();
    if (provider != null)
    {
      // Get the StyleMap
      StyleMap map = provider.getStyleMap(styleContext);

      if (map != null)
      {
        // Derive the style name to use from the font name.
        Font font = context.getPaintFont();
View Full Code Here

Examples of org.apache.myfaces.trinidadinternal.style.StyleProvider

     if (!"true".equals(
          external.getInitParameter(
            Configuration.DISABLE_CONTENT_COMPRESSION)))
     {
       StyleContext sContext = ((CoreRenderingContext)arc).getStyleContext();
       StyleProvider sProvider = sContext.getStyleProvider();
       return sProvider.getShortStyleClasses(sContext);  
     }
     return null;
   }
View Full Code Here

Examples of org.apache.myfaces.trinidadinternal.style.StyleProvider

    FacesBean           bean) throws IOException
  {
    ResponseWriter writer = context.getResponseWriter();

    StyleContext sContext = ((CoreRenderingContext) arc).getStyleContext();
    StyleProvider provider = sContext.getStyleProvider();
    if (provider != null)
    {
      List<String> uris = provider.getStyleSheetURIs(sContext);

      // If the requestMap has a skin-id, a skin's stylesheet's id and suppressStylesheet
      // is true, and the skin information matches our current skin, then it is safe
      // to not write out the css. This means that it will be written out by the external
      // source, like the portal container.
      boolean suppressStylesheet = _isSuppressStylesheet(context, arc);
      if (!suppressStylesheet)
      {
        if (uris != null && !uris.isEmpty())
        {
          ExternalContext externalContext = context.getExternalContext();
          String contextUri = externalContext.getRequestContextPath();
          String baseURL = contextUri + XhtmlConstants.STYLES_CACHE_DIRECTORY;

          String outputMode = arc.getOutputMode();
          // =-=AEW Don't like hardcoding facet names...
          if (XhtmlConstants.OUTPUT_MODE_PORTLET.equals(outputMode) &&
              supportsScripting(arc))
          {
            writer.startElement("script", null);
            writer.writeText("var _adfSS;if(!_adfSS){_adfSS=1;", null);
            for (String uri : uris)
            {
              writer.writeText("document.write(\"" +
                            "<link rel=\\\"stylesheet\\\" "+
                            "charset=\\\"UTF-8\\\" type=\\\"text/css\\\" " +
                            "href=\\\"",
                null);
              uri = context.getExternalContext().encodeResourceURL(baseURL + uri);
              writer.writeText(uri, null);
              writer.writeText("\\\">\");", null);
            }
            writer.writeText("}", null);
            writer.endElement("script");
          }
          else
          {
            for (String uri : uris)
            {
              writer.startElement("link", null);
              renderId(context, comp);
              writer.writeAttribute("rel", "stylesheet", null);
              writer.writeAttribute("charset", "UTF-8", null);

              String type = provider.getContentStyleType(sContext);
              writer.writeAttribute("type", type, null);

              renderEncodedResourceURI(context, "href", baseURL + uri);
              writer.endElement("link");
            }
View Full Code Here

Examples of org.apache.myfaces.trinidadinternal.style.StyleProvider

      RenderingContext rc = RenderingContext.getCurrentInstance();
      assert(rc instanceof CoreRenderingContext);

      CoreRenderingContext crc = (CoreRenderingContext)rc;
      StyleContext styleContext = crc.getStyleContext();
      StyleProvider styleProvider = styleContext.getStyleProvider();
      _icons = styleProvider.getIcons(styleContext);

      // Under normal circumstances, the StyleProvider will return
      // a non-null, modifiable map.  If the skin/style subsystem
      // has failed to initialize, however, the map may be null.
      // Substitute an empty map so we don't need to check for null
View Full Code Here

Examples of org.apache.myfaces.trinidadinternal.style.StyleProvider

      RenderingContext rc = RenderingContext.getCurrentInstance();
      assert(rc instanceof CoreRenderingContext);

      CoreRenderingContext crc = (CoreRenderingContext)rc;
      StyleContext styleContext = crc.getStyleContext();
      StyleProvider styleProvider = styleContext.getStyleProvider();
      // skin properties are stored in an Map<Object, Object>
      _properties = styleProvider.getSkinProperties(styleContext);

      // Under normal circumstances, the StyleProvider will return
      // a non-null, modifiable map.  If the skin/style subsystem
      // has failed to initialize, however, the map may be null.
      // Substitute an empty map so we don't need to check for null
View Full Code Here

Examples of org.apache.myfaces.trinidadinternal.style.StyleProvider

   {
     FacesContext context = FacesContext.getCurrentInstance();
     if (!_isDisableContentCompressionParameterTrue(context))
     {
        StyleContext sContext = ((CoreRenderingContext)arc).getStyleContext();
        StyleProvider sProvider = sContext.getStyleProvider()
        // make sure that we want to disable style compression - there could be other
        // reasons that the styleContext knows about.
        if (!(sContext.isDisableStyleCompression()))
          return sProvider.getShortStyleClasses(sContext);
     }
     return null;
   }
View Full Code Here

Examples of org.apache.myfaces.trinidadinternal.style.StyleProvider

                                      targetDirectoryPath);

    // Get our cache of existing StyleProviders
    Map<ProviderKey, StyleProvider> providers = _getProviders();

    StyleProvider provider = null;

    synchronized (providers)
    {
      provider = providers.get(key);
View Full Code Here

Examples of org.apache.myfaces.trinidadinternal.style.StyleProvider

    ) throws IOException
  {
    ResponseWriter writer = context.getResponseWriter();

    StyleContext sContext = ((CoreRenderingContext) rc).getStyleContext();
    StyleProvider provider = sContext.getStyleProvider();

    if (provider != null)
    {
      List<String> uris = provider.getStyleSheetURIs(sContext);

      // Check if we want to write out the css into the page or not. In portlet mode the
      // producer tries to share the consumer's stylesheet if it matches exactly.
      boolean suppressStylesheet = _isSuppressStylesheet(context, rc);

      if (!suppressStylesheet)
      {
        if (uris != null && !uris.isEmpty())
        {
          ExternalContext externalContext = context.getExternalContext();
          String contextUri = externalContext.getRequestContextPath();
          String baseURL = contextUri + XhtmlConstants.STYLES_CACHE_DIRECTORY;

          String outputMode = rc.getOutputMode();
          // =-=AEW Don't like hardcoding facet names...
          if (XhtmlConstants.OUTPUT_MODE_PORTLET.equals(outputMode) &&
              supportsScripting(rc))
          {
            writer.startElement("script", null);
            writer.writeText("var _adfSS;if(!_adfSS){_adfSS=1;", null);
            for (String uri : uris)
            {
              writer.writeText("document.write(\"" +
                            "<link rel=\\\"stylesheet\\\" "+
                            "charset=\\\"UTF-8\\\" type=\\\"text/css\\\" " +
                            "href=\\\"",
                null);
              uri = context.getExternalContext().encodeResourceURL(baseURL + uri);
              writer.writeText(uri, null);
              writer.writeText("\\\">\");", null);
            }
            writer.writeText("}", null);
            writer.endElement("script");
          }
          else
          {
            for (String uri : uris)
            {
              writer.startElement("link", null);
              renderId(context, comp);
              writer.writeAttribute("rel", "stylesheet", null);
              writer.writeAttribute("charset", "UTF-8", null);

              String type = provider.getContentStyleType(sContext);
              writer.writeAttribute("type", type, null);

              renderEncodedResourceURI(context, "href", baseURL + uri);
              writer.endElement("link");
            }
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.