Class ScalarParameterHandle

All Implemented Interfaces:
org.eclipse.birt.report.model.elements.interfaces.IAbstractScalarParameterModel, org.eclipse.birt.report.model.elements.interfaces.IDesignElementModel, org.eclipse.birt.report.model.elements.interfaces.IInternalAbstractScalarParameterModel, org.eclipse.birt.report.model.elements.interfaces.IParameterModel, org.eclipse.birt.report.model.elements.interfaces.IScalarParameterModel

public class ScalarParameterHandle extends AbstractScalarParameterHandle implements org.eclipse.birt.report.model.elements.interfaces.IScalarParameterModel
Represents a scalar (single-value) report parameter. If the user enters no value for a parameter, then the default value is used. If there is no default value, then BIRT checks if null is allowed. If so, the value of the parameter is null. If nulls are not allowed, then the user must enter a value.

Scalar parameters can have static or dynamic selection lists.

  • The parameter static selection list provides a developer-defined list of choices. Every choice has two parts: a choice and a label. The label can be externalized and appears in the UI. The choice is the value passed to the report.
  • This parameter can define a dynamic selection list for the parameter. The data set can reference other parameters by referring to a data set. The data set must return a column that contains the choice values. It may also contain a column that returns the labels for the values. All other columns are ignored.

