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

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


    }
  }

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

    switch (columnIndex)
    {
      case 0:
        return new GroupedName(metaData.getDisplayName(Locale.getDefault()), metaData.getGrouping(Locale.getDefault()));
      case 1:
        return computeFullValue(metaData, rowIndex);
      case 2:
        return computeExpressionValue(metaData, rowIndex);
      default:
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

                                final ReportElement element)
  {
    final AttributeMetaData[] datas = element.getMetaData().getAttributeDescriptions();
    for (int i = 0; i < datas.length; i++)
    {
      final AttributeMetaData data = datas[i];
      final Object value = element.getAttribute(data.getNameSpace(), data.getName());
      final String[] referencedFields = data.getReferencedFields(element, value);

      for (int j = 0; j < referencedFields.length; j++)
      {
        final String field = referencedFields[j];
        if (isValidField(field, columnNames) == false)
        {
          resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
              Messages.getString("InvalidFieldReferenceInspection.AttributeInvalidField", element.getName(),
                  field, data.getDisplayName(Locale.getDefault())),
              new AttributeLocationInfo(element, data.getNameSpace(), data.getName(), false)));
        }
      }
    }

    traverseAttributeExpressions(designerContext, reportRenderContext, resultHandler, columnNames, element);
View Full Code Here

        for (int y = 0; y < referencedFields.length; y++)
        {
          final String field = referencedFields[y];
          if (isValidField(field, columnNames) == false)
          {
            final AttributeMetaData attrMetaData =
                element.getMetaData().getAttributeDescription(attributeNamespace, attributeName);
            if (attrMetaData == null)
            {
              resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
                  Messages.getString("InvalidFieldReferenceInspection.AttributeExpressionInvalidFieldNoMetaData",
                      element.getName(), attributeNamespace, attributeName, field, metaData.getDisplayName(Locale.getDefault())),
                  new AttributeExpressionPropertyLocationInfo(element, attributeNamespace, attributeName, metaData.getName())));
            }
            else
            {
              resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
                  Messages.getString("InvalidFieldReferenceInspection.AttributeExpressionInvalidField",
                      element.getName(), attrMetaData.getDisplayName(Locale.getDefault()), field, metaData.getDisplayName(Locale.getDefault())),
                  new AttributeExpressionPropertyLocationInfo(element, attributeNamespace, attributeName, metaData.getName())));
            }
          }
        }
      }
View Full Code Here

                                            final String attributeNamespace,
                                            final String attributeName,
                                            final Expression expression,
                                            final ExpressionMetaData expressionMetaData)
  {
    final AttributeMetaData attrDescr = element.getMetaData().getAttributeDescription(attributeNamespace, attributeName);
    if (attrDescr != null && attrDescr.isDeprecated())
    {
      final String message = attrDescr.getDeprecationMessage(Locale.getDefault());
      resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
          Messages.getString("DeprecatedUsagesInspection.StyleExpressionTargetDeprecated",
              element.getName(), attrDescr.getDisplayName(Locale.getDefault()), message),
          new AttributeLocationInfo(element, attributeNamespace, attributeName, true)));
    }

    if (expressionMetaData == null)
    {
      return;
    }

    if (expressionMetaData.isDeprecated() == false)
    {
      return;
    }
    final String message = expressionMetaData.getDeprecationMessage(Locale.getDefault());
    if (attrDescr != null)
    {
      resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
          Messages.getString("DeprecatedUsagesInspection.StyleExpressionDeprecated",
              element.getName(), attrDescr.getDisplayName(Locale.getDefault()), message),
          new AttributeLocationInfo(element, attributeNamespace, attributeName, true)));
    }
    else
    {
      resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
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.