Examples of FormulaExpression


Examples of org.pentaho.reporting.engine.classic.core.function.FormulaExpression

  private String computeFormula(final Expression expression, final String staticValue)
  {
    if (expression instanceof FormulaExpression)
    {
      final FormulaExpression formulaExpression = (FormulaExpression) expression;
      return formulaExpression.getFormula();
    }
    if (expression == null &&
        StringUtils.isEmpty(staticValue) == false)
    {
      return '=' + FormulaUtil.quoteString(staticValue);
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.function.FormulaExpression

    }

    final String formulaText = drillDownEditor.getDrillDownFormula();
    if (StringUtils.isEmpty(formulaText) == false)
    {
      final FormulaExpression formulaExpression = new FormulaExpression();
      formulaExpression.setFormula(formulaText);
      styleSheet.setStyleProperty(ElementStyleKeys.HREF_TARGET, null);
      styleExpressions.put(ElementStyleKeys.HREF_TARGET, formulaExpression);
    }
    else
    {
      styleExpressions.put(ElementStyleKeys.HREF_TARGET, null);
      styleSheet.setStyleProperty(ElementStyleKeys.HREF_TARGET, null);
    }

    final String targetText = drillDownEditor.getTargetFormula();
    if (StringUtils.isEmpty(targetText) == false)
    {
      final String staticText = FormulaUtil.extractStaticTextFromFormula(targetText);
      if (staticText != null)
      {
        styleSheet.setStyleProperty(ElementStyleKeys.HREF_WINDOW, staticText);
        styleExpressions.put(ElementStyleKeys.HREF_WINDOW, null);
      }
      else
      {
        final FormulaExpression formulaExpression = new FormulaExpression();
        formulaExpression.setFormula(targetText);
        styleSheet.setStyleProperty(ElementStyleKeys.HREF_WINDOW, null);
        styleExpressions.put(ElementStyleKeys.HREF_WINDOW, formulaExpression);
      }
    }
    else
    {
      styleSheet.setStyleProperty(ElementStyleKeys.HREF_WINDOW, null);
      styleExpressions.put(ElementStyleKeys.HREF_WINDOW, null);
    }

    final String tooltipText = drillDownEditor.getTooltipFormula();
    if (StringUtils.isEmpty(tooltipText) == false)
    {
      final String staticText = FormulaUtil.extractStaticTextFromFormula(tooltipText);
      if (staticText != null)
      {
        styleSheet.setStyleProperty(ElementStyleKeys.HREF_TITLE, staticText);
        styleExpressions.put(ElementStyleKeys.HREF_TITLE, null);
      }
      else
      {
        final FormulaExpression formulaExpression = new FormulaExpression();
        formulaExpression.setFormula(tooltipText);
        styleSheet.setStyleProperty(ElementStyleKeys.HREF_TITLE, null);
        styleExpressions.put(ElementStyleKeys.HREF_TITLE, formulaExpression);
      }
    }
    else
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.function.FormulaExpression

  public String getFormulaText()
  {
    final Expression value = targetFormula.getValue();
    if (value instanceof FormulaExpression)
    {
      final FormulaExpression formulaExpression = (FormulaExpression) value;
      return formulaExpression.getFormula();
    }
    return null;
  }
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.function.FormulaExpression

    if (text.equals(getFormulaText()))
    {
      return;
    }

    final FormulaExpression fe = new FormulaExpression();
    fe.setFormula(text);
    targetFormula.setValue(fe);

  }
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.function.FormulaExpression

    {
      element.setAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.FIELD, getFieldname());
    }
    if (getFormula() != null)
    {
      final FormulaExpression formulaExpression = new FormulaExpression();
      formulaExpression.setFormula(getFormula());
      element.setAttributeExpression(AttributeNames.Core.NAMESPACE, AttributeNames.Core.VALUE, formulaExpression);
    }
    if (startAngle != null)
    {
      element.setAttribute(SparklineAttributeNames.NAMESPACE, SparklineAttributeNames.START_ANGLE, startAngle);
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.function.FormulaExpression

    {
      element.setAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.FIELD, getFieldname());
    }
    if (getFormula() != null)
    {
      final FormulaExpression formulaExpression = new FormulaExpression();
      formulaExpression.setFormula(getFormula());
      element.setAttributeExpression(AttributeNames.Core.NAMESPACE, AttributeNames.Core.VALUE, formulaExpression);
    }
    if (spacing != null)
    {
      element.setAttribute(SparklineAttributeNames.NAMESPACE, SparklineAttributeNames.SPACING, spacing);
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.function.FormulaExpression

      throws IOException
  {
    final XmlWriter writer = getXmlWriter();
    if (expression instanceof FormulaExpression)
    {
      final FormulaExpression fe = (FormulaExpression) expression;
      final AttributeList properties = new AttributeList();
      if (expression.getName() != null)
      {
        properties.setAttribute(ExtParserModule.NAMESPACE, "name", expression.getName());
      }
      properties.setAttribute(ExtParserModule.NAMESPACE, "formula", fe.getFormula());
      if (expression.getDependencyLevel() > 0)
      {
        properties.setAttribute(ExtParserModule.NAMESPACE, "deplevel", String.valueOf(
            expression.getDependencyLevel()));
      }
      writer.writeTag(ExtParserModule.NAMESPACE, FunctionsWriter.EXPRESSION_TAG, properties, XmlWriterSupport.CLOSE);
      return;
    }

    if (expression instanceof FormulaFunction)
    {
      final FormulaFunction fe = (FormulaFunction) expression;
      final AttributeList properties = new AttributeList();
      if (expression.getName() != null)
      {
        properties.setAttribute(ExtParserModule.NAMESPACE, "name", expression.getName());
      }
      properties.setAttribute(ExtParserModule.NAMESPACE, "formula", fe.getFormula());
      properties.setAttribute(ExtParserModule.NAMESPACE, "initial", fe.getInitial());
      if (expression.getDependencyLevel() > 0)
      {
        properties.setAttribute(ExtParserModule.NAMESPACE, "deplevel", String.valueOf(
            expression.getDependencyLevel()));
      }
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.function.FormulaExpression

    {
      element.setAttribute(AttributeNames.Core.NAMESPACE, AttributeNames.Core.FIELD, getFieldname());
    }
    if (getFormula() != null)
    {
      final FormulaExpression formulaExpression = new FormulaExpression();
      formulaExpression.setFormula(getFormula());
      element.setAttributeExpression(AttributeNames.Core.NAMESPACE, AttributeNames.Core.VALUE, formulaExpression);
    }
    if (spacing != null)
    {
      element.setAttribute(SparklineAttributeNames.NAMESPACE, SparklineAttributeNames.SPACING, spacing);
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.function.FormulaExpression

                                   final StyleKey styleKey)
      throws IOException
  {
    if (expression instanceof FormulaExpression)
    {
      final FormulaExpression fe = (FormulaExpression) expression;
      final AttributeList properties = new AttributeList();
      properties.setAttribute(ExtParserModule.NAMESPACE, "style-key", styleKey.getName());
      properties.setAttribute(ExtParserModule.NAMESPACE, "formula", fe.getFormula());
      if (expression.getDependencyLevel() > 0)
      {
        properties.setAttribute(ExtParserModule.NAMESPACE, "deplevel", String.valueOf(
            expression.getDependencyLevel()));
      }
      getXmlWriter().writeTag(ExtParserModule.NAMESPACE, FunctionsWriter.STYLE_EXPRESSION_TAG, properties,
          XmlWriterSupport.CLOSE);
      return;
    }

    if (expression instanceof FormulaFunction)
    {
      final FormulaFunction fe = (FormulaFunction) expression;
      final AttributeList properties = new AttributeList();
      properties.setAttribute(ExtParserModule.NAMESPACE, "style-key", styleKey.getName());
      properties.setAttribute(ExtParserModule.NAMESPACE, "formula", fe.getFormula());
      properties.setAttribute(ExtParserModule.NAMESPACE, "initial", fe.getInitial());
      if (expression.getDependencyLevel() > 0)
      {
        properties.setAttribute(ExtParserModule.NAMESPACE, "deplevel", String.valueOf(
            expression.getDependencyLevel()));
      }
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.function.FormulaExpression

    final String formula = attrs.getValue(getUri(), "formula");
    if (expressionClassName == null)
    {
      if (formula != null)
      {
        final FormulaExpression expression = new FormulaExpression();
        expression.setFormula(formula);
        this.expression = expression;
        this.expression.setName(name); // doesnt matter anyway, but it feels good :)
      }
      else
      {
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.