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

Examples of org.pentaho.reporting.engine.classic.core.metadata.StyleMetaData


        final StyleMetaData[] styleDescriptions = metaData.getStyleDescriptions();
        Arrays.sort(styleDescriptions, new GroupedMetaDataComparator());
        System.out.println("     Styles:");
        for (int k = 0; k < styleDescriptions.length; k++)
        {
          final StyleMetaData styleMetaData = styleDescriptions[k];
          System.out.println("       " + styleMetaData.getGrouping(locale) + ":" + styleMetaData.getDisplayName(
              locale));
        }

//        final AttributeMetaData[] attrs = metaData.getAttributeDescriptions();
//        Arrays.sort(attrs, new GroupedMetaDataComparator());
View Full Code Here


      }

      final StyleMetaData[] styles = type.getStyleDescriptions();
      for (int j = 0; j < styles.length; j++)
      {
        final StyleMetaData style = styles[j];
        allStyles.put(style.getName(), style);
      }
    }

    final Iterator styleIt = allStyles.values().iterator();
    while (styleIt.hasNext())
    {
      StyleMetaData style = (StyleMetaData) styleIt.next();
      final String attrPrefix = "style." + style.getName();
      System.out.println(attrPrefix + ".display-name=" + style.getName());
      System.out.println(attrPrefix + ".description=");
      System.out.println(attrPrefix + ".grouping=Group");
    }
  }
View Full Code Here

    {
      final ElementMetaData elementMetaData = elementMetaDatas[i];
      final StyleMetaData[] styleMetaDatas = elementMetaData.getStyleDescriptions();
      for (int j = 0; j < styleMetaDatas.length; j++)
      {
        final StyleMetaData styleMetaData = styleMetaDatas[j];
        styles.put(styleMetaData.getName(), styleMetaData);
      }
    }

    final StyleMetaData[] stylesArray = (StyleMetaData[]) styles.values().toArray(new StyleMetaData[styles.size()]);
    Arrays.sort(stylesArray, new GroupedMetaDataComparator());
