Package org.apache.myfaces.trinidad.skin

Examples of org.apache.myfaces.trinidad.skin.Skin


    DerivationKey derivationKey = _getDerivationKey(context, document);
    entryCache.put(derivationKey, entry);
   
    // just in case, clear the dirty flag.
    RenderingContext arc = RenderingContext.getCurrentInstance();
    Skin skin = arc.getSkin();
    skin.setDirty(false);

    return entry;
  }
View Full Code Here


    // Write out the style sheet
    // First figure out whether or not we need to compress the style classes.
    // We don't compress the style classes if the content compression flag is disabled or
    // if the skin is a portlet skin.
    RenderingContext arc = RenderingContext.getCurrentInstance();
    Skin skin = arc.getSkin();
    boolean compressStyles = _isCompressStyles(context);

    StyleWriterFactoryImpl writerFactory = new StyleWriterFactoryImpl(_targetPath,
      getTargetStyleSheetName(context, document));
    CSSGenerationUtils.writeCSS(context,
                                skin.getStyleSheetName(),
                                styles,
                                writerFactory,
                                compressStyles,
                                shortStyleClassMap,
                                namespacePrefixes,
View Full Code Here

    if (renderKitId == null)
      renderKitId = _RENDER_KIT_ID_DESKTOP;


    // figure out the base skin.
    Skin baseSkin = null;
    String skinExtends = skinNode.getSkinExtends();
   
    if (skinExtends != null)
      baseSkin = skinFactory.getSkin(null, skinExtends);
    if (baseSkin == null)
    {
      baseSkin = _getDefaultBaseSkin(skinFactory, renderKitId);
     
      if (skinExtends != null)
      {
        _LOG.severe("UNABLE_LOCATE_BASE_SKIN",
                    new String[]{skinExtends, id, family, renderKitId, baseSkin.getId()});
      }

    }

    // Set the style sheet
    if (styleSheetName != null)
    {
      // If the styleSheetName is in the META-INF/trinidad-skins.xml file, then
      // we prepend META-INF to the styleSheetName if it doesn't begin with '/'.
      // This way we can find the file when we go to parse it later.
      if (isMetaInfFile)
        styleSheetName = _prependMetaInf(styleSheetName);
    }
    // If bundleName and translationSourceExpression are both set, then we
    // only use the bundleName. An error was already logged during trinidad-skins
    // parsing.


    Skin skin = null;

    // bundle-name takes precedence over translation-source
    if (bundleName != null)
    {
      skin = new SkinExtension(baseSkin,
View Full Code Here

    String baseSkinId = (_RENDER_KIT_ID_PDA.equals(renderKitId)) ?
                          _SIMPLE_PDA_SKIN_ID :
                          _SIMPLE_DESKTOP_SKIN_ID;

    Skin baseSkin = factory.getSkin(null, baseSkinId);

    // It is an error if we were unable to find the base skin
    if (baseSkin == null)
      _LOG.severe(_UNKNOWN_BASE_SKIN_ERROR + baseSkinId);
View Full Code Here

      String styleSheetName = skinAdditionNode.getStyleSheetName();
      String resourceBundleName = skinAdditionNode.getResourceBundleName();
      String translationSourceExpression =
        skinAdditionNode.getTranslationSourceExpression();

      Skin skin = skinFactory.getSkin(fContext, skinId);
      if (skin != null
          && ((styleSheetName != null)
              || (resourceBundleName != null)
              || (translationSourceExpression != null)))
      {
        // If the styleSheetName is in the META-INF/trinidad-skins.xml file, then
        // we prepend META-INF to the styleSheetName if it doesn't begin with '/'.
        // This way we can find the file when we go to parse it later.
        if (isMetaInfFile && (styleSheetName != null))
            styleSheetName = _prependMetaInf(styleSheetName);


        SkinAddition addition = null;
       
        if (resourceBundleName != null)
        {
          // create SkinAddition with resourceBundleName
          addition = new SkinAddition(styleSheetName, resourceBundleName);
        }
        else
        {
          ValueExpression translationSourceVE = null;
          if (translationSourceExpression != null)
          {
            translationSourceVE =
              _createTranslationSourceValueExpression(translationSourceExpression);
          }
         
          if (translationSourceVE != null)
          {
            // Create a SkinAddition with translationSourceVE
            addition = new SkinAddition(styleSheetName, translationSourceVE);

          }
          else
          {
            // Create a SkinAddition with stylesheetName only
            addition = new SkinAddition(styleSheetName);

          }

        }
       
        skin.addSkinAddition(addition);
      }
    }   
  }
View Full Code Here

    {
      comment += ", Accessibility:"+accessibilityMode;
    }

    // Tack on the Skin id
    Skin skin = arc.getSkin();
    String skinId = skin.getId();
    if (skinId != null)
    {
      comment += ", skin:" + skinId;

      // Also log preferred Skin if we have one
View Full Code Here

    {
      // Get the Icon from the Skin
      UIXRenderingContext context = uix.getRenderingContext();
      RenderingContext arc = RenderingContext.getCurrentInstance();
      FacesContext fContext = context.getFacesContext();
      Skin skin = context.getSkin();
      Icon icon = skin.getIcon(name);

      Object uri = icon.getImageURI(fContext, arc);

      if (uri != null)
      {
View Full Code Here

    if (renderKitId == null)
      renderKitId = _RENDER_KIT_ID_DESKTOP;


    // figure out the base skin.
    Skin baseSkin = null;
    String skinExtends = skinNode.getSkinExtends();
   
    if (skinExtends != null)
      baseSkin = skinFactory.getSkin(null, skinExtends);
    if (baseSkin == null)
    {
      baseSkin = _getDefaultBaseSkin(skinFactory, renderKitId);
     
      if (skinExtends != null)
      {
        _LOG.severe("Unable to locate base skin \"{0}\" for " +
                    "use in defining skin of id \"{1}\", family " +
                    "\"{2}\", renderkit ID \"{3}\". Using the default base skin \"{4}\".",
                    new String[]{skinExtends, id, family, renderKitId, baseSkin.getId()});
      }

    }

    SkinExtension skin = new SkinExtension(baseSkin,
View Full Code Here

    String baseSkinId = (_RENDER_KIT_ID_PDA.equals(renderKitId)) ?
                          _SIMPLE_PDA_SKIN_ID :
                          _SIMPLE_DESKTOP_SKIN_ID;

    Skin baseSkin = factory.getSkin(null, baseSkinId);

    // It is an error if we were unable to find the base skin
    if (baseSkin == null)
      _LOG.severe(_UNKNOWN_BASE_SKIN_ERROR + baseSkinId);
View Full Code Here

    for (SkinAdditionNode skinAdditionNode : skinAdditionNodeList)
    {
      String skinId = skinAdditionNode.getSkinId();
      String styleSheetName = skinAdditionNode.getStyleSheetName();
 
      Skin skin = skinFactory.getSkin(fContext, skinId);
      if (skin != null && styleSheetName != null)
      { 
        // If the styleSheetName is in the META-INF/trinidad-skins.xml file, then
        // we prepend META-INF to the styleSheetName if it doesn't begin with '/'.
        // This way we can find the file when we go to parse it later.
        if (isMetaInfFile)
          styleSheetName = _prependMetaInf(styleSheetName);
        skin.registerStyleSheet(styleSheetName);
      }
    }   
  }
View Full Code Here

TOP

Related Classes of org.apache.myfaces.trinidad.skin.Skin

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.