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

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


        {
          inspectAttributeExpression(element, attrExprNamespace, name, expression, null);
        }
        else
        {
          final ExpressionMetaData metaData = ExpressionRegistry.getInstance().getExpressionMetaData(expressionName);
          inspectAttributeExpression(element, attrExprNamespace, name, expression, metaData);
        }
      }
    }
  }
View Full Code Here


      {
        inspectStyleExpression(element, styleKey, expression, null);
      }
      else
      {
        final ExpressionMetaData metaData = ExpressionRegistry.getInstance().getExpressionMetaData(expressionName);
        inspectStyleExpression(element, styleKey, expression, metaData);
      }
    }
  }
View Full Code Here

    final ExpressionMetaData[] allExpressionMetaDatas = ExpressionRegistry.getInstance().getAllExpressionMetaDatas();
    final ArrayList<ExpressionMetaData> list = new ArrayList<ExpressionMetaData>();
    list.add(null);
    for (int i = 0; i < allExpressionMetaDatas.length; i++)
    {
      final ExpressionMetaData data = allExpressionMetaDatas[i];
      if (data.isHidden())
      {
        continue;
      }

      if (AggregationFunction.class.isAssignableFrom(data.getExpressionType()))
      {
        list.add(data);
      }
    }

    final Locale locale = Locale.getDefault();
    availableTypeNames = new String[list.size()];
    availableTypes = new Class[list.size()];
    for (int i = 0; i < list.size(); i++)
    {
      final ExpressionMetaData data = list.get(i);
      if (data == null)
      {
        availableTypeNames[i] = null;
        availableTypes[i] = null;
      }
      else
      {
        availableTypeNames[i] = data.getDisplayName(locale);
        availableTypes[i] = data.getExpressionType();
      }
    }
  }
View Full Code Here

        return false;
      }

      if (ExpressionRegistry.getInstance().isExpressionRegistered(expressionType.getClass().getName()))
      {
        final ExpressionMetaData data = ExpressionRegistry.getInstance().getExpressionMetaData
            (expressionType.getName());
        if (data.isElementLayoutProcessor() || data.isGlobalLayoutProcessor())
        {
          // ignore the expression ..
          return true;
        }
      }
View Full Code Here

      {
        final ChartType chartType = editModel.getCurrentChartType();
        if (editModel.getPrimaryDataSource() == null)
        {
          final Class dataSourceImplementation = chartType.getPreferredPrimaryDataSourceImplementation();
          final ExpressionMetaData data =
              ExpressionRegistry.getInstance().getExpressionMetaData(dataSourceImplementation.getName());
          editModel.getPrimaryDataSourcesModel().setSelectedItem(data);
        }
        if (editModel.getSecondaryDataSource() == null)
        {
          final Class dataSourceImplementation = chartType.getPreferredSecondaryDataSourceImplementation();
          if (dataSourceImplementation != null)
          {
            final ExpressionMetaData data =
                ExpressionRegistry.getInstance().getExpressionMetaData(dataSourceImplementation.getName());
            editModel.getSecondaryDataSourcesModel().setSelectedItem(data);
          }
        }
      }
View Full Code Here

    private SelectChartExpressionAction(final Class expressionType)
    {
      this.expressionType = expressionType;

      final ExpressionRegistry expressionRegistry = ExpressionRegistry.getInstance();
      final ExpressionMetaData metaData = expressionRegistry.getExpressionMetaData(expressionType.getName());
      putValue(Action.NAME, metaData.getMetaAttribute("short-name", Locale.getDefault())); // NON-NLS

      final String defaultIcon = metaData.getMetaAttribute("icon", Locale.getDefault()); // NON-NLS
      if (defaultIcon != null)
      {
        final URL defaultIconUrl = LegacyChartEditorDialog.class.getResource(defaultIcon);
        if (defaultIconUrl != null)
        {
          standardIcon = new ImageIcon(defaultIconUrl);
          putValue(Action.SMALL_ICON, standardIcon);
        }
      }

      final String selectedIconProperty = metaData.getMetaAttribute("selected-icon", Locale.getDefault()); // NON-NLS
      if (selectedIconProperty != null)
      {
        final URL selectedIconUrl = LegacyChartEditorDialog.class.getResource(selectedIconProperty);
        if (selectedIconUrl != null)
        {
View Full Code Here

      }
    }

    public void actionPerformed(final ActionEvent e)
    {
      final ExpressionMetaData data = ExpressionRegistry.getInstance().getExpressionMetaData(expressionType.getName());
      editModel.getChartExpressionsModel().setSelectedItem(data);
    }
View Full Code Here

      // ignore
    }

    public void contentsChanged(final ListDataEvent e)
    {
      final ExpressionMetaData o = (ExpressionMetaData) editModel.getChartExpressionsModel().getSelectedItem();
      if (o != null && expressionType.equals(o.getExpressionType()))
      {
        putValue("selected", Boolean.TRUE); // NON-NLS
        putValue(Action.SMALL_ICON, selectedIcon);
      }
      else
View Full Code Here

    propertyChangeSupport.firePropertyChange(CHART_EXPRESSION_PROPERTY, oldChartExpression, chartExpression);

    if (this.chartExpression != null)
    {
      final String key = this.chartExpression.getClass().getName();
      final ExpressionMetaData newMetaData = ExpressionRegistry.getInstance().getExpressionMetaData(key);
      if (newMetaData == null)
      {
        chartExpressionsModel.setSelectedItem(null);
      }
      else
      {
        final Object selectedMetaData = chartExpressionsModel.getSelectedItem();
        if (selectedMetaData instanceof ExpressionMetaData)
        {
          final ExpressionMetaData metaData = (ExpressionMetaData) selectedMetaData;
          if (metaData.getExpressionType().equals(newMetaData.getExpressionType()) == false)
          {
            chartExpressionsModel.setSelectedItem(newMetaData);
          }
        }
        else
View Full Code Here

    {
      final Expression primaryDataSource = getPrimaryDataSource();
      if (isValidType(primaryDataSource, datasource.getResultType()) == false)
      {
        populateExpressionSelectorModel(primaryDataSourcesModel, datasource.getResultType());
        final ExpressionMetaData data =
            ExpressionRegistry.getInstance().getExpressionMetaData
                (type.getPreferredPrimaryDataSourceImplementation().getName());
        primaryDataSourcesModel.setSelectedItem(data);
      }
    }
    else
    {
      populateExpressionSelectorModel(primaryDataSourcesModel, null);
      setPrimaryDataSource(null);
    }

    final ChartDataSource secondaryDataSource = type.getSecondaryDataSource();
    if (secondaryDataSource != null)
    {
      final Expression dataSource = getSecondaryDataSource();
      if (isValidType(dataSource, secondaryDataSource.getResultType()) == false)
      {
        populateExpressionSelectorModel(secondaryDataSourcesModel, secondaryDataSource.getResultType());
        final ExpressionMetaData data =
            ExpressionRegistry.getInstance().getExpressionMetaData
                (type.getPreferredSecondaryDataSourceImplementation().getName());
        secondaryDataSourcesModel.setSelectedItem(data);
      }
    }
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.