Class ContentElementHandle
java.lang.Object
org.eclipse.birt.report.model.api.DesignElementHandle
org.eclipse.birt.report.model.api.ContentElementHandle
- All Implemented Interfaces:
org.eclipse.birt.report.model.elements.interfaces.IDesignElementModel
- Direct Known Subclasses:
AccessControlHandle,DataGroupHandle,FilterConditionElementHandle,MemberValueHandle,SortElementHandle,VariableElementHandle
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.eclipse.birt.report.model.core.DesignElementThe target report element.Fields inherited from class org.eclipse.birt.report.model.api.DesignElementHandle
moduleFields 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
ConstructorsConstructorDescriptionContentElementHandle(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 TypeMethodDescriptionfinal voidaddListener(Listener obj) Registers a change event listener.final booleanDetermines if the current element can be transformed to a template element.final IteratorReturns an iterator over the clients of this element.final TemplateElementHandlecreateTemplateElement(String name) Creates a template element handle and transforms the current element handle to the created template element.final IteratorReturns an iterator over the elements that derive from this one.final org.eclipse.birt.report.model.core.DesignElementReturns the element to which this handle is attached.Gets a string that defines the event handle class.Returns a handle to the element that this element extends.getName()Returns the name of this element.final StyleHandleReturns a handle to work with the style properties of this element.final StringGets the name of this element.final booleanChecks whether this element is based on a template parameter definition or not.final voidlocalize()Localize the element, break the parent/child relationship and set all the extended properties locally.final voidremoveListener(Listener obj) Removes a given listener.final voidif this design element is based on a template definitionDesignElementHandle.isTemplateParameterValue(),get rid of the template definition )final TemplateElementHandlerevertToTemplate(String name) Creates a template element handle and transforms the current element handle to the created template element if the current element is based on a template parameter definition.final voidsetEventHandlerClass(String expr) Sets the group expression.final voidsetExtends(DesignElementHandle parent) Sets this element to extend the given element.final voidsetExtendsName(String name) Sets the name of the element that this element extends.voidSets the name of this element.voidsetStyle(SharedStyleHandle style) Sets the shared style element for this element.voidsetStyleName(String name) Sets the name of the shared style for this element.Methods inherited from class org.eclipse.birt.report.model.api.DesignElementHandle
add, add, addElement, addElement, addUserPropertyDefn, cachePropertyHandles, canContain, canContain, canContain, canContain, canDrop, canEdit, clearAllProperties, clearContents, clearProperty, copy, copyPropertyTo, 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, getExpressionProperty, getExternalizedValue, getExternalizedValue, getExternalizedValue, getFactoryElementHandle, getFactoryPropertyHandle, getFloatProperty, getFontProperty, getFullName, getHostViewHandle, getID, getIndex, getIntProperty, getListProperty, getListProperty, getMethods, getModule, getModuleHandle, getNumberProperty, getProperty, getPropertyBinding, getPropertyBindingExpression, getPropertyBindings, getPropertyDefn, getPropertyHandle, getPropertyIterator, getRoot, getSemanticErrors, getSlot, getStringProperty, getStyle, getUserProperties, getUserPropertyDefnHandle, getXPath, hasLocalProperties, hasSemanticError, initializeSlotHandles, isDirectionRTL, isInTemplateParameter, isValid, move, move, moveTo, moveTo, moveTo, moveTo, newHandlerOnEachEvent, paste, paste, paste, paste, semanticCheck, setBooleanProperty, setEncryption, setExpressionProperty, setExtendsElement, setFloatProperty, setIntProperty, setNewHandlerOnEachEvent, setNumberProperty, setProperties, setProperty, setPropertyBinding, setPropertyBinding, setStringProperty, setStyleElement, setValid, shift, showError, slotsIterator
-
Field Details
-
element
protected org.eclipse.birt.report.model.core.DesignElement elementThe target report element.
-
-
Constructor Details
-
ContentElementHandle
public ContentElementHandle(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 moduleelement- the model representation of the element
-
-
Method Details
-
getElement
public final org.eclipse.birt.report.model.core.DesignElement getElement()Description copied from class:DesignElementHandleReturns the element to which this handle is attached.- Specified by:
getElementin classDesignElementHandle- Returns:
- The attached element. Will be null if the handle is not attached.
-
addListener
Description copied from class:DesignElementHandleRegisters a change event listener. A listener receives notifications each time an element changes. A listener can be registered any number of times, but will receive each event only once.- Overrides:
addListenerin classDesignElementHandle- Parameters:
obj- the listener to register
-
isTemplateParameterValue
public final boolean isTemplateParameterValue()Description copied from class:DesignElementHandleChecks whether this element is based on a template parameter definition or not. Call this method before calling methodDesignElementHandle.revertToTemplate(String)to assure that this element can be reverted to a template element. If this method returns false, methodrevertToTemplate(String)must fail too.- Overrides:
isTemplateParameterValuein classDesignElementHandle- Returns:
- true if this element is based on a template parameter definition, otherwise false
-
localize
Description copied from class:DesignElementHandleLocalize the element, break the parent/child relationship and set all the extended properties locally.- Overrides:
localizein classDesignElementHandle- Throws:
SemanticException- the element can not be localized properly. It may be because that the element is not extended from a parent, or that same properties can not be localized on the element or the content elements inside it.
-
removeListener
Description copied from class:DesignElementHandleRemoves a given listener. If the listener registered, then the request is silently ignored.- Overrides:
removeListenerin classDesignElementHandle- Parameters:
obj- the listener to de-register
-
revertToReportItem
Description copied from class:DesignElementHandleif this design element is based on a template definitionDesignElementHandle.isTemplateParameterValue(),get rid of the template definition )- Overrides:
revertToReportItemin classDesignElementHandle- Throws:
SemanticException
-
revertToTemplate
Description copied from class:DesignElementHandleCreates a template element handle and transforms the current element handle to the created template element if the current element is based on a template parameter definition.- Overrides:
revertToTemplatein classDesignElementHandle- Parameters:
name- the name of created template element handle- Returns:
- the template element handle
- Throws:
SemanticException- if the current element can not be transformed to a template element, current element has no template parameter definition, current module is not a report design or some containing contexts don't match
-
canTransformToTemplate
public final boolean canTransformToTemplate()Description copied from class:DesignElementHandleDetermines if the current element can be transformed to a template element. False will be returned if the element can not be dropped or the container of the current element can not contain the template element.- Overrides:
canTransformToTemplatein classDesignElementHandle- Returns:
- true if it can be transformed, otherwise false.
-
clientsIterator
Description copied from class:DesignElementHandleReturns an iterator over the clients of this element. Useful only for styles. Returns a list of all the elements that use this style.- Overrides:
clientsIteratorin classDesignElementHandle- Returns:
- an iterator over the clients of this element. Each item returned by
the iterator's
getNext( )method is of typeDesignElementHandle. Nothing will be iterated over an element that is notReferenceableElement.
-
createTemplateElement
Description copied from class:DesignElementHandleCreates a template element handle and transforms the current element handle to the created template element.- Overrides:
createTemplateElementin classDesignElementHandle- Parameters:
name- the name of created template element handle- Returns:
- the template element handle
- Throws:
SemanticException- if the current element can not be transformed to a template element, current module is not a report design or some containing contexts don't match
-
derivedIterator
Description copied from class:DesignElementHandleReturns an iterator over the elements that derive from this one.- Overrides:
derivedIteratorin classDesignElementHandle- Returns:
- an iterator over the elements that derive from this one. Each item
returned by the iterator's
getNext( )method is of typeDesignElementHandle.
-
getName
Description copied from class:DesignElementHandleReturns the name of this element. Returnsnullif the element does not have a name. Many elements do not require a name. The name does not inherit. If this element does not have a name, it will not inherit the name of its parent element.- Overrides:
getNamein classDesignElementHandle- Returns:
- the element name, or null if the name is not set
-
getPrivateStyle
Description copied from class:DesignElementHandleReturns a handle to work with the style properties of this element. Use a style handle to work with the specific getter/setter methods for each style property. The style handle is not necessary to work with style properties generically.Note a key difference between this method and the
getStyle( )method. This method returns a handle to the this element. ThegetStyle( )method returns a handle to the shared style, if any, that this element references.- Overrides:
getPrivateStylein classDesignElementHandle- Returns:
- a style handle to work with the style properties of this element.
Returns
nullif this element does not have style properties.
-
getQualifiedName
Description copied from class:DesignElementHandleGets the name of this element. The returned element name will be the same asgetName(), plus the namespace of the module that the element is contained, if the element name resides in the whole design tree scope; otherwise we will append the name of the holder where the element name resides. If the element is existed in the current module,this method andgetName()will return identical results.- Overrides:
getQualifiedNamein classDesignElementHandle- Returns:
- the qualified name of the element.
-
setEventHandlerClass
Description copied from class:DesignElementHandleSets the group expression.- Overrides:
setEventHandlerClassin classDesignElementHandle- Parameters:
expr- the expression to set- Throws:
SemanticException- If the expression is invalid.- See Also:
-
setExtends
Description copied from class:DesignElementHandleSets this element to extend the given element.- Overrides:
setExtendsin classDesignElementHandle- Parameters:
parent- handle to the element that this element is to extend. Ifnull, then this element will no longer extend another element.- Throws:
ExtendsException- if the parent element is of the wrong type as this element.
-
setExtendsName
Description copied from class:DesignElementHandleSets the name of the element that this element extends. The name must resolve to an element of the same type as this element.- Overrides:
setExtendsNamein classDesignElementHandle- Parameters:
name- the name of the element that this one is to extend- Throws:
ExtendsException- if no element exists with the given name, or if the element is of the wrong type.
-
setName
Description copied from class:DesignElementHandleSets the name of this element. If the name isnull, then the name is cleared if this element does not require a name.- Overrides:
setNamein classDesignElementHandle- Parameters:
name- the new name- Throws:
NameException- if the name is duplicate, or if the name isnulland this element requires a name.
-
getEventHandlerClass
Description copied from class:DesignElementHandleGets a string that defines the event handle class.- Overrides:
getEventHandlerClassin classDesignElementHandle- Returns:
- the expression as a string
- See Also:
-
getExtends
Description copied from class:DesignElementHandleReturns a handle to the element that this element extends.- Overrides:
getExtendsin classDesignElementHandle- Returns:
- the parent element. Returns
nullif this element does not have a parent, or if the extends name does not resolve to a valid element.
-
setStyleName
Description copied from class:DesignElementHandleSets the name of the shared style for this element.- Overrides:
setStyleNamein classDesignElementHandle- Parameters:
name- the name of the shared style. Ifnull, then the shared style name is cleared.- Throws:
StyleException- If the name is not valid, or if this element does not support a style.- See Also:
-