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

# Class ReportElementHandle

java.lang.Object
org.eclipse.birt.report.model.api.DesignElementHandle
org.eclipse.birt.report.model.api.ReportElementHandle

All Implemented Interfaces:
  `org.eclipse.birt.report.model.elements.interfaces.IDesignElementModel`

Direct Known Subclasses:
  `AbstractThemeHandle`, `CellHandle`, `ColumnHandle`, `CubeHandle`, `DataSetHandle`, `DataSourceHandle`, `DimensionHandle`, `GroupHandle`, `HierarchyHandle`, `LevelHandle`, `MasterPageHandle`, `MeasureGroupHandle`, `MeasureHandle`, `ParameterGroupHandle`, `ParameterHandle`, `ReportItemHandleImpl`, `RowHandle`, `StyleHandle`, `TemplateElementHandle`, `TemplateParameterDefinitionHandle`

public abstract class ReportElementHandle extends DesignElementHandle
Abstract base class for working with all elements except the report design. A report element can defines property masks for its property. A property mask says how to hide or lock an BIRT ERD-defined or developer-defined property.

## Field Summary

Fields
Modifier and Type
Field
Description
`protected org.eclipse.birt.report.model.core.DesignElement`
`element`
The target report 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`

## Constructor Summary

Constructors
Constructor
Description
`ReportElementHandle(org.eclipse.birt.report.model.core.Module module, org.eclipse.birt.report.model.core.DesignElement element)`
Constructs the handle for a report element with the given design and element.

## Method Summary

Modifier and Type
Method
Description
`String`
`getComments()`
Gets the comments of the report element.
`String`
`getCustomXml()`
Gets the custom XML.
`String`
`getDisplayName()`
Gets the display name.
`String`
`getDisplayNameKey()`
Gets the resource key of the display name.
`org.eclipse.birt.report.model.core.DesignElement`
`getElement()`
Returns the element to which this handle is attached.
`String`
`getPropertyMask(String propName)`
Returns the mask of the specified property given its internal name.
`boolean`
`isValidLayoutForCompoundElement()`
Checks whether the compound element is valid.
`boolean`
`isValidReferenceForCompoundElement()`
Deprecated.
`Iterator`
`propertyMaskIterator()`
Returns property masks on this element.
`void`
`setComments(String theComments)`
Sets the comments of the report element.
`void`
`setCustomXml(String customXml)`
Sets the custom XML.
`void`
`setDisplayName(String displayName)`
Sets the display name.
`void`
`setDisplayNameKey(String displayNameKey)`
Sets the resource key of the display name.
`void`
`setPropertyMask(String propName, String maskValue)`
Sets the mask of the specified property.

### 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, getProperty, getPropertyBinding, getPropertyBindingExpression, getPropertyBindings, getPropertyDefn, getPropertyHandle, getPropertyIterator, getQualifiedName, getRoot, getSemanticErrors, getSlot, getStringProperty, getStyle, getTagType, 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`

## Field Details

### element

protected org.eclipse.birt.report.model.core.DesignElement element
The target report element.

## Constructor Details

### ReportElementHandle

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

### getElement

public org.eclipse.birt.report.model.core.DesignElement getElement()
Description copied from class: `DesignElementHandle`
Returns the element to which this handle is attached.

Specified by:
  `getElement` in class `DesignElementHandle`
Returns:
  The attached element. Will be null if the handle is not attached.

### propertyMaskIterator

public Iterator propertyMaskIterator()
Returns property masks on this element. This method follows these rules:

- If any property mask exists on this element, returns property mask list of itself.
- If no property masks on this element, returns property mask list of its parent.

Returns:
  the iterator of property mask structure list
See Also:
  - `getPropertyMask(String)`

### getPropertyMask

public String getPropertyMask(String propName)
Returns the mask of the specified property given its internal name. This method follows these rules:

- If the mask of a specified property is defined on this element, returns the mask value.
- If the mask of a specified property is not defined on this element, returns the mask value inherited from its ancestor.
- `null` is returned if no mask value defined on this property.

The optional mask values are defined in `DesignChoiceConstants.` and they are

- `PROPERTYMASK_TYPE_CHANGE`
- `PROPERTYMASK_TYPE_LOCK`
- `PROPERTYMASK_TYPE_HIDE`

Parameters:
  `propName` - the name of the property to get. Can be a system-defined or user-defined property name.
Returns:
  the property mask, or null if the mask is not set.
See Also:
  - `DesignChoiceConstants`

### setPropertyMask

public void setPropertyMask(String propName, String maskValue) throws SemanticException
Sets the mask of the specified property. The mask values are defined in `DesignChoiceConstants` and they are:

- `PROPERTYMASK_TYPE_CHANGE`
- `PROPERTYMASK_TYPE_LOCK`
- `PROPERTYMASK_TYPE_HIDE`

Note it is not allowed to set the mask on `PROPERTY_MASKS_PROP`. This method does nothing for this situation.

Parameters:
  `propName` - the property name to get. Can be a system-defined or user-defined property name.
  `maskValue` - the mask value
Throws:
  `SemanticException` - if the maskValue is not one of the above.
See Also:
  - `DesignChoiceConstants`

### setDisplayNameKey

public void setDisplayNameKey(String displayNameKey) throws SemanticException
Sets the resource key of the display name.

Parameters:
  `displayNameKey` - the resource key of the display name
Throws:
  `SemanticException` - if the display name resource-key property is locked or not defined on this element.

### getDisplayNameKey

public String getDisplayNameKey()
Gets the resource key of the display name.

Returns:
  the resource key of the display name

### setDisplayName

public void setDisplayName(String displayName) throws SemanticException
Sets the display name.

Parameters:
  `displayName` - the display name
Throws:
  `SemanticException` - if the display name property is locked or not defined on this element.

### getDisplayName

public String getDisplayName()
Gets the display name.

Returns:
  the display name

### setCustomXml

public void setCustomXml(String customXml) throws SemanticException
Sets the custom XML.

Parameters:
  `customXml` - the custom XML to set
Throws:
  `SemanticException` - if the custom XML is locked or not defined on this element.

### getCustomXml

public String getCustomXml()
Gets the custom XML.

Returns:
  the custom XML

### setComments

public void setComments(String theComments) throws SemanticException
Sets the comments of the report element.

Parameters:
  `theComments` - the comments to set
Throws:
  `SemanticException` - if the comments property is locked or not defined on this element.

### getComments

public String getComments()
Gets the comments of the report element.

Returns:
  the comments of the report element

### isValidReferenceForCompoundElement

@Deprecated public boolean isValidReferenceForCompoundElement()
Deprecated.
Checks whether the compound element is valid if the element has no extends property value or if the current element is compound elements and extends value is unresovled.

Returns:
  `true` if the compound element is valid. Otherwise `false`.

### isValidLayoutForCompoundElement

public boolean isValidLayoutForCompoundElement()
Checks whether the compound element is valid. If a table/grid has no rows/columns, it is invalid. If the table has overlapped areas, it is invalid.

Returns:
  `true` if the compound element is valid. Otherwise `false`.