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

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


  public static void main(String[] args)
  {
    ClassicEngineBoot.getInstance().start();
    final ExpressionMetaData[] allExpressionMetaDatas = ExpressionRegistry.getInstance().getAllExpressionMetaDatas();
    final ExpressionMetaData data = ExpressionRegistry.getInstance().getExpressionMetaData(ConvertToNumberExpression.class.getName());
    System.out.println(new EditableExpressionMetaData((DefaultExpressionMetaData) data).isValid(Locale.getDefault(), false));
  }
View Full Code Here


    final ExpressionRegistry expressionRegistry = ExpressionRegistry.getInstance();
    final ExpressionMetaData[] allExpressions = expressionRegistry.getAllExpressionMetaDatas();
    for (int i = 0; i < allExpressions.length; i++)
    {
      final ExpressionMetaData expression = allExpressions[i];
      if (expression == null)
      {
        logger.warn("Null Expression encountered");
        continue;
      }
      if (isDeprecated(expression))
      {
        if (expression.isDeprecated() == false)
        {
          logger.warn("Expression code is deprecated, but metadata is not:" + expression.getExpressionType());
        }

        if ("Deprecated Function".equals(expression.getGrouping(Locale.US)) == false)
        {
          logger.warn("Expression metadata is not in deprecated group:" + expression.getExpressionType());
        }
      }
      else
      {
        if (expression.isDeprecated() == true)
        {
          logger.warn("Expression metadata is deprecated, but code is not:" + expression.getExpressionType());
        }
      }

    }
View Full Code Here

    assertNotNull(model.getChartExpressionsModel().getSelectedItem());
    assertNotNull(model.getPrimaryDataSourcesModel().getSelectedItem());
    assertNotNull(model.getSecondaryDataSourcesModel().getSelectedItem());


    final ExpressionMetaData expressionMetaData =
        ExpressionRegistry.getInstance().getExpressionMetaData(BarChartExpression.class.getName());
    model.getChartExpressionsModel().setSelectedItem(expressionMetaData);
    assertEquals(expressionMetaData, model.getChartExpressionsModel().getSelectedItem());
    assertTrue(model.getChartExpression().getClass() == BarChartExpression.class);
    assertEquals(ChartType.BAR, model.getCurrentChartType());
    assertSame(primaryDataCollector, model.getPrimaryDataSource());

    final ExpressionMetaData dsExpressionMetaData =
        ExpressionRegistry.getInstance().getExpressionMetaData(CategorySetDataCollector.class.getName());
    assertEquals(dsExpressionMetaData, model.getPrimaryDataSourcesModel().getSelectedItem());
    assertNull(model.getSecondaryDataSource());
    assertNull(model.getSecondaryDataSourcesModel().getSelectedItem());
  }
View Full Code Here

    final Object o = this.expressionEditor.getSelectedItem();
    if (o instanceof ExpressionMetaData)
    {
      try
      {
        final ExpressionMetaData emd = (ExpressionMetaData) o;
        return (Expression) emd.getExpressionType().newInstance();
      }
      catch (Throwable t)
      {
        UncaughtExceptionsModel.getInstance().addException(t);
        return null;
View Full Code Here

      }
      else if (selectedItem instanceof ExpressionMetaData)
      {
        try
        {
          final ExpressionMetaData emd = (ExpressionMetaData) selectedItem;
          final Expression expression = (Expression) emd.getExpressionType().newInstance();
          final ExpressionPropertiesDialog dialog;
          if (w instanceof Frame)
          {
            dialog = new ExpressionPropertiesDialog((Frame) w);
          }
View Full Code Here

    }

    try
    {
      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())
        {
View Full Code Here

    }

    try
    {
      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())
        {
View Full Code Here

  {
    final JLabel rendererComponent = (JLabel)
        super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
    if (value instanceof ExpressionMetaData)
    {
      final ExpressionMetaData metaData = (ExpressionMetaData) value;

      final boolean deprecated;
      final boolean expert;
      final boolean preferred;
      deprecated = metaData.isDeprecated();
      expert = metaData.isExpert();
      preferred = metaData.isPreferred();

      String prefix = "";
      if (deprecated)
      {
        prefix = "*";
      }
      int fontStyle = Font.PLAIN;
      if (expert)
      {
        fontStyle |= Font.ITALIC;
      }
      if (preferred)
      {
        fontStyle |= Font.BOLD;
      }
      rendererComponent.setFont(getFont().deriveFont(fontStyle));
      final String displayName = metaData.getDisplayName(Locale.getDefault());
      final String groupName = metaData.getGrouping(Locale.getDefault());
      rendererComponent.setToolTipText(metaData.getDeprecationMessage(Locale.getDefault()));
      rendererComponent.setText(prefix + displayName + " (" + groupName + ")");
    }
    else
    {
      rendererComponent.setText(" ");
View Full Code Here

    final Object o = this.expressionEditor.getSelectedItem();
    if (o instanceof ExpressionMetaData)
    {
      try
      {
        final ExpressionMetaData emd = (ExpressionMetaData) o;
        return (Expression) emd.getExpressionType().newInstance();
      }
      catch (Throwable t)
      {
        UncaughtExceptionsModel.getInstance().addException(t);
        return null;
View Full Code Here

      }
      else if (selectedItem instanceof ExpressionMetaData)
      {
        try
        {
          final ExpressionMetaData emd = (ExpressionMetaData) selectedItem;
          final Expression expression = (Expression) emd.getExpressionType().newInstance();
          final ExpressionPropertiesDialog dialog;
          if (w instanceof Frame)
          {
            dialog = new ExpressionPropertiesDialog((Frame) w);
          }
View Full Code Here

TOP

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

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.