Package org.eclipse.birt.report.engine.api.script.element

# Interface ITextItem

All Superinterfaces:
  `IDesignElement`, `IReportElement`, `IReportItem`

public interface ITextItem extends IReportItem
Represents a the design of a TextItem in the scripting environment

## Field Summary

### Fields inherited from interface org.eclipse.birt.report.engine.api.script.element.IReportItem

`constants`

## Method Summary

Modifier and Type
Method
Description
`String`
`getContent()`
Gets the text of this text element.
`String`
`getContentKey()`
Gets the resource key of the text for the item.
`String`
`getContentType()`
Returns the content type of this text item.
`String`
`getDisplayContent()`
Returns the localized content for the text.
`void`
`setContent(String value)`
Sets the text for the text element.
`void`
`setContentKey(String resourceKey)`
Sets the resource key of the text for the item.
`void`
`setContentType(String contentType)`
Sets the content type of this text item.

### Methods inherited from interface org.eclipse.birt.report.engine.api.script.element.IDesignElement

`getNamedExpression, getParent, getQualifiedName, getReport, getStyle, getUserProperty, getUserPropertyExpression, setNamedExpression, setUserProperty, setUserProperty`

### Methods inherited from interface org.eclipse.birt.report.engine.api.script.element.IReportElement

`getComments, getCustomXml, getDisplayName, getDisplayNameKey, getName, setComments, setCustomXml, setDisplayName, setDisplayNameKey, setName`

### Methods inherited from interface org.eclipse.birt.report.engine.api.script.element.IReportItem

`addDataBinding, addHideRule, addHighlightRule, getBookmark, getDataBinding, getDataBindings, getHeight, getHideRules, getHighlightRules, getTocExpression, getWidth, getX, getY, removeDataBinding, removeDataBindings, removeHideRule, removeHideRules, removeHighlightRule, removeHighlightRules, setBookmark, setCurrentView, setHeight, setHeight, setTocExpression, setWidth, setWidth, setX, setX, setY, setY`

## Method Details

### getContent

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

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

void setContent(String value) throws ScriptException
Sets the text for the text element.

Parameters:
  `value` - the new content of the text item
Throws:
  `ScriptException` - if the property is locked.

### getContentType

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

void setContentType(String contentType) throws ScriptException
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:
  `ScriptException` - if the value is not a valid choice item.
See Also:
  - `DesignChoiceConstants`

### getContentKey

String getContentKey()
Gets the resource key of the text for the item.

Returns:
  the resource key of the text

### setContentKey

void setContentKey(String resourceKey) throws ScriptException
Sets the resource key of the text for the item.

Parameters:
  `resourceKey` - the resource key of the text
Throws:
  `ScriptException` - if the property is locked.