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

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


      final BeanUtility utility = new BeanUtility(expression);
      final ExpressionMetaData data = ExpressionRegistry.getInstance().getExpressionMetaData(expressionName);
      final ExpressionPropertyMetaData[] datas = data.getPropertyDescriptions();
      for (int i = 0; i < datas.length; i++)
      {
        final ExpressionPropertyMetaData metaData = datas[i];
        if (metaData.isHidden())
        {
          continue;
        }
        if (WorkspaceSettings.getInstance().isShowExpertItems() == false && metaData.isExpert())
        {
          continue;
        }
        if (WorkspaceSettings.getInstance().isShowDeprecatedItems() == false && metaData.isDeprecated())
        {
          continue;
        }
        if ("name".equals(metaData.getName()))
        {
          continue;
        }

        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())),
              new StyleExpressionPropertyLocationInfo(element, styleKey, metaData.getName())));
        }
      }

      if (expression instanceof ValidateableExpression)
      {
View Full Code Here


    {
      final BeanUtility utility = new BeanUtility(expression);
      final ExpressionPropertyMetaData[] datas = expressionMetaData.getPropertyDescriptions();
      for (int i = 0; i < datas.length; i++)
      {
        final ExpressionPropertyMetaData metaData = datas[i];
        if (metaData.isHidden())
        {
          continue;
        }
        if (WorkspaceSettings.getInstance().isShowExpertItems() == false && metaData.isExpert())
        {
          continue;
        }
        if (WorkspaceSettings.getInstance().isShowDeprecatedItems() == false && metaData.isDeprecated())
        {
          continue;
        }

        if (!"Group".equals(metaData.getPropertyRole()))//NON-NLS
        {
          continue;
        }

        final Object o = utility.getProperty(metaData.getName());
        final String[] elements = metaData.getReferencedGroups(expression, o);
        for (int j = 0; j < elements.length; j++)
        {
          final String element = elements[j];
          final AbstractReportDefinition reportDefinition = reportRenderContext.getReportDefinition();
          final ReportElement e = reportDefinition.getGroupByName(element);
          if (e == null)
          {
            resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
                Messages.getString("InvalidGroupReferenceInspection.ExpressionInvalidGroup",
                    expression.getName(), element, metaData.getDisplayName(Locale.getDefault())),
                new PropertyLocationInfo(expression, metaData.getName())));
          }
        }
      }
    }
    catch (Exception e)
View Full Code Here

        for (int i = 0; i < metaData.length; i++)
        {
          if (groupCount == 0)
          {
            groupCount = 1;
            final ExpressionPropertyMetaData firstdata = metaData[i];
            oldValue = firstdata.getGrouping(locale);
            continue;
          }

          final ExpressionPropertyMetaData data = metaData[i];
          final String grouping = data.getGrouping(locale);
          if ((ObjectUtilities.equal(oldValue, grouping)) == false)
          {
            oldValue = grouping;
            groupCount += 1;
          }
        }
      }

      final ExpressionPropertyMetaData[] groupedMetaData = new ExpressionPropertyMetaData[metaData.length + groupCount];
      this.groupings = new GroupingHeader[groupedMetaData.length];
      int targetIdx = 0;
      GroupingHeader group = null;
      for (int sourceIdx = 0; sourceIdx < metaData.length; sourceIdx++)
      {
        final ExpressionPropertyMetaData data = metaData[sourceIdx];
        if (sourceIdx == 0)
        {
          group = new GroupingHeader(data.getGrouping(locale));
          groupings[targetIdx] = group;
          targetIdx += 1;
        }
        else
        {
          final String newgroup = data.getGrouping(locale);
          if ((ObjectUtilities.equal(newgroup, group.getHeaderText())) == false)
          {
            group = new GroupingHeader(newgroup);
            groupings[targetIdx] = group;
            targetIdx += 1;
View Full Code Here

          ExpressionRegistry.getInstance().getExpressionMetaData(key);

      final ExpressionPropertyMetaData[] datas = metaData.getPropertyDescriptions();
      for (int styleIdx = 0; styleIdx < datas.length; styleIdx++)
      {
        final ExpressionPropertyMetaData data = datas[styleIdx];
        if (isFiltered(data))
        {
          continue;
        }

        final String name = data.getName();
        final Object attribute = attributes.get(name);
        if (Boolean.TRUE.equals(attribute))
        {
          // fine, we already have a value for it.
        }
View Full Code Here

    }
  }

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

    }
  }

  public boolean isCellEditable(final int rowIndex, final int columnIndex)
  {
    final ExpressionPropertyMetaData metaData = getMetaData(rowIndex);
    if (metaData == null)
    {
      return false;
    }
View Full Code Here

  }


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

    }
  }

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

    switch (columnIndex)
    {
      case 0:
        return GroupedName.class;
      case 1:
        return metaData.getPropertyType();
      default:
        throw new IndexOutOfBoundsException();
    }
  }
View Full Code Here

    }
  }

  public PropertyEditor getEditorForCell(final int aRowIndex, final int aColumnIndex)
  {
    final ExpressionPropertyMetaData metaData = getMetaData(aRowIndex);
    if (metaData == null)
    {
      // a header row
      return null;
    }

    try
    {
      switch (aColumnIndex)
      {
        case 0:
          return null;
        case 1:
          final PropertyEditor editor = metaData.getEditor();
          if (editor != null)
          {
            return editor;
          }

          final Class editorClass = metaData.getBeanDescriptor().getPropertyEditorClass();
          if (editorClass != null)
          {
            return (PropertyEditor) editorClass.newInstance();
          }

          if (String.class.equals(metaData.getPropertyType()))
          {
            return null;
          }

          return FastPropertyEditorManager.findEditor(metaData.getPropertyType());
        default:
          throw new IndexOutOfBoundsException();
      }
    }
    catch (Exception e)
View Full Code Here

  {
    if (column != 1)
    {
      return null;
    }
    final ExpressionPropertyMetaData metaData = getMetaData(row);
    if (metaData == null)
    {
      return null;
    }
    return metaData.getPropertyRole();
  }
View Full Code Here

TOP

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

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.