Class DataItemHandle

  • All Implemented Interfaces:
    IReportItemMethodContext, org.eclipse.birt.report.model.elements.interfaces.IDataItemModel, org.eclipse.birt.report.model.elements.interfaces.IDesignElementModel, org.eclipse.birt.report.model.elements.interfaces.IInternalReportItemModel, org.eclipse.birt.report.model.elements.interfaces.IReportItemModel, org.eclipse.birt.report.model.elements.interfaces.IStyledElementModel

    public class DataItemHandle
    extends ReportItemHandle
    implements org.eclipse.birt.report.model.elements.interfaces.IDataItemModel
    Represents a data item element. A data item has an action, value expression and help text.
    See Also:
    DataItem
    • Constructor Detail

      • DataItemHandle

        public DataItemHandle​(org.eclipse.birt.report.model.core.Module module,
                              org.eclipse.birt.report.model.core.DesignElement element)
        Constructs a handle of the data item with the given design and a data item. 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 Detail

      • getActionHandle

        public ActionHandle getActionHandle()
        Returns a handle to work with the action property, action is a structure that defines a hyperlink.
        Returns:
        a handle to the action property, return null if the action has not been set on the data item.
        See Also:
        ActionHandle
      • setAction

        public ActionHandle setAction​(Action action)
                               throws SemanticException
        Set an action on the image.
        Parameters:
        action - new action to be set on the image, it represents a bookmark link, hyperlink, and drill through etc.
        Returns:
        a handle to the action property, return null if the action has not been set on the image.
        Throws:
        SemanticException - if member of the action is not valid.
      • actionsIterator

        public java.util.Iterator<ActionHandle> actionsIterator()
        Returns the iterator for action defined on this data item.
        Returns:
        the iterator for Action structure list defined on this data item
      • getDistinct

        @Deprecated
        public java.lang.String getDistinct()
        Deprecated.
        by the drop function of Cell element.
        Returns the value of the distinct property.
        Returns:
        the distinct value as a string
      • setDistinct

        @Deprecated
        public void setDistinct​(java.lang.String distinct)
                         throws SemanticException
        Deprecated.
        by the drop function of Cell element.
        Sets the value of the distinct property. The input value is defined in DesignChoiceConstants and is one of these:
        • DISTINCT_ALL
        • DISTINCT_REPEAT
        • DISTINCT_REPEAT_ON_PAGE
        Parameters:
        distinct - the distinct value as a string
        Throws:
        SemanticException - If the property is locked or the value is not one of the above.
      • getDistinctReset

        @Deprecated
        public java.lang.String getDistinctReset()
        Deprecated.
        by the drop function of Cell element.
        Returns the value of the distinct-reset property.
        Returns:
        the distinct-set value as a string
      • setDistinctReset

        @Deprecated
        public void setDistinctReset​(java.lang.String value)
                              throws SemanticException
        Deprecated.
        by the drop function of Cell element.
        Returns the value of the distinct-reset property.
        Parameters:
        value - the distinct-set value as a string
        Throws:
        SemanticException - If the property is locked.
      • getValueExpr

        @Deprecated
        public java.lang.String getValueExpr()
        Deprecated.
        As of BIRT version 2.1.0, replaced by getResultSetColumn( )
        Returns the expression that gives the value that the data item displays.
        Returns:
        the value expression
      • setValueExpr

        @Deprecated
        public void setValueExpr​(java.lang.String expr)
                          throws SemanticException
        Deprecated.
        As of BIRT version 2.1.0, replaced by setResultSetColumn(String columnName)
        Sets the expression for the value that the data item is to display. This method still can be used. However, if the user uses both this method and setResultSetColumn(String columnName), the result is unexpectable. It is strongly recommended to use ONLY one of two methods.
        Parameters:
        expr - the expression to set
        Throws:
        SemanticException - If the property is locked.
        SemanticException
      • getHelpText

        public java.lang.String getHelpText()
        Returns the help text of this data item.
        Returns:
        the help text
      • setHelpText

        public void setHelpText​(java.lang.String value)
                         throws SemanticException
        Sets the help text of this data item.
        Parameters:
        value - the help text
        Throws:
        SemanticException - if the property is locked.
      • getHelpTextKey

        public java.lang.String getHelpTextKey()
        Returns the help text resource key of this data item.
        Returns:
        the help text key
      • setHelpTextKey

        public void setHelpTextKey​(java.lang.String value)
                            throws SemanticException
        Sets the resource key of the help text of this data item.
        Parameters:
        value - the resource key of the help text
        Throws:
        SemanticException - if the property is locked.
      • getResultSetExpression

        public java.lang.String getResultSetExpression()
        Looks the column name from the data binding element that is nearest to this data item. Iterate the column name expression list to see if there is a column name is equals with the value of the DataItemHandle.DATA_COLUMN_NAME_PROP on this data item. If yes, return the expression value.
        Returns:
        the expression value.
        Throws:
        SemanticException
      • getResultSetColumn

        public java.lang.String getResultSetColumn()
        Gets the value of the result set column name property on this data item.
        Returns:
        the value of the property.
      • setResultSetColumn

        public void setResultSetColumn​(java.lang.String columnName)
                                throws SemanticException
        Sets the value of the column name property.
        Parameters:
        columnName - the value to set.
        Throws:
        SemanticException