Package org.pentaho.reporting.engine.classic.core.filter

Examples of org.pentaho.reporting.engine.classic.core.filter.MessageFormatSupport


      return new String[]{String.valueOf(attributeValue)};
    }
    else if ("Message".equals(propertyRole))
    {
      final String message = String.valueOf(attributeValue);
      final MessageFormatSupport messageFormatSupport = new MessageFormatSupport();
      messageFormatSupport.setFormatString(message);
      return messageFormatSupport.getFields();
    }
    else if ("Formula".equals(propertyRole))
    {
      final String formula = String.valueOf(attributeValue);
      try
View Full Code Here


      return new String[]{String.valueOf(attributeValue)};
    }
    else if ("Message".equals(valueRole))
    {
      final String message = String.valueOf(attributeValue);
      final MessageFormatSupport messageFormatSupport = new MessageFormatSupport();
      messageFormatSupport.setFormatString(message);
      return messageFormatSupport.getFields();
    }
    else if ("Formula".equals(valueRole))
    {
      final String formula = String.valueOf(attributeValue);
      try
View Full Code Here

        final String message = (String) oldAttributes.getAttribute(CORE_NAMESPACE, VALUE_ATTRIBUTE);
        visualElement.setAttribute(CORE_NAMESPACE, VALUE_ATTRIBUTE, null);
        try
        {

          final MessageFormatSupport fmt = new MessageFormatSupport();
          fmt.setFormatString(message);
          final String rawFormat = fmt.getCompiledFormat();
          final MessageFormat msg = new MessageFormat(rawFormat);
          final Format[] subFormats = msg.getFormats();

          if (targetElementType instanceof DateFieldType)
          {
            final int sdf = findFirstDateFormat(subFormats);
            if (sdf != -1)
            {
              final SimpleDateFormat df = (SimpleDateFormat) subFormats[sdf];

              final String[] fields = fmt.getFields();
              visualElement.setAttribute(CORE_NAMESPACE, FIELD_ATTRIBUTE, fields[sdf]);
              visualElement.setAttribute(CORE_NAMESPACE, FORMAT_ATTRIBUTE, df.toPattern());
            }
          }
          else if (targetElementType instanceof NumberFieldType)
          {
            final int sdf = findFirstNumberFormat(subFormats);
            if (sdf != -1)
            {
              final DecimalFormat df = (DecimalFormat) subFormats[sdf];

              final String[] fields = fmt.getFields();
              visualElement.setAttribute(CORE_NAMESPACE, FIELD_ATTRIBUTE, fields[sdf]);
              visualElement.setAttribute(CORE_NAMESPACE, FORMAT_ATTRIBUTE, df.toPattern());
            }
          }
          else
          {
            final String[] fields = fmt.getFields();
            if (fields.length > 0)
            {
              visualElement.setAttribute(CORE_NAMESPACE, FIELD_ATTRIBUTE, fields[0]);
            }
            else
View Full Code Here

          //noinspection SimpleDateFormatWithoutLocale
          final DateFormat fmt = new SimpleDateFormat(fmtString);
        }
        else if ("Message".equals(role))//NON-NLS
        {
          final MessageFormatSupport support = new MessageFormatSupport();
          support.setFormatString(fmtString);
        }
      }
      catch (Exception e)
      {
        resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
View Full Code Here

            //noinspection SimpleDateFormatWithoutLocale
            final DateFormat fmt = new SimpleDateFormat(String.valueOf(o));
          }
          else if ("Message".equals(role))//NON-NLS
          {
            final MessageFormatSupport support = new MessageFormatSupport();
            support.setFormatString(fmtString);
          }
        }
        catch (Exception e)
        {
          final AttributeMetaData attrMetaData =
View Full Code Here

            //noinspection SimpleDateFormatWithoutLocale
            final DateFormat fmt = new SimpleDateFormat(String.valueOf(o));
          }
          else if ("Message".equals(role))//NON-NLS
          {
            final MessageFormatSupport support = new MessageFormatSupport();
            support.setFormatString(fmtString);
          }
        }
        catch (Exception e)
        {
          final StyleMetaData attrMetaData = element.getMetaData().getStyleDescription(styleKey);
View Full Code Here

            //noinspection SimpleDateFormatWithoutLocale
            final DateFormat fmt = new SimpleDateFormat(String.valueOf(o));
          }
          else if ("Message".equals(role))//NON-NLS
          {
            final MessageFormatSupport support = new MessageFormatSupport();
            support.setFormatString(fmtString);
          }
        }
        catch (Exception e)
        {
          resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.engine.classic.core.filter.MessageFormatSupport

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.