public abstract class DesignElementHandle
extends java.lang.Object
implements org.eclipse.birt.report.model.elements.interfaces.IDesignElementModel
Element handles are immutable. Once created, they always point to the same element. Handles also cannot point to a null element. An assertion will be raised if the derived classes are created with a null element.
For a complete description of the services available for any design element,
see the class description for the
DesignElement
class.
SlotHandle
,
DesignElement
Modifier and Type | Field and Description |
---|---|
protected org.eclipse.birt.report.model.core.Module |
module
Provides overall information about the root element.
|
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 and Description |
---|
DesignElementHandle(org.eclipse.birt.report.model.core.Module module)
Constructs a handle with the given module.
|
Modifier and Type | Method and Description |
---|---|
void |
add(java.lang.String propName,
DesignElementHandle content)
Adds a report item to the property with the given element handle.
|
void |
add(java.lang.String propName,
DesignElementHandle content,
int newPos)
Adds a report item to this property at the given position.
|
void |
addElement(DesignElementHandle child,
int slotId)
Adds a report item to the end of the given slot.
|
void |
addElement(DesignElementHandle child,
int slotId,
int pos)
Adds a report item to the given slot at the given position.
|
void |
addListener(Listener obj)
Registers a change event listener.
|
void |
addUserPropertyDefn(UserPropertyDefn prop)
Adds a user-defined property definition.
|
protected void |
cachePropertyHandles()
Constructs slot handles in the constructor to make sure that getMumble()
methods won't construct any new instance.
|
boolean |
canContain(int slotId,
DesignElementHandle content)
Determines if the given slot can contain the
content . |
boolean |
canContain(int slotId,
java.lang.String type)
Determines if the slot can contain an element with the type of
type . |
boolean |
canContain(java.lang.String propName,
DesignElementHandle content)
Determines if the given slot can contain the
content . |
boolean |
canContain(java.lang.String propName,
java.lang.String type)
Determines if the slot can contain an element with the type of
type . |
boolean |
canDrop()
Determines if this element can be dropped from its container.
|
boolean |
canEdit()
Determines if this element is editable or not.
|
boolean |
canTransformToTemplate()
Determines if the current element can be transformed to a template
element.
|
void |
clearAllProperties()
Clears values of all properties.
|
void |
clearContents(int slotId)
Clears all the content within the given slot.
|
void |
clearProperty(java.lang.String propName)
Clears the value of a property.
|
java.util.Iterator |
clientsIterator()
Returns an iterator over the clients of this element.
|
IDesignElement |
copy()
Deeply clones the current design element which is wrapped by the handle.
|
void |
copyPropertyTo(java.lang.String propName,
DesignElementHandle targetHandle)
Copies all properties to the target element.
|
TemplateElementHandle |
createTemplateElement(java.lang.String name)
Creates a template element handle and transforms the current element
handle to the created template element.
|
java.util.Iterator |
derivedIterator()
Returns an iterator over the elements that derive from this one.
|
static void |
doSort(java.util.List list)
Sorts a list of elements by localized display name.
|
void |
drop()
Drops this element from the design.
|
void |
drop(java.lang.String propName,
DesignElementHandle content)
Drops a content element from the container, and unresolve any reference
property which refers the element to drop.
|
void |
drop(java.lang.String propName,
int posn)
Drops a content element at the given position from the container, and
unresolve any reference property which refers the element to drop.
|
void |
dropAndClear()
Drops this element from the design.
|
void |
dropAndClear(java.lang.String propName,
DesignElementHandle content)
Drops a content element from the container, and clear any reference
property which refers the element to drop.
|
void |
dropAndClear(java.lang.String propName,
int posn)
Drops a content element at the given position from the container, and
clear any reference property which refers the element to drop.
|
void |
dropUserPropertyDefn(java.lang.String propName)
Removes an existing user property definition from the element.
|
int |
findContentSlot(DesignElementHandle content)
Finds the slot within this element that contains the given element.
|
boolean |
getBooleanProperty(java.lang.String propName)
Returns the value of a property as a Boolean.
|
IChoice[] |
getChoices(java.lang.String propName)
Returns a array of valid choices for a property.
|
ColorHandle |
getColorProperty(java.lang.String propName)
Returns a handle to work with a color property.
|
DesignElementHandle |
getContainer()
Returns a handle to the element that contains this element.
|
PropertyHandle |
getContainerPropertyHandle()
Gets a handle for the container's property what holds this element.
|
SlotHandle |
getContainerSlotHandle()
Returns the a handle the the container's slot that holds this element.
|
DesignElementHandle |
getContent(java.lang.String propName,
int index)
Gets a handle to the content element at the given position.
|
int |
getContentCount(java.lang.String propName)
Returns the number of elements in the property.
|
java.util.List |
getContents(java.lang.String propName)
Returns the a list with contents.Items are handles to the contents and in
order by position.
|
IElementDefn |
getDefn()
Gets the definition of the element.
|
org.eclipse.birt.report.model.elements.ReportDesign |
getDesign()
Deprecated.
replaced by getModule()
|
ReportDesignHandle |
getDesignHandle()
Deprecated.
replaced by getModuleHandle()
|
DimensionHandle |
getDimensionProperty(java.lang.String propName)
Returns a handle to work with a Dimension property.
|
java.lang.String |
getDisplayLabel()
Returns the short display label for this element.
|
java.lang.String |
getDisplayLabel(int level)
Returns the display label for this element.
|
java.lang.String |
getDisplayProperty(java.lang.String propName)
Return a localized string version of the property.
|
protected org.eclipse.birt.report.model.core.Module |
getEffectiveModule()
Returns the effective module of the element.
|
abstract org.eclipse.birt.report.model.core.DesignElement |
getElement()
Returns the element to which this handle is attached.
|
ElementFactory |
getElementFactory()
Returns the element factory for creating new report elements.
|
DesignElementHandle |
getElementProperty(java.lang.String propName)
Returns the value of an element reference property.
|
java.lang.String |
getEventHandlerClass()
Gets a string that defines the event handle class.
|
ExpressionHandle |
getExpressionProperty(java.lang.String propName)
Returns a handle to work with an expression property.
|
DesignElementHandle |
getExtends()
Returns a handle to the element that this element extends.
|
java.lang.String |
getExternalizedValue(java.lang.String textIDProp,
java.lang.String textProp)
Returns externalized message.
|
java.lang.String |
getExternalizedValue(java.lang.String textIDProp,
java.lang.String textProp,
ULocale locale)
Returns externalized message.
|
FactoryElementHandle |
getFactoryElementHandle()
Gets the factory element handle for this element.
|
FactoryPropertyHandle |
getFactoryPropertyHandle(java.lang.String propName)
Returns a handle for a top-level property for use in preparing the
Factory data structures.
|
double |
getFloatProperty(java.lang.String propName)
Returns the value of a property as a double.
|
protected FontHandle |
getFontProperty()
Gets the font handle for the element.
|
java.lang.String |
getFullName()
Returns the full name of this element.
|
DesignElementHandle |
getHostViewHandle()
Return the direct host element handle for this view element.
|
long |
getID()
Returns the unique ID for this object.
|
int |
getIndex()
Gets the position where this element resides in its container.
|
int |
getIntProperty(java.lang.String propName)
Returns the value of a property as an integer.
|
java.util.List |
getListProperty(org.eclipse.birt.report.model.core.Module module,
java.lang.String propName)
Deprecated.
replaced by
getListProperty(String) |
java.util.List |
getListProperty(java.lang.String propName)
Gets the value of a property as a list.
|
java.util.List |
getMethods()
Returns the methods defined on the element definition.
|
org.eclipse.birt.report.model.core.Module |
getModule()
Returns the module on which this handle is attached.
|
ModuleHandle |
getModuleHandle()
Returns the handle of module.
|
java.lang.String |
getName()
Returns the name of this element.
|
java.math.BigDecimal |
getNumberProperty(java.lang.String propName)
Returns the value of a property as a number (BigDecimal).
|
StyleHandle |
getPrivateStyle()
Returns a handle to work with the style properties of this element.
|
java.lang.Object |
getProperty(java.lang.String propName)
Returns the value of a property as a generic object.
|
java.lang.String |
getPropertyBinding(java.lang.String propName)
Deprecated.
instead use getPropertyBindingExpression( String propName )
|
Expression |
getPropertyBindingExpression(java.lang.String propName)
Returns the overridden value of the specified property given its internal
name.
|
java.util.List |
getPropertyBindings()
Gets all the defined property bindings for the given element.
|
IElementPropertyDefn |
getPropertyDefn(java.lang.String propName)
Gets the property data for either a system-defined or user-defined
property.
|
PropertyHandle |
getPropertyHandle(java.lang.String propName)
Returns a property handle for a top-level property.
|
java.util.Iterator |
getPropertyIterator()
Returns an iterator over the properties of this element.
|
java.lang.String |
getQualifiedName()
Gets the name of this element.
|
ModuleHandle |
getRoot()
Returns the root container of this element.
|
java.util.List |
getSemanticErrors()
Returns the semantic error list, each of which is the instance of
ErrorDetail . |
SlotHandle |
getSlot(int slotID)
Returns a handle to the given slot.
|
java.lang.String |
getStringProperty(java.lang.String propName)
Returns the value of a property as a string which is locale independent.
|
SharedStyleHandle |
getStyle()
Returns the shared style, if any, as a style handle.
|
java.util.List |
getUserProperties()
Returns a list of user properties defined in this element and somewhere
up the inheritance chain.
|
UserPropertyDefnHandle |
getUserPropertyDefnHandle(java.lang.String propName)
Returns a user-defined property handle for a top-level property.
|
java.lang.String |
getXPath()
Returns return the path corresponding to the current position of the
element in the tree.
|
boolean |
hasLocalProperties()
Returns
true if this element has any locally-defined
property values. |
boolean |
hasSemanticError()
Justifies whether this element has any semantic error or not.
|
protected void |
initializeSlotHandles()
Constructs slot handles in the constructor to make sure that getMumble()
methods won't construct any new instance.
|
boolean |
isDirectionRTL()
Examines whether the resolved direction of this design element is Right
to Left or not.
|
boolean |
isInTemplateParameter()
Checks whether the given element is contained by one of template
parameter definition.
|
boolean |
isTemplateParameterValue()
Checks whether this element is based on a template parameter definition
or not.
|
boolean |
isValid()
Returns whether the element is valid or not.
|
void |
localize()
Localize the element, break the parent/child relationship and set all the
extended properties locally.
|
void |
move(java.lang.String fromPropName,
DesignElementHandle content,
DesignElementHandle newContainer,
java.lang.String toPropName)
Moves a content element from this element into a property in another
container element.
|
void |
move(java.lang.String fromPropName,
DesignElementHandle content,
DesignElementHandle newContainer,
java.lang.String toPropName,
int newPos)
Moves a content element into a property in another container element at
the specified position.
|
void |
moveTo(DesignElementHandle newContainer,
int toSlot)
Moves this element to a new location within the design.
|
void |
moveTo(DesignElementHandle newContainer,
java.lang.String toPropName)
Moves this element to a property in another container element.
|
void |
moveTo(DesignElementHandle newContainer,
java.lang.String toPropName,
int newPos)
Moves this element to a property in another container element at the
specified position.
|
void |
moveTo(int posn)
Moves this element handle to the given position within its container.
|
boolean |
newHandlerOnEachEvent()
Gets the newHandlerOnEachEvent property value.
|
java.util.List |
paste(java.lang.String propName,
DesignElementHandle content)
Pastes a report item to this property.
|
java.util.List |
paste(java.lang.String propName,
DesignElementHandle content,
int newPos)
Pastes a report item to the slot.
|
java.util.List |
paste(java.lang.String propName,
IDesignElement content)
Pastes a report item to this property.
|
java.util.List |
paste(java.lang.String propName,
IDesignElement content,
int newPos)
Pastes a report item to the property.
|
void |
removeListener(Listener obj)
Removes a given listener.
|
void |
revertToReportItem()
if this design element is based on a template definition
isTemplateParameterValue() ,get rid of the template definition ) |
TemplateElementHandle |
revertToTemplate(java.lang.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.
|
java.util.List |
semanticCheck()
Checks this element with semantic rules.
|
void |
setBooleanProperty(java.lang.String propName,
boolean value)
Sets the boolean value to the property.
|
void |
setEncryption(java.lang.String propName,
java.lang.String encryptionID)
Sets the encryption for an encryptable property.
|
void |
setEventHandlerClass(java.lang.String expr)
Sets the group expression.
|
void |
setExpressionProperty(java.lang.String propName,
Expression expression)
Sets the value of a property to an expression.
|
void |
setExtends(DesignElementHandle parent)
Sets this element to extend the given element.
|
void |
setExtendsElement(org.eclipse.birt.report.model.core.DesignElement parent)
Deprecated.
|
void |
setExtendsName(java.lang.String name)
Sets the name of the element that this element extends.
|
void |
setFloatProperty(java.lang.String propName,
double value)
Sets the value of a property to a double.
|
void |
setIntProperty(java.lang.String propName,
int value)
Sets the value of a property to an integer.
|
void |
setName(java.lang.String name)
Sets the name of this element.
|
void |
setNewHandlerOnEachEvent(boolean newHandler)
Sets the newHandlerOnEachEvent property value.
|
void |
setNumberProperty(java.lang.String propName,
java.math.BigDecimal value)
Sets the value of a property to a number (BigDecimal).
|
void |
setProperties(java.util.Map properties)
Sets a bunch of property values on the element.
|
void |
setProperty(java.lang.String propName,
java.lang.Object value)
Sets the value of a property from a generic object.
|
void |
setPropertyBinding(java.lang.String propName,
Expression value)
Sets the mask of the specified property.
|
void |
setPropertyBinding(java.lang.String propName,
java.lang.String value)
Deprecated.
instead use setPropertyBinding( String propName, Expression
value )
|
void |
setStringProperty(java.lang.String propName,
java.lang.String value)
Sets the value of a property to a string.
|
void |
setStyle(SharedStyleHandle style)
Sets the shared style element for this element.
|
void |
setStyleElement(org.eclipse.birt.report.model.core.StyleElement obj)
Deprecated.
|
void |
setStyleName(java.lang.String name)
Sets the name of the shared style for this element.
|
void |
setValid(boolean isValid)
Sets the status that identifies whether the element is valid or not.
|
void |
shift(java.lang.String propName,
DesignElementHandle content,
int toPosn)
Moves the position of a content element within this container.
|
boolean |
showError()
Determines whether to show an error item on the element or not.
|
java.util.Iterator<SlotHandle> |
slotsIterator()
Returns the iterator for slot defined on the element.
|
protected final org.eclipse.birt.report.model.core.Module module
DesignElementHandle
.public DesignElementHandle(org.eclipse.birt.report.model.core.Module module)
module
- the moduleprotected final void initializeSlotHandles()
protected void cachePropertyHandles()
public org.eclipse.birt.report.model.elements.ReportDesign getDesign()
public org.eclipse.birt.report.model.core.Module getModule()
ReportDesign
or Library
.public ReportDesignHandle getDesignHandle()
public ModuleHandle getModuleHandle()
ReportDesignHandle
or LibraryHandle
.public abstract org.eclipse.birt.report.model.core.DesignElement getElement()
public IElementDefn getDefn()
public java.lang.Object getProperty(java.lang.String propName)
propName
- the name of the property of interestgetIntProperty(java.lang.String)
,
getStringProperty(java.lang.String)
,
getFloatProperty(java.lang.String)
,
getNumberProperty(java.lang.String)
public java.lang.String getStringProperty(java.lang.String propName)
propName
- the name of the propertypublic java.lang.String getDisplayProperty(java.lang.String propName)
propName
- the name of the propertypublic boolean getBooleanProperty(java.lang.String propName)
propName
- the name of the propertypublic int getIntProperty(java.lang.String propName)
propName
- the name of the property.public double getFloatProperty(java.lang.String propName)
propName
- the name of the property.null
if the value
cannot be converted to a double.public java.math.BigDecimal getNumberProperty(java.lang.String propName)
propName
- the name of the property.null
if the value
cannot be converted to a number.public DimensionHandle getDimensionProperty(java.lang.String propName)
propName
- name of the property.null
if the property is defined or
not dimension property.DimensionHandle
public ColorHandle getColorProperty(java.lang.String propName)
propName
- name of the property.null
if the given property is not defined or
not color property.ColorHandle
protected FontHandle getFontProperty()
FontHandle
. Otherwise, return
null
.null
.FontHandle
public DesignElementHandle getElementProperty(java.lang.String propName)
null
if the reference is
unresolved or unset.propName
- the name of the property.public java.util.List getListProperty(org.eclipse.birt.report.model.core.Module module, java.lang.String propName)
getListProperty(String)
module
- the modulepropName
- the name of the property to getArrayList
, or null if the property
is not set or the value is not a listpublic java.util.List getListProperty(java.lang.String propName)
module
- the modulepropName
- the name of the property to getArrayList
, or null if the property
is not set or the value is not a listpublic void setProperty(java.lang.String propName, java.lang.Object value) throws SemanticException
propName
- the property namevalue
- the value to setSemanticException
- if the property is undefined on the element or the value is
invalid.public void setIntProperty(java.lang.String propName, int value) throws SemanticException
propName
- the property namevalue
- the value to setSemanticException
- If the property value cannot be converted from an integer, or
if the value of a choice is incorrect.public void setStringProperty(java.lang.String propName, java.lang.String value) throws SemanticException
propName
- the property namevalue
- the value to setSemanticException
- if the value of a choice or other property is incorrect.public void setFloatProperty(java.lang.String propName, double value) throws SemanticException
propName
- the property namevalue
- the value to setSemanticException
- If the property value cannot be converted from a double.public void setNumberProperty(java.lang.String propName, java.math.BigDecimal value) throws SemanticException
propName
- the property namevalue
- the value to setSemanticException
- if the property value cannot be converted from a number.public void setBooleanProperty(java.lang.String propName, boolean value) throws SemanticException
propName
- the name of the property to setvalue
- the boolean value to setSemanticException
- if the property is not defined or value is invalidpublic void clearProperty(java.lang.String propName) throws SemanticException
propName
- the name of the property to clear.SemanticException
- if the property is not defined on this elementpublic void clearAllProperties() throws SemanticException
SemanticException
- if the property is not defined on this elementpublic boolean hasLocalProperties()
true
if this element has any locally-defined
property values. Returns false
otherwise.public void addUserPropertyDefn(UserPropertyDefn prop) throws UserPropertyException
prop
- the user property definition to add. The name and property
type must be valid.UserPropertyException
- if the element is not allowed to have user property or the
user property definition is invalid, or if the value of the
user-defined choice is invalid for the type of user property
definition, the property type is incorrect.public void addElement(DesignElementHandle child, int slotId, int pos) throws ContentException, NameException
child
- handle to the newly created elementslotId
- slot id in which the child item will be added.pos
- position in the slot that the child item will be added.ContentException
- if the element is not allowed in the slotNameException
- if the element has a duplicate or illegal namepublic void addElement(DesignElementHandle child, int slotId) throws ContentException, NameException
child
- handle to the newly created elementslotId
- slot id in which the child item will be added.ContentException
- if the element is not allowed in the slotNameException
- if the element has a duplicate or illegal namepublic java.util.List getMethods()
public void setProperties(java.util.Map properties) throws SemanticException
properties
- a Map store the property values keyed by the property name.SemanticException
- if the property is undefined on the element or the value is
invalid.setProperty(String, Object)
public void clearContents(int slotId) throws SemanticException
slotId
- id of the slot to be cleared.SemanticException
public void dropUserPropertyDefn(java.lang.String propName) throws UserPropertyException
propName
- the name of the user property to removeUserPropertyException
- If the property is not found.public DesignElementHandle getExtends()
null
if this element
does not have a parent, or if the extends name does not resolve
to a valid element.public void setExtends(DesignElementHandle parent) throws ExtendsException
parent
- handle to the element that this element is to extend. If
null
, then this element will no longer extend
another element.ExtendsException
- if the parent element is of the wrong type as this element.public void setExtendsName(java.lang.String name) throws ExtendsException
name
- the name of the element that this one is to extendExtendsException
- if no element exists with the given name, or if the element
is of the wrong type.public void localize() throws SemanticException
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.public void setExtendsElement(org.eclipse.birt.report.model.core.DesignElement parent) throws ExtendsException
setExtends(DesignElementHandle)
parent
- the element that this element is to extendExtendsException
- If the parent element is of the wrong type as this element.public SharedStyleHandle getStyle()
setStyle(SharedStyleHandle)
,
setStyleElement(StyleElement)
,
setStyleName(String)
public void setStyleName(java.lang.String name) throws StyleException
name
- the name of the shared style. If null
, then the
shared style name is cleared.StyleException
- If the name is not valid, or if this element does not support
a style.getStyle()
public void setStyleElement(org.eclipse.birt.report.model.core.StyleElement obj) throws StyleException
setStyle(SharedStyleHandle)
obj
- the shared style. If null
, then the shared style
is cleared.StyleException
- If this element does not support a style.getStyle()
public void setStyle(SharedStyleHandle style) throws StyleException
style
- the handle to the shared style. If null, then the shared style
is cleared.StyleException
- if this element does not support a style.getStyle()
public StyleHandle getPrivateStyle()
Note a key difference between this method and the
getStyle( )
method. This method returns a handle to the
this element. The getStyle( )
method returns a
handle to the shared style, if any, that this element references.
null
if this element does not have style
properties.public java.lang.String getName()
null
if 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.public java.lang.String getFullName()
getName()
.However, some elements have a
local name scope and its full name is not the name of the element itself.
For example, the name of the level is managed by its contaienr dimension
element. Therefore its full name is that name of the container dimension
appends character '/' and appends the name of the level itself, like
dimensionName/levelName. If the level has no container dimension, then
its full name is the same as the name.public java.lang.String getQualifiedName()
getName()
, 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 and getName()
will return identical
results.public void setName(java.lang.String name) throws NameException
null
, then the
name is cleared if this element does not require a name.name
- the new nameNameException
- if the name is duplicate, or if the name is null
and this element requires a name.public long getID()
ModuleHandleImpl.getElementByID(long)
,
MetaDataDictionary.enableElementID()
public ElementFactory getElementFactory()
add
method of the slot handle that represents the point in the design where
the new element should appear.SlotHandle
public PropertyHandle getPropertyHandle(java.lang.String propName)
propName
- the name of the property to getnull
if the no property
exists with the given name.PropertyHandle
public UserPropertyDefnHandle getUserPropertyDefnHandle(java.lang.String propName)
propName
- the name of the property to getnull
if the
no property exists with the given name or it is not a
user-defined property.public java.util.List getUserProperties()
UserPropertyDefn
.public FactoryPropertyHandle getFactoryPropertyHandle(java.lang.String propName)
propName
- the name of the property to getnull
if either 1) no
property exists with the given name or 2) the property is a style
property and is not set in a private style.public DesignElementHandle getContainer()
public void moveTo(DesignElementHandle newContainer, int toSlot) throws ContentException
newContainer
- the new container elementtoSlot
- the target slot within the new containerContentException
- If the element cannot be placed into the target element or
slot, perhaps because the element is of the wrong type, the
slot is full, or other error.SlotHandle
public void dropAndClear() throws SemanticException
Note: If this element is referencable, the property referring it will be set null.
SemanticException
- if this element has no container or the element cannot be
dropped.SlotHandle
,
drop()
public void drop() throws SemanticException
Note: If this element is referencable, the property referring it will be unresolved.
SemanticException
- if this element has no container or the element cannot be
dropped.SlotHandle
,
dropAndClear()
public int findContentSlot(DesignElementHandle content)
content
- handle to the content element to findIDesignElementModel.NO_SLOT
if the element is not contained in
this element.public SlotHandle getContainerSlotHandle()
null
if this element has no container.public PropertyHandle getContainerPropertyHandle()
null
if this element has no containerpublic SlotHandle getSlot(int slotID)
null
will be returned.slotID
- the identifier of the slot for which to obtain a handlepublic java.util.Iterator<SlotHandle> slotsIterator()
SlotHandle
public java.util.Iterator getPropertyIterator()
getNext( )
returns an object of type
PropertyHandle
.PropertyIterator
,
PropertyHandle
,
UserPropertyDefnHandle
public void addListener(Listener obj)
obj
- the listener to registerpublic void removeListener(Listener obj)
obj
- the listener to de-registerpublic java.util.Iterator derivedIterator()
getNext( )
method is
of type DesignElementHandle
.public java.util.Iterator clientsIterator()
getNext( )
method is of type
DesignElementHandle
. Nothing will be iterated over an
element that is not ReferenceableElement
.public IChoice[] getChoices(java.lang.String propName)
propName
- the property namenull
, if this property has no choice.public java.lang.String getDisplayLabel()
getDisplayLabel(int )
public java.lang.String getDisplayLabel(int level)
The user can also decide at which detail level the display label should be returned. The level can be one of the following options:
level
- the display label detail levelpublic static void doSort(java.util.List list)
list
- the list to sortpublic boolean isValid()
true
if this element is valid, otherwise
false
.public boolean showError()
public void setValid(boolean isValid)
isValid
- the status to setpublic boolean hasSemanticError()
public IDesignElement copy()
public void copyPropertyTo(java.lang.String propName, DesignElementHandle targetHandle) throws SemanticException
DesignElement.NAME_PROP
DesignElement.EXTENDS_PROP
targetHandle
should be in the same report as this
element. And this method should be called in one transaction.propName
- name of the property to copytargetHandle
- the target element handleSemanticException
- if the target element type is not as same as this element
type, or property is not defined .java.lang.IllegalArgumentException
- if the target element is not in the same report as this
element.public java.util.List semanticCheck()
ErrorDetail
object.ErrorDetail
public boolean canDrop()
true
if it can be dropped. Returns
false
otherwise.public boolean canEdit()
public boolean canTransformToTemplate()
public boolean canContain(int slotId, java.lang.String type)
type
. Even return value is true
, doesn't mean
the element can be added/moved without exceptions.slotId
- the slot idtype
- the name of the element type, like "Table", "List", etc.true
if the slot can contain the an element with
type
type, otherwise false
.canContain(int, DesignElementHandle)
public boolean canContain(int slotId, DesignElementHandle content)
content
. Even
return value is true
, doesn't mean the element can be
added/moved without exceptions.slotId
- the slot idcontent
- the design element handle to checktrue
if the slot with the given slotId
can contain the content
, otherwise
false
.canContain(int, String)
public boolean canContain(java.lang.String propName, java.lang.String type)
type
. Even return value is true
, doesn't mean
the element can be added/moved without exceptions.propName
- name of the property where the type to inserttype
- the name of the element type, like "Table", "List", etc.true
if the slot can contain the an element with
type
type, otherwise false
.canContain(int, DesignElementHandle)
public boolean canContain(java.lang.String propName, DesignElementHandle content)
content
. Even
return value is true
, doesn't mean the element can be
added/moved without exceptions.propName
- the name of the property where the content to insertcontent
- the design element handle to checktrue
if the slot with the given slotId
can contain the content
, otherwise
false
.canContain(int, String)
public java.util.List getSemanticErrors()
ErrorDetail
.public ModuleHandle getRoot()
public java.lang.String getXPath()
For example,
Note: the localized name is used for element type and slot name.
public java.lang.String getEventHandlerClass()
setEventHandlerClass(String)
public void setEventHandlerClass(java.lang.String expr) throws SemanticException
expr
- the expression to setSemanticException
- If the expression is invalid.getEventHandlerClass()
public boolean newHandlerOnEachEvent()
public void setNewHandlerOnEachEvent(boolean newHandler) throws SemanticException
newHandler
- controls if the event handler should be reloaded.SemanticException
public TemplateElementHandle createTemplateElement(java.lang.String name) throws SemanticException
name
- the name of created template element handleSemanticException
- 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 matchpublic TemplateElementHandle revertToTemplate(java.lang.String name) throws SemanticException
name
- the name of created template element handleSemanticException
- 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 matchpublic void revertToReportItem() throws SemanticException
isTemplateParameterValue()
,get rid of the template definition )SemanticException
public boolean isTemplateParameterValue()
revertToTemplate(String)
to assure that this element can be
reverted to a template element. If this method returns false, method
revertToTemplate(String)
must fail too.public IElementPropertyDefn getPropertyDefn(java.lang.String propName)
propName
- The name of the property to lookup.protected org.eclipse.birt.report.model.core.Module getEffectiveModule()
DesignElementHandle
is returned.public java.lang.String getPropertyBinding(java.lang.String propName)
propName
- the name of the property to get. Can be a system-defined or
user-defined property name.public java.util.List getPropertyBindings()
PropertyBinding
.public void setPropertyBinding(java.lang.String propName, java.lang.String value) throws SemanticException
propName
- the property name to get. Can be a system-defined or
user-defined property name.value
- the overridden valueSemanticException
- if the maskValue is not one of the above.public java.lang.String getExternalizedValue(java.lang.String textIDProp, java.lang.String textProp)
textIDProp
- the display key property nametextProp
- the property namepublic java.lang.String getExternalizedValue(java.lang.String textIDProp, java.lang.String textProp, ULocale locale)
textIDProp
- the display key property nametextProp
- the property namelocale
- the locale to externalize the messagepublic int getIndex()
public void add(java.lang.String propName, DesignElementHandle content) throws SemanticException
propName
- name of the property where the content to insertcontent
- handle to the newly created elementSemanticException
- if the element is not allowed to insertpublic void add(java.lang.String propName, DesignElementHandle content, int newPos) throws SemanticException
propName
- name of the property where the content to insertcontent
- handle to the newly created elementnewPos
- the position index at which the content to be inserted,
0-based integerSemanticException
- if the element is not allowed to insertpublic java.util.List paste(java.lang.String propName, DesignElementHandle content) throws SemanticException
propName
- name of the property where the content to insertcontent
- the newly created element handleSemanticException
- if the element is not allowed to pastepublic java.util.List paste(java.lang.String propName, IDesignElement content) throws SemanticException
propName
- name of the property where the content to insertcontent
- the newly created elementSemanticException
- if the element is not allowed to pastepublic java.util.List paste(java.lang.String propName, DesignElementHandle content, int newPos) throws SemanticException
propName
- name of the property where the content to insertcontent
- the newly created element handlenewPos
- the position index at which the content to be inserted.SemanticException
- if the element is not allowed in the slotpublic java.util.List paste(java.lang.String propName, IDesignElement content, int newPos) throws SemanticException
propName
- name of the property where the content to insertcontent
- the newly created elementnewPos
- the position index at which the content to be inserted.SemanticException
- if the element is not allowed in the propertypublic java.util.List getContents(java.lang.String propName)
propName
- name of the property where the contents residepublic int getContentCount(java.lang.String propName)
propName
- name of the property where the contents residepublic DesignElementHandle getContent(java.lang.String propName, int index)
propName
- name of the property where the content residesindex
- the specified position to findpublic void shift(java.lang.String propName, DesignElementHandle content, int toPosn) throws SemanticException
propName
- name of the property where the content residescontent
- handle to the content to movetoPosn
- the new positionSemanticException
- if the content is not in the property, or if the to position
is not valid.public void moveTo(int posn) throws SemanticException
posn
- the new position to moveSemanticException
public void move(java.lang.String fromPropName, DesignElementHandle content, DesignElementHandle newContainer, java.lang.String toPropName) throws SemanticException
fromPropName
- name of the property where the content originally residescontent
- a handle to the element to movenewContainer
- a handle to the new container elementtoPropName
- the target property name where the element will be moved to.SemanticException
- if the content is not in this slot or if the new container is
not, in fact, a container, or if the content cannot go into
the target slot.public void moveTo(DesignElementHandle newContainer, java.lang.String toPropName) throws SemanticException
newContainer
- a handle to the new container elementtoPropName
- the target property name where this element will be moved toSemanticException
public void move(java.lang.String fromPropName, DesignElementHandle content, DesignElementHandle newContainer, java.lang.String toPropName, int newPos) throws SemanticException
fromPropName
- name of the property where the content originally residescontent
- a handle to the element to movenewContainer
- a handle to the new container elementtoPropName
- the target property name where the element will be moved to.newPos
- the position to which the content will be moved. If it is
greater than the current content size of the target property,
the content will be appended at the end of the target
property.SemanticException
- if the content is not in this property or if the new
container is not, in fact, a container, or if the content
cannot go into the target property.public void moveTo(DesignElementHandle newContainer, java.lang.String toPropName, int newPos) throws SemanticException
newContainer
- a handle to the new container elementtoPropName
- the target property name where this element will be moved tonewPos
- the position to which this element will be moved. It is a
0-based integer. If it is greater than the current content
size of the target property, this element will be appended at
the tailSemanticException
public void dropAndClear(java.lang.String propName, DesignElementHandle content) throws SemanticException
propName
- name of the property where the content residescontent
- a handle to the content to dropSemanticException
- if the content is not within the containerpublic void drop(java.lang.String propName, DesignElementHandle content) throws SemanticException
propName
- name of the property where the content residescontent
- a handle to the content to dropSemanticException
- if the content is not within the containerpublic void dropAndClear(java.lang.String propName, int posn) throws SemanticException
propName
- name of the property where the content residesposn
- the position of the content to dropSemanticException
- if the position is out of rangepublic void drop(java.lang.String propName, int posn) throws SemanticException
propName
- name of the property where the content residesposn
- the position of the content to dropSemanticException
- if the position is out of rangepublic void setEncryption(java.lang.String propName, java.lang.String encryptionID) throws SemanticException
setProperty(String, Object)
to change the value of the
encryptable property.propName
- encryptionID
- SemanticException
public boolean isDirectionRTL()
public DesignElementHandle getHostViewHandle()
public boolean isInTemplateParameter()
true
if the element is in the template parameter
definition. Otherwise, false
.public FactoryElementHandle getFactoryElementHandle()
public ExpressionHandle getExpressionProperty(java.lang.String propName)
propName
- name of the property.ExpressionHandle
public void setExpressionProperty(java.lang.String propName, Expression expression) throws SemanticException
propName
- the property nameexpression
- the value to setSemanticException
public void setPropertyBinding(java.lang.String propName, Expression value) throws SemanticException
propName
- the property name to get. Can be a system-defined or
user-defined property name.value
- the overridden valueSemanticException
- if the maskValue is not one of the above.public Expression getPropertyBindingExpression(java.lang.String propName)
propName
- the name of the property to get. Can be a system-defined or
user-defined property name.Copyright © 2014 OpenText Corp. All rights reserved.