|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.birt.report.model.api.GroupElementHandle
public abstract class GroupElementHandle
This class provides services to deal with a group of elements. It is mostly useful for some multiple-selection cases, elements of the same type(or share the same base type) can be handled as a whole. User can perform some operations on the collection of elements.
For our ease-of-use purpose, we support multiple selections across type. Given a collection of elements, user can ask for their common properties(including user property definitions). Also, return a list of values that are identical for all items. Finally, return an indication of whether all elements are of the same type.
This class also supports a collection of elements contains some objects that
are not a DesignElementHandle
or its subclass. For this case,
getCommonProperties
always returns an empty list.
For BIRT UI usage, the attributes view will go blank if the providing elements are not of the same type, the property sheet will show the common properties(including user property definitions).
This handle is mutable, it can be kept. The query results changed as the given elements themselves changed.
Note that the Model special handling of the case where all elements are the same type: in this case, by definition, all BIRT-defined properties are the same. (User-defined properties may differ.)
Constructor Summary | |
---|---|
GroupElementHandle()
Default constructor. |
Method Summary | |
---|---|
protected abstract boolean |
allExtendedElements()
Checks if all elements have extends parents or virtual parents. |
abstract void |
clearLocalProperties()
Clears values of all common properties(except the extends property) for the given collection of elements. |
void |
clearProperty(java.lang.String propName)
Clears the value of a property on the given collection of elements if the property is a common property shared by each element. |
abstract java.util.List |
getCommonProperties()
Returns the common properties shared by the given group of elements(including user properties). |
java.lang.String |
getDisplayProperty(java.lang.String propName)
If the given property is a common property, value will be returned as a display value if all values within the group of elements are equal. |
abstract java.util.List |
getElements()
Returns the list that contains the group of design elements. |
java.lang.String |
getLocalStringProperty(java.lang.String propName)
If the given property is a common property, value will be returned as a string if all values within the group of elements are equal and one of them has a local value. |
abstract org.eclipse.birt.report.model.core.Module |
getModule()
Returns the module. |
abstract ModuleHandle |
getModuleHandle()
Returns the handle of module. |
abstract GroupPropertyHandle |
getPropertyHandle(java.lang.String propName)
If property is shared by the group of elements, return the corresponding GroupPropertyHandle , otherwise, return null . |
java.lang.String |
getStringProperty(java.lang.String propName)
If the given property is a common property, value will be returned as a string if all values within the group of elements are equal. |
boolean |
hasLocalPropertiesForExtendedElements()
This method returnt true in following condition: |
abstract boolean |
isExtendedElements()
Returns true if each of the given collection of element
extends has a parent. |
protected abstract boolean |
isInGroup(DesignElementHandle element)
Checks whether the element is a member of
GroupElementHandle . |
protected abstract boolean |
isPropertyReadOnly(java.lang.String propName)
Checks whether a property is read-only in the property sheet. |
protected abstract boolean |
isPropertyVisible(java.lang.String propName)
Checks whether a property is visible in the property sheet. |
abstract boolean |
isSameType()
Indicates that if the given elements are of the same definition. |
java.util.Iterator |
propertyIterator()
Returns an iterator over the common properties. |
void |
setProperty(java.lang.String propName,
java.lang.Object value)
Set the value of a property on the given collection of elements. |
void |
setStringProperty(java.lang.String propName,
java.lang.String value)
Set the value of a property to a string . |
boolean |
shareSameValue(java.lang.String propName)
Indicates whether the group of element share the same value for this property. |
abstract java.util.Iterator |
visiblePropertyIterator()
Returns an iterator over the common properties that are visible. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GroupElementHandle()
Method Detail |
---|
public abstract java.util.List getElements()
DesignElementHandle
public abstract org.eclipse.birt.report.model.core.Module getModule()
public abstract ModuleHandle getModuleHandle()
public abstract boolean isSameType()
If elements have different definitions. Even the same element type, the
return value is false
. For example, if the list contains
an OdaDataSource
and a OdaDataSource
, this
method returns false
.
true
if the given elements are of the same type;
return false
if elements are of different element
types, or the given list is empty, or the list contains any
object that is not an instance of
DesignElementHandle
.public abstract java.util.List getCommonProperties()
DesignElementHandle
, return an empty list.public final java.util.Iterator propertyIterator()
GroupPropertyHandle
. Note: remove is not support for the
iterator.
GroupPropertyHandle
public abstract java.util.Iterator visiblePropertyIterator()
GroupPropertyHandle
. Note: remove is not support for the
iterator.
GroupPropertyHandle
protected abstract boolean isPropertyVisible(java.lang.String propName)
elements
.
propName
- the property name
true
if it is visible. Otherwise
false
.public abstract void clearLocalProperties() throws SemanticException
SemanticException
- if the property is not defined on this elementpublic abstract boolean isExtendedElements()
true
if each of the given collection of element
extends has a parent. Returns false
otherwise. If the
collection has no elements, also return false
true
if each of the given collection of element
extends has a parent. Returns false
otherwise. If
the collection has no elements, also return false
public final boolean hasLocalPropertiesForExtendedElements()
true
in following condition:
1. The multi selected elements are same type.
2. And the multi selected elements have extends.
3. If any of the given elements has local properties.
true
if the conditions is met.protected abstract boolean allExtendedElements()
true
If all elements have extend parents or
virtual parents. Otherwise false
;protected abstract boolean isPropertyReadOnly(java.lang.String propName)
elements
.
propName
- the property name
true
if it is read-only. Otherwise
false
.public abstract GroupPropertyHandle getPropertyHandle(java.lang.String propName)
GroupPropertyHandle
, otherwise, return null
.
propName
- name of the property needs to be handled.
GroupPropertyHandle
; Otherwise
return null
.public final java.lang.String getStringProperty(java.lang.String propName)
null
.
propName
- name of the property.
GroupPropertyHandle.getStringValue()
public final java.lang.String getDisplayProperty(java.lang.String propName)
null
.
propName
- name of the property.
GroupPropertyHandle#getDisplayProperty()
public final java.lang.String getLocalStringProperty(java.lang.String propName)
null
.
propName
- name of the property.
GroupPropertyHandle.getLocalStringValue()
public final boolean shareSameValue(java.lang.String propName)
If all element has a null
value for this property, it is
considered that they share the same value.
propName
- name of the property.
true
if the group of element share the same value.
Return false
if the property is not a common
property or elements have different values for this property.public final void setProperty(java.lang.String propName, java.lang.Object value) throws SemanticException
propName
- name of the property.value
- value needs to set.
SemanticException
- if the value is invalid for the property, or the property is
undefined on the elements.GroupPropertyHandle.setValue(Object)
public final void clearProperty(java.lang.String propName) throws SemanticException
If the property provided is not a common property then this method simply return, else, the value will be cleared on the group of elements.
propName
- the name of the property to clear.
SemanticException
- if the property is not defined on this elementpublic final void setStringProperty(java.lang.String propName, java.lang.String value) throws SemanticException
propName
- name of the property.value
- value needs to set.
SemanticException
- if the value is invalid for the property, or the property is
undefined on the elements.protected abstract boolean isInGroup(DesignElementHandle element)
element
is a member of
GroupElementHandle
.
element
- the element to check
true
if the element is in the list, otherwise
false
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |