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

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



      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) == false)
        {
          logger.warn("ElementType '" + typeName + ": Attr " + propertyMetaData.getName() + ": No DisplayName");
        }

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

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


      System.out.println();

      final AttributeMetaData[] attributeDescriptions = type.getAttributeDescriptions();
      for (int j = 0; j < attributeDescriptions.length; j++)
      {
        final AttributeMetaData attribute = attributeDescriptions[j];
        final String attrNs = ElementTypeRegistry.getInstance().getNamespacePrefix(attribute.getNameSpace());
        final String attrPrefix;
        if (attribute instanceof AbstractMetaData)
        {
          final AbstractMetaData metaData = (AbstractMetaData) attribute;
          final String prefixMetadata = metaData.getKeyPrefix();
          if (StringUtils.isEmpty(prefixMetadata))
          {
            attrPrefix = "";
          }
          else
          {
            attrPrefix = prefixMetadata + attribute.getName() + ".";
          }
        }
        else
        {
          attrPrefix = "element." + type.getName() + ".attribute." + attrNs + "." + attribute.getName();
        }
        attributes.put(attrPrefix, new AttributeCarrier(attrPrefix, attribute));
      }
    }

    System.out.println ("# Attribute definitions");
    final AttributeCarrier[] attributeMetadata = attributes.values().toArray(new AttributeCarrier[attributes.size()]);
    Arrays.sort(attributeMetadata);
    for (int i = 0; i < attributeMetadata.length; i++)
    {
      final AttributeCarrier carrier = attributeMetadata[i];
      final AttributeMetaData attribute = carrier.metaData;
      final String attrNs = ElementTypeRegistry.getInstance().getNamespacePrefix(attribute.getNameSpace());
      final String attrPrefix = carrier.prefix;
      printMetadata(attribute, attrPrefix, "display-name", attribute.getName());
      printMetadata(attribute, attrPrefix, "grouping", attrNs);
      printMetadata(attribute, attrPrefix, "grouping.ordinal", "0");
      printMetadata(attribute, attrPrefix, "ordinal", "0");
      printMetadata(attribute, attrPrefix, "description", "");
      printMetadata(attribute, attrPrefix, "deprecated", "");
View Full Code Here

    final HashMap<String, Object> values = new HashMap<String, Object>();
    final ElementMetaData metaData = e.getElementType().getMetaData();
    final AttributeMetaData[] attributeDescriptions = metaData.getAttributeDescriptions();
    for (int i = 0; i < attributeDescriptions.length; i++)
    {
      final AttributeMetaData attributeDescription = attributeDescriptions[i];
      final Object attribute = e.getAttribute(attributeDescription.getNameSpace(), attributeDescription.getName());
      if (attribute == null)
      {
        continue;
      }

      final String[] referencedFields = attributeDescription.getReferencedFields(e, attribute);
      for (int j = 0; j < referencedFields.length; j++)
      {
        final String field = referencedFields[j];
        final Object value = currentDataRow.get(field);
        values.put(field, value);
View Full Code Here

    }
  }

  public Object getValueAt(final int rowIndex, final int columnIndex)
  {
    final AttributeMetaData metaData = getMetaData(rowIndex);
    if (metaData == null)
    {
      return getGroupings(rowIndex);
    }
View Full Code Here

    }
  }

  public boolean isCellEditable(final int rowIndex, final int columnIndex)
  {
    final AttributeMetaData metaData = getMetaData(rowIndex);
    if (metaData == null)
    {
      return false;
    }

    switch (columnIndex)
    {
      case 0:
        return false;
      case 1:
        return "ElementType".equals(metaData.getValueRole()) == false; // $NON-NLS$
      case 2:
      {
        if ("ElementType".equals(metaData.getValueRole()))// $NON-NLS$
        {
          return false;
        }
        if (metaData.isDesignTimeValue())
        {
          return false;
        }
        return true;
      }
View Full Code Here

  }


  public void setValueAt(final Object aValue, final int rowIndex, final int columnIndex)
  {
    final AttributeMetaData metaData = getMetaData(rowIndex);
    if (metaData == null)
    {
      return;
    }
View Full Code Here

    return lastElement;
  }

  public Class getClassForCell(final int rowIndex, final int columnIndex)
  {
    final AttributeMetaData metaData = getMetaData(rowIndex);
    if (metaData == null)
    {
      return GroupingHeader.class;
    }

    switch (columnIndex)
    {
      case 0:
        return GroupedName.class;
      case 1:
        return metaData.getTargetType();
      case 2:
        if (metaData.isDesignTimeValue())
        {
          // disables the expression-editor.
          return Object.class;
        }
        return Expression.class;
View Full Code Here

    }
  }

  public PropertyEditor getEditorForCell(final int rowIndex, final int columnIndex)
  {
    final AttributeMetaData metaData = getMetaData(rowIndex);
    if (metaData == null)
    {
      return null;
    }
View Full Code Here

    if (column != 1)
    {
      return null;
    }

    final AttributeMetaData metaData = getMetaData(row);
    if (metaData == null)
    {
      return null;
    }
    return metaData.getValueRole();
  }
View Full Code Here

    if (column == 0)
    {
      return EMPTY_FIELDS;
    }

    final AttributeMetaData metaData = getMetaData(row);
    if (metaData == null)
    {
      return EMPTY_FIELDS;
    }
    return metaData.getExtraCalculationFields();
  }
View Full Code Here

TOP

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

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.