Examples of CSSStyle


Examples of org.apache.click.element.CssStyle

     *
     * @param line the HTML import line to convert to a Css instance
     * @return a Css instance
     */
    private CssStyle asCssStyle(String line) {
        CssStyle cssStyle = new CssStyle();
        copyAttributes(cssStyle, line);
        cssStyle.setContent(extractCssContent(line));
        return cssStyle;
    }
View Full Code Here

Examples of org.apache.click.element.CssStyle

    private void setHeadElements() {
        // Add a Css import to the Page
        getHeadElements().add(new CssImport("/general/page-head-demo.css"));

        // Add inline Css content to the Page that increases the field font-size
        getHeadElements().add(new CssStyle("#" + field.getId() + " { font-size: 18px; }"));

        // Add the JQuery library to the Page
        getHeadElements().add(new JsImport("/assets/js/jquery-1.3.2.js"));

        // Add a JQuery template which adds a 'click' listener to the link
View Full Code Here

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

    if (text.startsWith("{"))
      text = text.substring(1);
    if (text.endsWith("}"))
      text = text.substring(0, text.length() - 1);

    CSSStyle style = new CSSStyle();
    StringTokenizer tokens = new StringTokenizer(text, ";");
    while (tokens.hasMoreTokens())
    {
      String token = tokens.nextToken();
      int colonPos = token.indexOf(':');
      if (colonPos >= 0)
      {
        String key = token.substring(0, colonPos).trim();
        String value = token.substring(colonPos + 1).trim();
        style.setProperty(key, value);
      }
    }

    return style;
  }
View Full Code Here

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

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

    ParseContext context,
    String       namespaceURI,
    String       localName
    )
  {
    return new CSSStyle(_properties);
  }
View Full Code Here

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

      String             id,
      String             prefix,
      boolean            isName
      )
    {
      CSSStyle style = (CSSStyle)map.get(id);

      if (style == _MISS)
        return null;
      if (style != null)
        return style;

      // Next, try getting the Style from the StyleSheetDocument
      StyleSheetDocument document = __getStyleSheetDocument();
      if (document == null)
        return null;

      StyleNode styleNode = null;

      if (isName)
      {
        styleNode = document.getStyleByName(context, id);
      }
      else
      {
        styleNode = document.getStyleBySelector(context, prefix + id);
      }

      if (styleNode == null)
      {
        map.put(id, _MISS);
        return null;
      }

      // Convert the styleNode into a Style
      style = new CSSStyle();

      // Add in the properties for the style
      Iterator<PropertyNode> e = styleNode.getProperties();
      while (e.hasNext())
      {
        PropertyNode property = e.next();
        String name = property.getName();
        String value = property.getValue();

        style.setProperty(name, value);
      }

      map.put(id, style);
      return style;
    }
View Full Code Here

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

    if (text.startsWith("{"))
      text = text.substring(1);
    if (text.endsWith("}"))
      text = text.substring(0, text.length() - 1);

    CSSStyle style = new CSSStyle();
    StringTokenizer tokens = new StringTokenizer(text, ";");
    while (tokens.hasMoreTokens())
    {
      String token = tokens.nextToken();
      int colonPos = token.indexOf(':');
      if (colonPos >= 0)
      {
        String key = token.substring(0, colonPos).trim();
        String value = token.substring(colonPos + 1).trim();
        style.setProperty(key, value);
      }
    }

    return style;
  }
View Full Code Here

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

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

      String             id,
      String             prefix,
      boolean            isName
      )
    {
      CSSStyle style = (CSSStyle)map.get(id);

      if (style == _MISS)
        return null;
      if (style != null)
        return style;

      // Next, try getting the Style from the StyleSheetDocument
      StyleSheetDocument document = __getStyleSheetDocument();
      if (document == null)
        return null;

      StyleNode styleNode = null;

      if (isName)
      {
        styleNode = document.getStyleByName(context, id);
      }
      else
      {
        styleNode = document.getStyleBySelector(context, prefix + id);
      }

      if (styleNode == null)
      {
        map.put(id, _MISS);
        return null;
      }

      // Convert the styleNode into a Style
      style = new CSSStyle();

      // Add in the properties for the style
      Iterable<PropertyNode> propertyNodeList = styleNode.getProperties();
      for (PropertyNode property : propertyNodeList)
      {
        String name = property.getName();
        String value = property.getValue();

        style.setProperty(name, value);
      }

      map.put(id, style);
      return style;
    }
View Full Code Here

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
        if (_INTEGER_PATTERN.matcher(propertyValue).matches())
        {
          widthValue = propertyValue;
          width = _convertPxDimensionStringToInteger(widthValue);
        }
        else
        {
          widthValue = null;
          // use inlineStyle for non-integer width values;
          if (inlineStyle == null)
          {
            inlineStyle = new CSSStyle();
          }
          inlineStyle.setProperty(propertyName, propertyValue);
        }
      }
      else if (propertyName.equals("height"))
      {
        // save original height value
        // strip off px from the string and return an Integer
        if (_INTEGER_PATTERN.matcher(propertyValue).matches())
        {
          heightValue = propertyValue;
          height = _convertPxDimensionStringToInteger(heightValue);
        }
        else
        {
          // use inlineStyle for non-integer height values;
          heightValue = null;
          if (inlineStyle == null)
          {
            inlineStyle = new CSSStyle();
          }
          inlineStyle.setProperty(propertyName, propertyValue);
        }
      }
      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.