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

Examples of org.pentaho.reporting.engine.classic.core.parameters.ParameterDefinitionEntry


    {
      return null;
    }

    final MasterReport masterReportElement = (MasterReport) report;
    final ParameterDefinitionEntry pe = (ParameterDefinitionEntry) fromClipboard;
    try
    {
      final ModifiableReportParameterDefinition definition = (ModifiableReportParameterDefinition) masterReportElement.getParameterDefinition();
      final ParameterDefinitionEntry definitionEntry = (ParameterDefinitionEntry) pe.clone();
      definition.addParameterDefinition(definitionEntry);
      report.notifyNodeChildAdded(definitionEntry);
      return definitionEntry;
    }
    catch (CloneNotSupportedException e1)
View Full Code Here


    final ModifiableReportParameterDefinition mdef = (ModifiableReportParameterDefinition) definition;
    final int count = mdef.getParameterCount();
    for (int i = 0; i < count; i++)
    {
      final ParameterDefinitionEntry definitionEntry = mdef.getParameterDefinition(i);
      if (definitionEntry == data)
      {
        mdef.removeParameterDefinition(i);
        report.notifyNodeChildRemoved(definitionEntry);
        return new ParameterEditUndoEntry(i, definitionEntry, null);
View Full Code Here

      final ModifiableReportParameterDefinition mdef = (ModifiableReportParameterDefinition) definition;
      final int count = mdef.getParameterCount();
      for (int i = 0; i < count; i++)
      {
        final ParameterDefinitionEntry definitionEntry = mdef.getParameterDefinition(i);
        if (definitionEntry == data)
        {
          try
          {
            return definitionEntry.clone();
          }
          catch (CloneNotSupportedException e)
          {
            UncaughtExceptionsModel.getInstance().addException(e);
            return null;
          }
        }
      }
      return null;
    }

    if (data instanceof Expression)
    {
      final AbstractReportDefinition report = context.getReportDefinition();
      final ExpressionCollection expressionCollection = report.getExpressions();
      final int count = expressionCollection.size();
      for (int i = 0; i < count; i++)
      {
        final Expression definitionEntry = expressionCollection.getExpression(i);
        if (definitionEntry == data)
        {
          return definitionEntry.getInstance();
        }
      }
      return null;
    }
View Full Code Here

    final ModifiableReportParameterDefinition parameterDefinition =
        (ModifiableReportParameterDefinition) masterReport.getParameterDefinition();
    int index = -1;
    for (int i = 0; i < parameterDefinition.getParameterCount(); i++)
    {
      final ParameterDefinitionEntry definition = parameterDefinition.getParameterDefinition(i);
      if (definition == parameter)
      {
        index = i;
        break;
      }
View Full Code Here

          final Expression expression = (Expression) eventParam;
          realModel.fireExpressionRemoved(expression);
        }
        else if (eventParam instanceof ParameterDefinitionEntry)
        {
          final ParameterDefinitionEntry parameter = (ParameterDefinitionEntry) eventParam;
          if (realModel instanceof MasterReportDataTreeModel)
          {
            final MasterReportDataTreeModel masterModel = (MasterReportDataTreeModel) realModel;
            masterModel.fireParameterRemoved(parameter);
          }
View Full Code Here

          final Expression expression = (Expression) eventParam;
          realModel.fireExpressionAdded(expression);
        }
        else if (eventParam instanceof ParameterDefinitionEntry)
        {
          final ParameterDefinitionEntry parameter = (ParameterDefinitionEntry) eventParam;
          if (realModel instanceof MasterReportDataTreeModel)
          {
            final MasterReportDataTreeModel masterModel = (MasterReportDataTreeModel) realModel;
            masterModel.fireParameterAdded(parameter);
          }
View Full Code Here

          return new FieldDescriptionTransferable(field.getAlias());
        }
      }
      if (node instanceof ParameterDefinitionEntry)
      {
        final ParameterDefinitionEntry field = (ParameterDefinitionEntry) node;
        return new FieldDescriptionTransferable(field.getName());
      }
      if (node instanceof Expression)
      {
        final Expression expression = (Expression) node;
        if (expression.getName() != null)
View Full Code Here

        try
        {
          final Object selection = selectionPath.getLastPathComponent();
          if (selection instanceof ParameterDefinitionEntry)
          {
            final ParameterDefinitionEntry parameterDefinitionEntry = (ParameterDefinitionEntry) selection;
            EditParametersAction.performEditMasterReportParameters(getReportDesignerContext(), parameterDefinitionEntry);
            return;
          }

          if (selection instanceof ParameterMapping ||
View Full Code Here

      final ReportParameterDefinition reportParams = masterReportElement.getParameterDefinition();
      final ParameterDefinitionEntry[] parameterDefinitionEntries = reportParams.getParameterDefinitions();

      for (int i = 0; i < parameterDefinitionEntries.length; i++)
      {
        final ParameterDefinitionEntry entry = parameterDefinitionEntries[i];
        if (entries.containsKey(entry.getName()) == false)
        {
          entries.put(entry.getName(),
              new DrillDownParameter(entry.getName(), null, DrillDownParameter.Type.PREDEFINED, false, false));
        }
        else
        {
          final DrillDownParameter parameter = entries.get(entry.getName());
          parameter.setType(DrillDownParameter.Type.PREDEFINED);
        }
      }

      final DrillDownParameter[] parameters = entries.values().toArray(new DrillDownParameter[entries.size()]);
View Full Code Here

    final MasterReport report = (MasterReport) abstractReportDefinition;
    final ReportParameterDefinition definition = report.getParameterDefinition();
    final ParameterDefinitionEntry[] parameterDefinitionEntries = definition.getParameterDefinitions();
    for (int i = 0; i < parameterDefinitionEntries.length; i++)
    {
      final ParameterDefinitionEntry definitionEntry = parameterDefinitionEntries[i];
      if (reservedParameterNames.contains(definitionEntry.getName()))
      {
        resultHandler.notifyInspectionResult(new InspectionResult(this, InspectionResult.Severity.WARNING,
            Messages.getInstance().formatMessage
                ("ReservedParameterNamesInspection.ReservedParameterNameUsed", definitionEntry.getName()),
            new ParameterLocationInfo(definitionEntry)));
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.pentaho.reporting.engine.classic.core.parameters.ParameterDefinitionEntry

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.