Examples of CSSStyle


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

    String  text = null;
    boolean isNullIcon = false;
    boolean createStyleNode = false;
    // append all the styles that are not content, width or height into
    // inline style
    CSSStyle inlineStyle = null;

    for(PropertyNode propertyNode : noTrPropertyNodeList)
    {
      String propertyName = propertyNode.getName();
      String propertyValue = propertyNode.getValue();
      if (propertyName.equals("width"))
      {
        // save original width value
        // strip off px from the string and return an Integer
        widthValue = propertyValue;
        width = _convertPxDimensionStringToInteger(widthValue);
      }
      else if (propertyName.equals("height"))
      {
        // save original height value
        // strip off px from the string and return an Integer
        heightValue = propertyValue;
        height = _convertPxDimensionStringToInteger(heightValue);
      }
      else if (propertyName.equals("content"))
      {
        // is it a text or uri
        if (_isURLValue(propertyValue))
        {
          uri = _getURIString(propertyValue);
        }
        else if (propertyValue.startsWith("inhibit"))
        {
          isNullIcon = true;
        }
        else
        {
          text = trimQuotes(propertyValue);
        }

      }
      else
      {
        // create an inlineStyle with all the extraneous style properties
        if (inlineStyle == null)
          inlineStyle = new CSSStyle();
        inlineStyle.setProperty(propertyName, propertyValue);
      }

    }
    // now I need to create the icon.
    // do not create an icon if isNullIcon is true.
    Icon icon = null;

    if (!isNullIcon)
    {
      if (text != null)
      {
        // don't allow styleClass from the css parsing file. We can handle
        // this when we have style includes
        // put back the width/height properties if there were some
        if ((heightValue != null || widthValue != null) && inlineStyle == null)
          inlineStyle = new CSSStyle();
        if (heightValue != null)
         inlineStyle.setProperty("height", heightValue);
        if (widthValue != null)
          inlineStyle.setProperty("width", widthValue);
        icon = new TextIcon(text, text, null, inlineStyle);
      }
      else if (uri != null)
      {
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.