Package org.eclipse.birt.report.model.api

# Class TextDataHandle

java.lang.Object
org.eclipse.birt.report.model.api.DesignElementHandle
org.eclipse.birt.report.model.api.ReportElementHandle
org.eclipse.birt.report.model.api.ReportItemHandleImpl
org.eclipse.birt.report.model.api.ReportItemHandle
org.eclipse.birt.report.model.api.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`

## Field Summary

### Fields inherited from class org.eclipse.birt.report.model.api.ReportItemHandleImpl

`DATABINDING_TYPE_DATA, DATABINDING_TYPE_NONE, DATABINDING_TYPE_REPORT_ITEM_REF`

### Fields inherited from class org.eclipse.birt.report.model.api.ReportElementHandle

`element`

### Fields inherited from class org.eclipse.birt.report.model.api.DesignElementHandle

`module`

### Fields inherited from interface org.eclipse.birt.report.model.elements.interfaces.IDesignElementModel

`COMMENTS_PROP, CUSTOM_XML_PROP, DISPLAY_NAME_ID_PROP, DISPLAY_NAME_PROP, EVENT_HANDLER_CLASS_PROP, EXTENDS_PROP, FULL_LABEL, ID_SUFFIX, NAME_PROP, NEW_HANDLER_ON_EACH_EVENT_PROP, NO_SLOT, PROPERTY_MASKS_PROP, REF_TEMPLATE_PARAMETER_PROP, SHORT_LABEL, USER_LABEL, USER_PROPERTIES_PROP, VIEW_ACTION_PROP`

### Fields inherited from interface org.eclipse.birt.report.model.elements.interfaces.IInternalReportItemModel

`ACL_EXPRESSION_PROP, ALLOW_EXPORT_PROP, ALTTEXT_KEY_PROP, ALTTEXT_PROP, BOOKMARK_DISPLAY_NAME_PROP, BOOKMARK_PROP, BOUND_DATA_COLUMNS_PROP, CASCADE_ACL_PROP, CUBE_PROP, DATA_BINDING_REF_PROP, DATA_SET_PROP, HEIGHT_PROP, LANGUAGE_PROP, MULTI_VIEWS_PROP, ON_CREATE_METHOD, ON_PAGE_BREAK_METHOD, ON_PREPARE_METHOD, ON_RENDER_METHOD, ORDER_PROP, PARAM_BINDINGS_PROP, PUSH_DOWN_PROP, TAG_TYPE_PROP, THEME_PROP, TOC_PROP, URL_PROP, VISIBILITY_PROP, WIDTH_PROP, X_PROP, Y_PROP, Z_INDEX_PROP`

### Fields inherited from interface org.eclipse.birt.report.model.api.elements.IReportItemMethodContext

`ON_CREATE_CONTEXT, ON_PREPARE_CONTEXT, ON_RENDER_CONTEXT`

### Fields inherited from interface org.eclipse.birt.report.model.elements.interfaces.IStyledElementModel

`STYLE_PROP`

### Fields inherited from interface org.eclipse.birt.report.model.elements.interfaces.ITextDataItemModel

`CONTENT_TYPE_PROP, HAS_EXPRESSION_PROP, JTIDY_PROP, VALUE_EXPR_PROP`

## Constructor Summary

Constructors
Constructor
Description
`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.

## Method Summary

Modifier and Type
Method
Description
`String`
`getContentType()`
Returns the expression that that defines the type of text the multi-line data item holds.
`String`
`getContentTypeExpr()`
Deprecated.
by the method `getContentType()`
`String`
`getValueExpr()`
Returns the expression that gives the text that the multi-line data item displays.
`boolean`
`hasExpression()`
Determines whether there is expression need to be evaluated in the text content of this text data handle.
`boolean`
`isJTidy()`
return if jTIdy is used to validate the HTML content.
`void`
`setContentType(String contentType)`
Sets the expression that defines the text type this multi-line data item holds.
`void`
`setContentTypeExpr(String expr)`
Deprecated.
by the method `setContentType(String)`
`void`
`setHasExpression(boolean hasExpression)`
Sets the status whether there is expression need to be evaluated in the text content of this text data handle.
`void`
`setJTidy(boolean useJTidy)`
set if jTidy need to be used to validate the HTML content.
`void`
`setValueExpr(String expr)`
Sets the expression that gives the text that this multi-line data item displays.

### Methods inherited from class org.eclipse.birt.report.model.api.ReportItemHandleImpl

