Class TextItemHandle

  • All Implemented Interfaces:
    IReportItemMethodContext, 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, org.eclipse.birt.report.model.elements.interfaces.ITextItemModel

    public class TextItemHandle
    extends ReportItemHandle
    implements org.eclipse.birt.report.model.elements.interfaces.ITextItemModel
    Represents a text data item. The text item allows the developer to provide the text as part of the report design. The text can be localized. Text can be in HTML or plain text format.
    • Constructor Detail

      • TextItemHandle

        public TextItemHandle​(org.eclipse.birt.report.model.core.Module module,
                              org.eclipse.birt.report.model.core.DesignElement element)
        Constructs a handle for a text 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

      • getContent

        public java.lang.String getContent()
        Gets the text of this text element.
        Returns:
        the text to display with the element, if this property value is not set, return null.
      • getDisplayContent

        public java.lang.String getDisplayContent()
        Returns the localized content for the text. If the localized text for the text resource key is found, it will be returned. Otherwise, the static text will be returned.
        Returns:
        the localized content for the text.
      • setContent

        public void setContent​(java.lang.String value)
                        throws SemanticException
        Sets the text for the text element.
        Parameters:
        value - the new content of the text item
        Throws:
        SemanticException - if the property is locked.
      • getContentType

        public java.lang.String getContentType()
        Returns the content type of this text item. The content type will one of the following constants defined in DesignChoiceConstants:
        • TEXT_CONTENT_TYPE_AUTO
        • TEXT_CONTENT_TYPE_PLAIN
        • TEXT_CONTENT_TYPE_HTML
        • TEXT_CONTENT_TYPE_RTF
        Returns:
        the content type. if this property value is not set, return null.
        See Also:
        DesignChoiceConstants
      • setContentType

        public void setContentType​(java.lang.String contentType)
                            throws SemanticException
        Sets the content type of this text item. The content type will one of the following constants defined in DesignChoiceConstants:
        • TEXT_CONTENT_TYPE_AUTO
        • TEXT_CONTENT_TYPE_PLAIN
        • TEXT_CONTENT_TYPE_HTML
        • TEXT_CONTENT_TYPE_RTF
        Parameters:
        contentType - the content type of this text item.
        Throws:
        SemanticException - if the value is not a valid choice item.
        See Also:
        DesignChoiceConstants
      • getContentKey

        public java.lang.String getContentKey()
        Gets the resource key of the text for the item.
        Returns:
        the resource key of the text
      • setContentKey

        public void setContentKey​(java.lang.String resourceKey)
                           throws SemanticException
        Sets the resource key of the text for the item.
        Parameters:
        resourceKey - the resource key of the text
        Throws:
        SemanticException - if the property is locked.
      • hasExpression

        public boolean hasExpression()
        Determines whether there is expression need to be evaluated in the text content of this text item handle. By default, the return value is FALSE.
        Returns:
        true if there is expression in the text content, otherwise false
      • setHasExpression

        public void setHasExpression​(boolean hasExpression)
                              throws SemanticException
        Sets the status whether there is expression need to be evaluated in the text content of this text item handle.
        Parameters:
        hasExpression - true if there is expression in the text content, otherwise false
        Throws:
        SemanticException
      • setJTidy

        public void setJTidy​(boolean useJTidy)
                      throws SemanticException
        set if jTidy need to be used to validate the HTML content. If jTidy is set to false, the HTML content is used directly without any validation. The user needs ensure the content is well formed.
        Parameters:
        useJTidy - true, use jTidy to validate the content.
        Throws:
        SemanticException
      • isJTidy

        public boolean isJTidy()
        return if jTIdy is used to validate the HTML content.
        Returns:
        true, jTidy is used to validate the content.