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

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


    {
      this.value = anObject;
      this.textField.setEnabled(false);
      if (ExpressionRegistry.getInstance().isExpressionRegistered(value.getClass().getName()))
      {
        final ExpressionMetaData data =
            ExpressionRegistry.getInstance().getExpressionMetaData(value.getClass().getName());
        this.textField.setText(data.getDisplayName(Locale.getDefault()));
      }
      else
      {
        this.textField.setText(value.getClass().getName());
      }
    }
    else if (anObject instanceof ExpressionMetaData)
    {
      final ExpressionMetaData emd = (ExpressionMetaData) anObject;
      this.value = anObject;
      this.textField.setEnabled(false);
      this.textField.setText(emd.getDisplayName(Locale.getDefault()));
    }
    else if (anObject != null)
    {
      DebugLog.log("ExpressionComboBoxEditor: Invalid object encountered: " + anObject); // NON-NLS
      this.value = null;
View Full Code Here


  {
    final JLabel rendererComponent = (JLabel)
        super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus);
    if (value instanceof ExpressionMetaData)
    {
      final ExpressionMetaData metaData = (ExpressionMetaData) value;
      rendererComponent.setText(metaData.getDisplayName(Locale.getDefault()));
      rendererComponent.setToolTipText(metaData.getDeprecationMessage(Locale.getDefault()));
    }
    return rendererComponent;
  }
View Full Code Here

    final ArrayList<ExpressionMetaData> allRealExpressions = new ArrayList<ExpressionMetaData>();
    final ArrayList<ExpressionMetaData> allExpressions = new ArrayList<ExpressionMetaData>();
    final ExpressionMetaData[] allExpressionMetaDatas = ExpressionRegistry.getInstance().getAllExpressionMetaDatas();
    for (int i = 0; i < allExpressionMetaDatas.length; i++)
    {
      final ExpressionMetaData metaData = allExpressionMetaDatas[i];
      if (metaData.isHidden())
      {
        continue;
      }
      if (WorkspaceSettings.getInstance().isShowExpertItems() == false && metaData.isExpert())
      {
        continue;
      }
      if (WorkspaceSettings.getInstance().isShowDeprecatedItems() == false && metaData.isDeprecated())
      {
        continue;
      }

      if (Function.class.isAssignableFrom(metaData.getExpressionType()) == false)
      {
        allRealExpressions.add(metaData);
      }
      allExpressions.add(metaData);
    }
View Full Code Here

        setText(expression.getClass().getName());
      }
      else
      {
        final ExpressionMetaData expressionMetaData =
            ExpressionRegistry.getInstance().getExpressionMetaData(expression.getClass().getName());

        if (expression.getName() == null)
        {
          setText(expressionMetaData.getDisplayName(Locale.getDefault()));
        }
        else
        {
          setText(Messages.getString("StructureTreeCellRenderer.NamedExpressionMessage",
              expressionMetaData.getDisplayName(Locale.getDefault()), expression.getName()));
        }
      }
    }
    else if (value instanceof ParameterDefinitionEntry)
    {
View Full Code Here

      {
        return;
      }
      try
      {
        final ExpressionMetaData metaData = (ExpressionMetaData) o;
        expression = (Expression) metaData.getExpressionType().newInstance();
      }
      catch (Exception e1)
      {
        UncaughtExceptionsModel.getInstance().addException(e1);
      }
View Full Code Here

      {
        // we cannot even attempt to edit such unknown expressions.
        return new ExpressionPropertyMetaData[0];
      }

      final ExpressionMetaData metaData =
          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))
        {
View Full Code Here

    model.addElement(null);

    final ExpressionMetaData[] datas = ExpressionRegistry.getInstance().getAllExpressionMetaDatas();
    for (int i = 0; i < datas.length; i++)
    {
      final ExpressionMetaData expressionMetaData = datas[i];
      if (expressionMetaData.isHidden())
      {
        continue;
      }
      if (WorkspaceSettings.getInstance().isShowExpertItems() == false && expressionMetaData.isExpert())
      {
        continue;
      }
      if (WorkspaceSettings.getInstance().isShowDeprecatedItems() == false && expressionMetaData.isDeprecated())
      {
        continue;
      }

      if (StructureFunction.class.isAssignableFrom(expressionMetaData.getExpressionType()))
      {
        model.addElement(expressionMetaData);
      }
    }
    expressionEditor.setModel(model);
View Full Code Here

    final Object o = this.expressionEditor.getSelectedItem();
    if (o instanceof ExpressionMetaData)
    {
      try
      {
        final ExpressionMetaData emd = (ExpressionMetaData) o;
        if (StructureFunction.class.isAssignableFrom(emd.getExpressionType()))
        {
          return emd.getExpressionType().newInstance();
        }
        else
        {
          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 optionPane;
          if (window instanceof JFrame)
          {
            optionPane = new ExpressionPropertiesDialog((JFrame) window);
View Full Code Here

        return 0;
      }

      for (int i = 1; i < allExpressionMetaDatas.size(); i++)
      {
        final ExpressionMetaData data = allExpressionMetaDatas.get(i).getWrappedObject();
        if (data == null)
        {
          return 0;
        }
        final Class testValue = data.getExpressionType();
        if (value.equals(testValue))
        {
          return i;
        }
      }
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.