Class TextDataHandle

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.IStyledElementModel, org.eclipse.birt.report.model.elements.interfaces.ITextDataItemModel
Direct Known Subclasses:
MultiLineDataHandle

public class TextDataHandle extends ReportItemHandle implements org.eclipse.birt.report.model.elements.interfaces.ITextDataItemModel
Represents a multi-line data item element. The multi-line data item displays blocks of text retrieved from the database, from a file, or from an expression. The text can be plain text, HTML, RTF or an expression. The format of the text can be fixed at design time, or can be dynamically selected at run time to match the format of the incoming text.
See Also:
  • TextDataItem
  • Constructor Details

    • TextDataHandle

      public TextDataHandle(org.eclipse.birt.report.model.core.Module module, org.eclipse.birt.report.model.core.DesignElement element)
      Constructs the handle with the report design and the element it holds. 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

    • getValueExpr

      public String getValueExpr()
      Returns the expression that gives the text that the multi-line data item displays.
      Returns:
      the value expression
    • setValueExpr

      public void setValueExpr(String expr) throws SemanticException
      Sets the expression that gives the text that this multi-line data item displays.
      Parameters:
      expr - the new expression for the value expression
      Throws:
      SemanticException - if the expression contains errors, or the property is locked.
    • getContentTypeExpr

      @Deprecated public String getContentTypeExpr()
      Deprecated.
      by the method getContentType()
      Returns the expression that that defines the type of text the multi-line data item holds. The content type can be one of Auto (default); Plain: Plain text; HTML: HTML format; RTF: Rich Text Format; Expression: an expression that returns one of the above strings.
      Returns:
      the expression for the text type
    • setContentTypeExpr

      @Deprecated public void setContentTypeExpr(String expr) throws SemanticException
      Deprecated.
      Sets the expression that defines the text type this multi-line data item holds. The content type can be one of Auto (default); Plain: Plain text; HTML: HTML format; RTF: Rich Text Format; Expression: an expression that returns one of the above strings.
      Parameters:
      expr - the new expression for the text type
      Throws:
      SemanticException - if the expression contains errors, or the property is locked.
    • getContentType

      public String getContentType()
      Returns the expression that that defines the type of text the multi-line data item holds. The content type can be one of:
      • DesignChoiceConstants.TEXT_DATA_CONTENT_TYPE_AUTO (default)
      • DesignChoiceConstants.TEXT_DATA_CONTENT_TYPE_PLAIN: Plain text;
      • DesignChoiceConstants.TEXT_DATA_CONTENT_TYPE_HTML: HTML format;
      • DesignChoiceConstants.TEXT_DATA_CONTENT_TYPE_RTF: Rich Text format;
      Returns:
      the text type
    • setContentType

      public void setContentType(String contentType) throws SemanticException
      Sets the expression that defines the text type this multi-line data item holds. The content type can be one of
      • DesignChoiceConstants.TEXT_DATA_CONTENT_TYPE_AUTO (default)
      • DesignChoiceConstants.TEXT_DATA_CONTENT_TYPE_PLAIN: Plain text;
      • DesignChoiceConstants.TEXT_DATA_CONTENT_TYPE_HTML: HTML format;
      • DesignChoiceConstants.TEXT_DATA_CONTENT_TYPE_RTF: Rich Text format;
      Parameters:
      contentType - the new text type
      Throws:
      SemanticException - if the property is locked or the contentType is not one of the above.
    • hasExpression

      public boolean hasExpression()
      Determines whether there is expression need to be evaluated in the text content of this text data 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 data 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.