Examples of CSSFunctionValue


Examples of org.pentaho.reporting.libraries.css.values.CSSFunctionValue

    }

    // maybe the position is a 'running(..)' function.
    if (CSSValueFactory.isFunctionValue(value))
    {
      final CSSFunctionValue cssFunctionValue = CSSValueFactory.parseFunction(value);
      if (cssFunctionValue != null)
      {
        // we are a bit restrictive for now ..
        if ("running".equals(cssFunctionValue.getFunctionName()))
        {
          return cssFunctionValue;
        }
      }
    }
View Full Code Here

Examples of org.pentaho.reporting.libraries.css.values.CSSFunctionValue

    LexicalUnit parameters = unit.getParameters();
    String functionName = unit.getFunctionName();
    if (parameters == null)
    {
      // no-parameter function include the date() function...
      return new CSSFunctionValue(functionName, EMPTY_PARAMETERS);
    }
    if ("attr".equalsIgnoreCase(functionName))
    {
      return parseComplexAttrFn(unit.getParameters());
    }
    if ("color".equalsIgnoreCase(functionName))
    {
      // for some strange reason, flute translates "rgb" functions into "color" functions which
      // are not even mentioned in the CSS specs. We therefore translate it back into RGB.
      functionName = "rgb";
    }

    final ArrayList contentList = new ArrayList();
    while (parameters != null)
    {
      if (parameters.getLexicalUnitType() == LexicalUnit.SAC_IDENT)
      {
        contentList.add(new CSSConstant(parameters.getStringValue()));
      }
      else if (parameters.getLexicalUnitType() == LexicalUnit.SAC_STRING_VALUE)
      {
        contentList.add(new CSSStringValue(CSSStringType.STRING,
            parameters.getStringValue()));
      }
      else if (CSSValueFactory.isNumericValue(parameters))
      {
        final CSSNumericValue numericValue =
            CSSValueFactory.createNumericValue(parameters);
        if (numericValue == null)
        {
          return null;
        }
        contentList.add(numericValue);
      }
      else if (CSSValueFactory.isLengthValue(parameters))
      {
        final CSSNumericValue lengthValue =
            CSSValueFactory.createLengthValue(parameters);
        if (lengthValue == null)
        {
          return null;
        }
        contentList.add(lengthValue);
      }
      else if (parameters.getLexicalUnitType() == LexicalUnit.SAC_ATTR)
      {
        final CSSAttrFunction attrFn =
            CSSValueFactory.parseAttrFunction(parameters);
        if (attrFn == null)
        {
          return null;
        }
        contentList.add(attrFn);
      }
      else if (parameters.getLexicalUnitType() == LexicalUnit.SAC_URI)
      {
        final CSSStringValue uriValue = CSSValueFactory.createUriValue(
            parameters);
        if (uriValue == null)
        {
          return null;
        }
        contentList.add(uriValue);
      }
      else if (isFunctionValue(parameters))
      {
        final CSSFunctionValue functionValue = parseFunction(parameters);
        if (functionValue == null)
        {
          return null;
        }
        contentList.add(functionValue);
      }
      else
      {
        // parse error: Something we do not understand ...
        return null;
      }
      parameters = CSSValueFactory.parseComma(parameters);
    }
    final CSSValue[] paramVals = (CSSValue[])
        contentList.toArray(new CSSValue[contentList.size()]);

    return new CSSFunctionValue(functionName, paramVals);
  }
View Full Code Here

Examples of org.pentaho.reporting.libraries.css.values.CSSFunctionValue

        return new StaticTextToken(sval.getValue());
      }
      else
      {
        // this is an external URL, so try to load it.
        final CSSFunctionValue function = new CSSFunctionValue
                ("url", new CSSValue[]{sval});
        return evaluateFunction(function, process, element);
      }
    }
View Full Code Here

Examples of org.pentaho.reporting.libraries.css.values.CSSFunctionValue

        return new StaticTextToken(sval.getValue());
      }
      else
      {
        // this is an external URL, so try to load it.
        final CSSFunctionValue function = new CSSFunctionValue
                ("url", new CSSValue[]{sval});
        return evaluateFunction(function, process, element);
      }
    }
View Full Code Here

Examples of org.pentaho.reporting.libraries.css.values.CSSFunctionValue

    // it might as well be a RGB- or HSL- function.

    if (value instanceof CSSFunctionValue)
    {
      final CSSFunctionValue functionValue = (CSSFunctionValue) value;
      final StyleValueFunction function = FunctionFactory.getInstance().getStyleFunction
                      (functionValue.getFunctionName());
      if (function == null)
      {
        value = HtmlColors.BLACK;
      }
      else
View Full Code Here

Examples of org.pentaho.reporting.libraries.css.values.CSSFunctionValue

    tokenMapping.put(ContentValues.CLOSE_QUOTE, new CloseQuoteToken(false));
    tokenMapping.put(ContentValues.NO_CLOSE_QUOTE, new CloseQuoteToken(true));

    final CSSStringValue param =
        new CSSStringValue(CSSStringType.STRING, "list-item");
    listCounter = new CSSFunctionValue("counter", new CSSValue[]{param});

  }
View Full Code Here

Examples of org.pentaho.reporting.libraries.css.values.CSSFunctionValue

          return new StaticTextToken(sval.getValue());
        }
        else
        {
          // this is an external URL, so try to load it.
          final CSSFunctionValue function = new CSSFunctionValue
              ("url", new CSSValue[]{sval});
          return evaluateFunction(function, process, element);
        }
      }
View Full Code Here

Examples of org.pentaho.reporting.libraries.css.values.CSSFunctionValue

    if (value instanceof CSSFunctionValue == false)
    {
      return value;
    }

    final CSSFunctionValue functionValue = (CSSFunctionValue) value;

    final StyleValueFunction function =
        FunctionFactory.getInstance().getStyleFunction
            (functionValue.getFunctionName());
    if (function == null)
    {
      throw new FunctionEvaluationException
          ("Unsupported Function: " + functionValue);
    }
View Full Code Here

Examples of org.pentaho.reporting.libraries.css.values.CSSFunctionValue

    final CSSValue rawValue = layoutContext.getValue(key);
    if (rawValue instanceof CSSFunctionValue)
    {
      // OK; check for pending ..
      final CSSFunctionValue function = (CSSFunctionValue) rawValue;
      if ("running".equals(function.getFunctionName()))
      {
        // The element will be inside a block-context (same behaviour as
        // for floats)
        layoutContext.setValue(BoxStyleKeys.DISPLAY_MODEL, DisplayModel.BLOCK_INSIDE);
        layoutContext.setValue(BoxStyleKeys.DISPLAY_ROLE, DisplayRole.BLOCK);
View Full Code Here

Examples of org.pentaho.reporting.libraries.css.values.CSSFunctionValue

    }

    if (value instanceof CSSFunctionValue)
    {
      // thats plain and simple - resolve it directly.
      final CSSFunctionValue functionValue = (CSSFunctionValue) value;
      final String name = functionValue.getFunctionName().toLowerCase();
      final StyleValueFunction o = (StyleValueFunction) functions.get(name);
      if (o == null)
      {
        throw new FunctionEvaluationException("No such function registered: " + name);
      }
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.