See Also:
  • Constructor Details

    • ScalarParameterHandle

      public ScalarParameterHandle(org.eclipse.birt.report.model.core.Module module, org.eclipse.birt.report.model.core.DesignElement element)
      Constructs a handle for the ScalarParamter with the given design and the parameter. The application generally does not create handles directly. Instead, it uses one of the navigation methods available on other element handles.
      Parameters:
      module - the module
      element - the model representation of the element
  • Method Details

    • getDefaultValue

      @Deprecated public String getDefaultValue()
      Returns the first default value of the parameter. The default value can be an expression, but cannot reference any other parameters. The default value of this parameter can be a list. This method returns the first value if exists.
      Returns:
      the default value
    • setDefaultValue

      @Deprecated public void setDefaultValue(String defaultValue) throws SemanticException
      Sets the default value of the parameter. The default value can be an expression, but cannot reference any other parameters.
      Parameters:
      defaultValue - the default value for the parameter
      Throws:
      SemanticException - if the property is locked.
    • isConcealValue

      public boolean isConcealValue()
      Tests whether hides the user's entry by displaying asterisks. Often used for passwords.
      Returns:
      true if hides the user's entry by asterisks, false if shows characters as usual.
    • setConcealValue

      public void setConcealValue(boolean concealValue) throws SemanticException
      Sets the attribute that's hides the user's entry by displaying asterisks. Often used for passwords.
      Parameters:
      concealValue - true if hides the user's entry by asterisks, false if shows characters as usual.
      Throws:
      SemanticException - if the property is locked.
    • allowNull

      @Deprecated public boolean allowNull()
      Tests whether the value of the parameter can be null.
      Returns:
      true if the value can be null, false if the value can not be null.
    • setAllowNull

      @Deprecated public void setAllowNull(boolean allowNull) throws SemanticException
      Sets the flag that indicates whether the value of the parameter can be null.
      Parameters:
      allowNull - true if the value can be null, false if the value can not be null.
      Throws:
      SemanticException - if the property is locked.
    • allowBlank

      @Deprecated public boolean allowBlank()
      Tests whether the string value of the parameter can be null.
      Returns:
      true if the value can be null, false if the value can not be null.
    • setAllowBlank

      @Deprecated public void setAllowBlank(boolean allowBlank) throws SemanticException
      Sets the flag that indicates whether the string value of the parameter can be null.
      Parameters:
      allowBlank - true if the value can be null, false if the value can not be null.
      Throws:
      SemanticException - if the property is locked.
    • getFormat

      @Deprecated public String getFormat()
      Deprecated.
      replaced by getPattern and getCategory.
      Returns the format instructions for the parameter value. The format is used by the UI to display the value.
      Returns:
      the format for the parameter value
    • getPattern

      public String getPattern()
      Returns the pattern of format instructions for the parameter value. The format is used by the UI to display the value.
      Returns:
      the pattern of format for the parameter value
    • getCategory

      public String getCategory()
      Returns the category for the parameter format. The format is used by the UI to display the value.
      Returns:
      the category for the parameter format
    • setFormat

      @Deprecated public void setFormat(String format) throws SemanticException
      Deprecated.
      replaced by setPattern and setCategory.
      Sets the format instructions for the parameter value. The format is used by the UI to display the value.
      Parameters:
      format - the format for the parameter value
      Throws:
      SemanticException - if the property is locked.
    • setPattern

      public void setPattern(String pattern) throws SemanticException
      Sets the pattern of format instructions for the parameter value. The format is used by the UI to display the value.
      Parameters:
      pattern - the format for the parameter value
      Throws:
      SemanticException - if the property is locked.
    • setCategory

      public void setCategory(String category) throws SemanticException
      Sets the category for the parameter format. The format is used by the UI to display the value.
      Parameters:
      category - the category for the format
      Throws:
      SemanticException - if the property is locked.
    • getControlType

      public String getControlType()
      Returns the control type for this parameter. Control types are one of constants defined in DesignChoiceConstants:
      • PARAM_CONTROL_TEXT_BOX
      • PARAM_CONTROL_LIST_BOX
      • PARAM_CONTROL_COMBOBOX
      • PARAM_CONTROL_RADIO_BUTTON
      • PARAM_CONTROL_CHECK_BOX
      • PARAM_CONTROL_AUTO_SUGGEST
      Returns:
      the control type for the UI to display the parameter
      See Also:
    • getListlimit

      public int getListlimit()
      get the list limited number.
      Overrides:
      getListlimit in class AbstractScalarParameterHandleImpl
      Returns:
      the display prompt.
    • setControlType

      public void setControlType(String controlType) throws SemanticException
      Sets the control type for this parameter. Control types are one of constants defined in DesignChoiceConstants:
      • PARAM_CONTROL_TEXT_BOX
      • PARAM_CONTROL_LIST_BOX
      • PARAM_CONTROL_COMBOBOX
      • PARAM_CONTROL_RADIO_BUTTON
      • PARAM_CONTROL_CHECK_BOX
      • PARAM_CONTROL_AUTO_SUGGEST
      Parameters:
      controlType - the control type for the UI to display the parameter
      Throws:
      SemanticException - if the input type is not one of above choices.
      See Also:
    • getAlignment

      public String getAlignment()
      Returns the alignment for this parameter. Alignments can be one of the constants defined in DesignChoiceConstants:
      • SCALAR_PARAM_ALIGN_AUTO
      • SCALAR_PARAM_ALIGN_LEFT
      • SCALAR_PARAM_ALIGN_CENTER
      • SCALAR_PARAM_ALIGN_RIGHT
      Returns:
      the alignment for the UI to display the parameter
      See Also:
    • setAlignment

      public void setAlignment(String align) throws SemanticException
      Sets the alignment for this parameter. Alignments can be one of the constants defined in DesignChoiceConstants:
      • SCALAR_PARAM_ALIGN_AUTO
      • SCALAR_PARAM_ALIGN_LEFT
      • SCALAR_PARAM_ALIGN_CENTER
      • SCALAR_PARAM_ALIGN_RIGHT
      Parameters:
      align - the alignment for the UI to display the parameter
      Throws:
      SemanticException - if the input type is not one of above choices.
      See Also:
    • isMustMatch

      public boolean isMustMatch()
      Tests whether the value must match one of values in the selection list.
      Returns:
      true if the value must match one of values in the list, otherwise false.
    • setMustMatch

      public void setMustMatch(boolean mustMatch) throws SemanticException
      Sets the flag indicates that whether the value must match one of values in the selection list.
      Parameters:
      mustMatch - true if the value must match one of values in the list, otherwise false.
      Throws:
      SemanticException - if the property is locked.
    • isFixedOrder

      public boolean isFixedOrder()
      Tests whether to display values in the order defined in the list.
      Returns:
      true if to display value in the order, otherwise false.
    • setFixedOrder

      public void setFixedOrder(boolean fixedOrder) throws SemanticException
      Sets the flag indicates that whether to display values in the order defined in the list.
      Parameters:
      fixedOrder - true if to display values in the order, otherwise false.
      Throws:
      SemanticException - if the property is locked.
    • getValueColumn

      @Deprecated public String getValueColumn()
      Deprecated.
      Returns the name of the query column that returns values for the choice of the dynamic list for this parameter.
      Returns:
      the the name of the query column
    • setValueColumn

      @Deprecated public void setValueColumn(String valueColumn) throws SemanticException
      Deprecated.
      Sets the name of the query column that returns values for the choice of the dynamic list for this parameter.
      Parameters:
      valueColumn - the name of the query column
      Throws:
      SemanticException - if the property is locked.
    • getLabelColumn

      @Deprecated public String getLabelColumn()
      Deprecated.
      Returns the name of the query column that returns the prompt for the choice of the dynamic list for this parameter.
      Returns:
      the the name of the query column
    • setLabelColumn

      @Deprecated public void setLabelColumn(String labelColumn) throws SemanticException
      Deprecated.
      Sets the name of the query column that returns the prompt for the choice of the dynamic list for this parameter.
      Parameters:
      labelColumn - the name of the query column
      Throws:
      SemanticException - if the property is locked.
    • getType

      @Deprecated public String getType()
      Deprecated.
      Returns the data type for this parameter. The data type controls how the requester formats, parses and validates the parameter. Types are defined in DesignChoiceConstants can be one of the followings:
      • PARAM_TYPE_STRING
      • PARAM_TYPE_FLOAT
      • PARAM_TYPE_DECIMAL
      • PARAM_TYPE_INTEGER
      • PARAM_TYPE_DATETIME
      • PARAM_TYPE_DATE
      • PARAM_TYPE_TIME
      • PARAM_TYPE_BOOLEAN
      Returns:
      the type for the parameter
      See Also:
    • setType

      @Deprecated public void setType(String type) throws SemanticException
      Deprecated.
      Sets the data type for this parameter. The data type controls how the Requester formats, parses and validates the parameter. Types are defined in DesignChoiceConstants can be one of the followings:
      • PARAM_TYPE_STRING
      • PARAM_TYPE_FLOAT
      • PARAM_TYPE_DECIMAL
      • PARAM_TYPE_INTEGER
      • PARAM_TYPE_DATETIME
      • PARAM_TYPE_DATE
      • PARAM_TYPE_TIME
      • PARAM_TYPE_BOOLEAN
      Parameters:
      type - the type for the parameter
      Throws:
      SemanticException - if the input type is not one of above choices.
      See Also:
    • columnBindingsIterator

      public Iterator<?> columnBindingsIterator()
      Returns the bound columns that binds the data set columns. The item in the iterator is the corresponding ComputedColumnHandle.
      Returns:
      a list containing the bound columns.
    • getColumnBindings

      public PropertyHandle getColumnBindings()
      Get a handle to deal with the bound column.
      Returns:
      a handle to deal with the bound data column.
    • addColumnBinding

      public ComputedColumnHandle addColumnBinding(ComputedColumn addColumn, boolean inForce) throws SemanticException
      Adds a bound column to the list.
      Parameters:
      addColumn - the bound column to add
      inForce - true the column is added to the list regardless of duplicate expression. false do not add the column if the expression already exist
      Returns:
      the newly created ComputedColumnHandle or the existed ComputedColumnHandle in the list
      Throws:
      SemanticException - if expression is not duplicate but the name duplicates the existing bound column. Or, if the both name/expression are duplicate, but inForce is true.
    • removedUnusedColumnBindings

      public void removedUnusedColumnBindings() throws SemanticException
      Removed unused bound columns from the parameter. Bound columns of nested elements will not be removed.
      Throws:
      SemanticException - if bound column property is locked.
    • setProperty

      public void setProperty(String propName, Object value) throws SemanticException
      Description copied from class: DesignElementHandle
      Sets the value of a property from a generic object. The value can be any of the supported types: String, Double, Integer, BigDecimal or one of the specialized property types. The type of object allowed depends on the type of the property.
      Overrides:
      setProperty in class DesignElementHandle
      Parameters:
      propName - the property name
      value - the value to set
      Throws:
      SemanticException - if the property is undefined on the element or the value is invalid.
    • getProperty

      public Object getProperty(String propName)
      Description copied from class: DesignElementHandle
      Returns the value of a property as a generic object. The value is the internal property value, it is not localized. For a property with the element reference type, the reference element name is returned.
      Overrides:
      getProperty in class DesignElementHandle
      Parameters:
      propName - the name of the property of interest
      Returns:
      the value of the property. The type of the returned object depends on the property type.
      See Also:
    • getParamType

      public String getParamType()
      Returns the parameter type for this scalar parameter. Types are defined in DesignChoiceConstants can be one of the followings:
      • SCALAR_PARAM_TYPE_SIMPLE
      • SCALAR_PARAM_TYPE_MULTI_VALUE
      • SCALAR_PARAM_TYPE_AD_HOC
      Returns:
      the type for the parameter
      See Also:
    • setParamType

      public void setParamType(String type) throws SemanticException
      Sets the parameter type for this scalar parameter. Types are defined in DesignChoiceConstants can be one of the followings:
      • SCALAR_PARAM_TYPE_SIMPLE
      • SCALAR_PARAM_TYPE_MULTI_VALUE
      • SCALAR_PARAM_TYPE_AD_HOC
      Parameters:
      type - the type for the parameter
      Throws:
      SemanticException - if the input type is not one of above choices.
      See Also:
    • getAutoSuggestThreshold

      public int getAutoSuggestThreshold()
      Returns the maximal number of of entries a report parameter pick list can have.
      Returns:
      the threshold number.
    • setAutoSuggestThreshold

      public void setAutoSuggestThreshold(int number) throws SemanticException
      Sets the maximal number of of entries a report parameter pick list can have.
      Parameters:
      number - the threshold number.
      Throws:
      SemanticException
    • getDefaultValueListMethod

      public String getDefaultValueListMethod()
      Gets the method content of getDefaultValueList.
      Returns:
      the method content of getDefaultValueList
    • setDefaultValueListMethod

      public void setDefaultValueListMethod(String getDefaultValueListMethod) throws SemanticException
      Sets the method content of getDefaultValueList.
      Parameters:
      getDefaultValueListMethod - the method content of getDefaultValueList to set
      Throws:
      SemanticException
    • getSelectionValueListMethod

      public String getSelectionValueListMethod()
      Gets the method content of getSelectionValueList.
      Returns:
      the method content of getSelectionValueList
    • setSelectionValueListMethod

      public void setSelectionValueListMethod(String getSelectionValueListMethod) throws SemanticException
      Sets the method content of getSelectionValueList.
      Parameters:
      getSelectionValueListMethod - the method content of getSelectionValueList to set
      Throws:
      SemanticException