View Full Code Here

  private static void printWikiHeader(final StyleMetaData[] stylesArray)
  {
    Object oldGroup = null;
    for (int i = 0; i < stylesArray.length; i++)
    {
      final StyleMetaData data = stylesArray[i];
      final String grouping = escapeForWiki(data.getGrouping(Locale.ENGLISH));
      if (ObjectUtilities.equal(oldGroup, grouping) == false)
      {
        System.out.println("h2. " + grouping);
        System.out.println();
        oldGroup = grouping;
      }

      final String name = data.getName();
      final String description = escapeForWiki(data.getDescription(Locale.ENGLISH));
      final String displayName = escapeForWiki(data.getDisplayName(Locale.ENGLISH));
      final String deprecationMessage = escapeForWiki(data.getDeprecationMessage(Locale.ENGLISH));
      final boolean expert = data.isExpert();
      final boolean preferred = data.isPreferred();
      final boolean hidden = data.isHidden();
      final boolean deprecated = data.isDeprecated();

      if (preferred)
      {
        System.out.println("* *" + name + "* " + "(" + displayName + ")\\\\");
      }
View Full Code Here

      expressionsByGroup.add(grouping, metaData);

      final StyleMetaData[] styleMetaDatas = metaData.getStyleDescriptions();
      for (int j = 0; j < styleMetaDatas.length; j++)
      {
        final StyleMetaData propertyMetaData = styleMetaDatas[j];
        final String propertyDisplayName = propertyMetaData.getDisplayName(locale);
        if (isValid(propertyDisplayName, propertyMetaData.getName()) == false)
        {
          logger.warn("ElementType '" + typeName + ": Style " + propertyMetaData.getName() + ": No DisplayName");
        }

        final String propertyGrouping = propertyMetaData.getGrouping(locale);
        if (isValid(propertyGrouping, "Group") == false)
        {
          logger.warn("ElementType '" + typeName + ": Style " + propertyMetaData.getName() + ": Grouping is not valid");
        }
        if (propertyMetaData.isDeprecated())
        {
          final String deprecateMessage = propertyMetaData.getDeprecationMessage(locale);
          if (isValid(deprecateMessage, "Deprecated") == false)
          {
            logger.warn(
                "ElementType '" + typeName + ": Style " + propertyMetaData.getName() + ": No valid deprecate message");
          }
        }
      }


      final AttributeMetaData[] attributeMetaDatas = metaData.getAttributeDescriptions();
      for (int j = 0; j < attributeMetaDatas.length; j++)
      {
        final AttributeMetaData propertyMetaData = attributeMetaDatas[j];
        final String propertyDisplayName = propertyMetaData.getDisplayName(locale);
        if (isValid(propertyDisplayName, propertyMetaData.getName()) == false)
        {
          logger.warn("ElementType '" + typeName + ": Attr " + propertyMetaData.getName() + ": No DisplayName");
        }

        final String propertyGrouping = propertyMetaData.getGrouping(locale);
        if (isValid(propertyGrouping, "Group") == false)
        {
          logger.warn("ElementType '" + typeName + ": Attr " + propertyMetaData.getName() + ": Grouping is not valid");
        }
        if (propertyMetaData.isDeprecated())
        {
          final String deprecateMessage = propertyMetaData.getDeprecationMessage(locale);
          if (isValid(deprecateMessage, "Deprecated") == false)
          {
            logger.warn(
                "ElementType '" + typeName + ": Attr " + propertyMetaData.getName() + ": No valid deprecate message");
          }
        }
      }

      System.err.flush();
View Full Code Here

    {
      final ElementMetaData elementMetaData = elementMetaDatas[i];
      final StyleMetaData[] styleMetaDatas = elementMetaData.getStyleDescriptions();
      for (int j = 0; j < styleMetaDatas.length; j++)
      {
        final StyleMetaData styleMetaData = styleMetaDatas[j];
        styles.put(styleMetaData.getName(), styleMetaData);
      }
    }

    final StyleMetaData[] stylesArray = (StyleMetaData[]) styles.values().toArray(new StyleMetaData[styles.size()]);
    Arrays.sort(stylesArray, new PlainMetaDataComparator());

    for (int i = 0; i < stylesArray.length; i++)
    {
      StyleMetaData metaData = stylesArray[i];
      final String name = metaData.getName();
      System.out.println("style." + name + ".display-name=" + name);
      System.out.println("style." + name + ".grouping=" + filter(metaData.getGrouping(Locale.ENGLISH), "Group"));
      System.out.println("style." + name + ".description="+ filter(metaData.getDescription(Locale.ENGLISH), ""));
      System.out.println("style." + name + ".deprecated="+ filter(metaData.getDeprecationMessage(Locale.ENGLISH), ""));

    }
  }
View Full Code Here

  {
    if (expressionMetaData == null)
    {
      return;
    }
    final StyleMetaData styleMetaData = element.getMetaData().getStyleDescription(styleKey);
    if (styleMetaData == null)
    {
      return;
    }

    if (styleMetaData.getCompatibilityLevel() > compatibilityLevel)
    {
      resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
          Messages.getString("ReportMigrationInspection.StyleExpressionInvalid",
              styleMetaData.getDisplayName(Locale.getDefault()), element.getName(), compatibilityText),
          new StyleLocationInfo(element, styleKey, false)));
    }

    if (expressionMetaData.getCompatibilityLevel() > compatibilityLevel)
    {
      resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
          Messages.getString("ReportMigrationInspection.StyleExpressionInvalid",
              styleMetaData.getDisplayName(Locale.getDefault()), element.getName(), compatibilityText),
          new StyleLocationInfo(element, styleKey, false)));
    }
  }
View Full Code Here

            support.setFormatString(fmtString);
          }
        }
        catch (Exception e)
        {
          final StyleMetaData attrMetaData = element.getMetaData().getStyleDescription(styleKey);
          resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
              Messages.getString("InvalidFormatInspection.StyleExpressionInvalidFormat",
                  element.getName(), attrMetaData.getDisplayName(Locale.getDefault()), fmtString, metaData.getDisplayName(Locale.getDefault())),
              new StyleExpressionPropertyLocationInfo(element, styleKey, metaData.getName())));
        }
      }
    }
    catch (Exception e)
View Full Code Here

          final StyleKey styleKey = definedPropertyNamesArray[j];
          if (styleKey == null)
          {
            continue;
          }
          final StyleMetaData styleDescr = metaData.getStyleDescription(styleKey);
          if (styleDescr == null)
          {
            // skip if the target element does not have that style ..
            continue;
          }
View Full Code Here

        }

        final Object o = utility.getProperty(metaData.getName());
        if (metaData.isMandatory() && o == null)
        {
          final StyleMetaData description = element.getMetaData().getStyleDescription(styleKey);
          final String displayName;
          if (description == null)
          {
            displayName = styleKey.getName();
          }
          else
          {
            displayName = description.getDisplayName(Locale.getDefault());
          }

          resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
              Messages.getString("ExpressionsParameterInspection.StyleExpressionMandatoryPropertyMissing",
                  element.getName(), displayName, metaData.getDisplayName(Locale.getDefault())),
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.engine.classic.core.metadata.StyleMetaData

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.