`addColumnBinding, addTOC, addTOC, addView, allowExport, canAddView, canCascadeACL, cascadeACL, columnBindingsIterator, dropView, findColumnBinding, getACLExpression, getAltTextExpression, getAltTextKey, getAvailableBindings, getAvailableCubeBindingReferenceList, getAvailableDataBindingReferenceList, getAvailableDataBindingReferenceList, getAvailableDataSetBindingReferenceList, getBookmark, getBookmarkDisplayName, getColumnBindings, getCube, getCurrentView, getDataBindingReference, getDataBindingReferenceName, getDataBindingType, getDataSet, getHeight, getLanguage, getMethods, getNamedCubeBindingReferenceList, getNamedDataBindingReferenceList, getNamedDataSetBindingReferenceList, getOnCreate, getOnPageBreak, getOnPrepare, getOnRender, getOrder, getProperty, getTagType, getTheme, getTOC, getTocExpression, getURL, getViewHost, getViews, getWidth, getX, getY, getZIndex, paramBindingsIterator, pushDown, removedColumnBinding, removedColumnBindings, removedUnusedColumnBindings, setACLExpression, setAllowExport, setAltTextExpression, setAltTextKey, setBookmark, setBookmarkDisplayName, setCascadeACL, setCube, setCurrentView, setDataBindingReference, setDataSet, setHeight, setHeight, setLanguage, setOnCreate, setOnPageBreak, setOnPrepare, setOnRender, setOrder, setPushDown, setTagType, setTheme, setThemeName, setTocExpression, setURL, setWidth, setWidth, setX, setX, setY, setY, setZIndex, visibilityRulesIterator`

### Methods inherited from class org.eclipse.birt.report.model.api.ReportElementHandle

`getComments, getCustomXml, getDisplayName, getDisplayNameKey, getElement, getPropertyMask, isValidLayoutForCompoundElement, isValidReferenceForCompoundElement, propertyMaskIterator, setComments, setCustomXml, setDisplayName, setDisplayNameKey, setPropertyMask`

### Methods inherited from class org.eclipse.birt.report.model.api.DesignElementHandle

`add, add, addElement, addElement, addListener, addUserPropertyDefn, cachePropertyHandles, canContain, canContain, canContain, canContain, canDrop, canEdit, canTransformToTemplate, clearAllProperties, clearContents, clearProperty, clientsIterator, copy, copyPropertyTo, createTemplateElement, derivedIterator, doSort, drop, drop, drop, dropAndClear, dropAndClear, dropAndClear, dropUserPropertyDefn, findContentSlot, getBooleanProperty, getChoices, getColorProperty, getContainer, getContainerPropertyHandle, getContainerSlotHandle, getContent, getContentCount, getContents, getDefn, getDesign, getDesignHandle, getDimensionProperty, getDisplayLabel, getDisplayLabel, getDisplayProperty, getEffectiveModule, getElementFactory, getElementProperty, getEventHandlerClass, getExpressionProperty, getExtends, getExternalizedValue, getExternalizedValue, getExternalizedValue, getFactoryElementHandle, getFactoryPropertyHandle, getFloatProperty, getFontProperty, getFullName, getHostViewHandle, getID, getIndex, getIntProperty, getListProperty, getListProperty, getMethods, getModule, getModuleHandle, getName, getNumberProperty, getPrivateStyle, getPropertyBinding, getPropertyBindingExpression, getPropertyBindings, getPropertyDefn, getPropertyHandle, getPropertyIterator, getQualifiedName, getRoot, getSemanticErrors, getSlot, getStringProperty, getStyle, getUserProperties, getUserPropertyDefnHandle, getXPath, hasLocalProperties, hasSemanticError, initializeSlotHandles, isDirectionRTL, isInTemplateParameter, isTemplateParameterValue, isValid, localize, move, move, moveTo, moveTo, moveTo, moveTo, newHandlerOnEachEvent, paste, paste, paste, paste, removeListener, revertToReportItem, revertToTemplate, semanticCheck, setBooleanProperty, setEncryption, setEventHandlerClass, setExpressionProperty, setExtends, setExtendsElement, setExtendsName, setFloatProperty, setIntProperty, setName, setNewHandlerOnEachEvent, setNumberProperty, setProperties, setProperty, setPropertyBinding, setPropertyBinding, setStringProperty, setStyle, setStyleElement, setStyleName, setValid, shift, showError, slotsIterator`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## 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.
by the method `setContentType(String)`
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.