org.eclipse.birt.report.model.api
Class PropertyHandle

java.lang.Object
  extended byorg.eclipse.birt.report.model.api.ElementDetailHandle
      extended byorg.eclipse.birt.report.model.api.ValueHandle
          extended byorg.eclipse.birt.report.model.api.SimpleValueHandle
              extended byorg.eclipse.birt.report.model.api.PropertyHandle

public class PropertyHandle
extends SimpleValueHandle

A handle for working with a top-level property of an element.

See Also:
PropertyDefn, PropertyType

Field Summary
protected  org.eclipse.birt.report.model.metadata.ElementPropertyDefn propDefn
          Definition of the property.
 
Fields inherited from class org.eclipse.birt.report.model.api.ElementDetailHandle
elementHandle
 
Constructor Summary
PropertyHandle(DesignElementHandle element, org.eclipse.birt.report.model.metadata.ElementPropertyDefn prop)
          Constructs the handle for a top-level property with the given element handle and the definition of the property.
PropertyHandle(DesignElementHandle element, java.lang.String propName)
          Constructs the handle for a top-level property with the given element handle and property name.
 
Method Summary
 void addItem(java.lang.Object item)
          Adds an item to the end of a list property.
 boolean equals(java.lang.Object propertyHandle)
          Returns true if the two property handle has the same element and the same property.
 IPropertyDefn getDefn()
          Gets the generic property definition.
 IElementPropertyDefn getPropertyDefn()
          Gets the property definition.
 org.eclipse.birt.report.model.core.MemberRef getReference()
          Returns a reference to the value.
 java.util.List getReferenceableElementList()
          returns the element reference value list if the property is element referenceable type.
 java.lang.Object getValue()
          Gets the value of the property as a generic object.
 boolean isLocal()
          Determines whether this property value is set locally for this element.
 boolean isReadOnly()
          Checks whether a value is read-only in the property sheet.
 boolean isSet()
          Determines whether this property value is set for this element.
 boolean isVisible()
          Checks whether a value is visible in the property sheet.
 void removeItem(java.lang.Object item)
          Removes an item from a list property.
 void setValue(java.lang.Object value)
          Sets the value of a property or member to the object given.
 
Methods inherited from class org.eclipse.birt.report.model.api.SimpleValueHandle
addItem, clearValue, getAt, getChoices, getDefaultUnit, getDisplayValue, getFloatValue, getIntValue, getListValue, getNumberValue, getStringValue, getTypeCode, insertItem, isList, iterator, moveItem, removeItem, removeItem, removeItems, replaceItem, setFloatValue, setIntValue, setNumberValue, setStringValue
 
Methods inherited from class org.eclipse.birt.report.model.api.ElementDetailHandle
getDesign, getElement, getElementHandle, getModule
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

propDefn

protected org.eclipse.birt.report.model.metadata.ElementPropertyDefn propDefn
Definition of the property.

Constructor Detail

PropertyHandle

public PropertyHandle(DesignElementHandle element,
                      java.lang.String propName)
Constructs the handle for a top-level property with the given element handle and property name.

Parameters:
element - a handle to a report element
propName - the name of the property

PropertyHandle

public PropertyHandle(DesignElementHandle element,
                      org.eclipse.birt.report.model.metadata.ElementPropertyDefn prop)
Constructs the handle for a top-level property with the given element handle and the definition of the property.

Parameters:
element - a handle to a report element
prop - the definition of the property.
Method Detail

getPropertyDefn

public IElementPropertyDefn getPropertyDefn()
Description copied from class: ValueHandle
Gets the property definition. This is the definition of the property that contains the specific value. If the value is a structure or member, then this is the definition of the property that contains the list that contains the structure that contains the member.

Specified by:
getPropertyDefn in class ValueHandle
Returns:
the property definition

getDefn

public IPropertyDefn getDefn()
Description copied from class: SimpleValueHandle
Gets the generic property definition. Its a property definition for an element or a member definition for a structure.

Specified by:
getDefn in class SimpleValueHandle
Returns:
the value definition.

getValue

public java.lang.Object getValue()
Description copied from class: SimpleValueHandle
Gets the value of the property as a generic object. Use the specialized methods to get the value as a particular type.

Specified by:
getValue in class SimpleValueHandle
Returns:
The value of the property as a generic object.
See Also:
SimpleValueHandle.getStringValue( ), SimpleValueHandle.getIntValue( ), SimpleValueHandle.getFloatValue( ), SimpleValueHandle.getNumberValue( )

setValue

public void setValue(java.lang.Object value)
              throws SemanticException
Description copied from class: SimpleValueHandle
Sets the value of a property or member to the object given. If the object is null, then the value is cleared.

Specified by:
setValue in class SimpleValueHandle
Parameters:
value - The new value.
Throws:
SemanticException - If the value is not valid for the property or member.
See Also:
SimpleValueHandle.setIntValue(int), SimpleValueHandle.setStringValue(java.lang.String), SimpleValueHandle.setFloatValue(double), SimpleValueHandle.setNumberValue(java.math.BigDecimal), SimpleValueHandle.clearValue()

getReference

public org.eclipse.birt.report.model.core.MemberRef getReference()
Description copied from class: ValueHandle
Returns a reference to the value. The reference is used to identify a list entry or member.

Specified by:
getReference in class ValueHandle
Returns:
a reference to the value

isSet

public boolean isSet()
Determines whether this property value is set for this element. It is set if it is defined on this element property or any of its parents, or in the element's private style property. It is considered unset if it is set on a shared style.

Returns:
true if the value is set, false if it is not set

isLocal

public boolean isLocal()
Determines whether this property value is set locally for this element. It is set if and only if it is defined on this element local property.

Returns:
true if the local value is set, otherwise false.

equals

public boolean equals(java.lang.Object propertyHandle)
Returns true if the two property handle has the same element and the same property.

Parameters:
propertyHandle - the property handle
Returns:
true if the two property handles are same.

getReferenceableElementList

public java.util.List getReferenceableElementList()
returns the element reference value list if the property is element referenceable type.

Returns:
list of the reference element value.

isReadOnly

public boolean isReadOnly()
Description copied from class: SimpleValueHandle
Checks whether a value is read-only in the property sheet.

Specified by:
isReadOnly in class SimpleValueHandle
Returns:
true if it is read-only. Otherwise false.

isVisible

public boolean isVisible()
Description copied from class: SimpleValueHandle
Checks whether a value is visible in the property sheet.

Specified by:
isVisible in class SimpleValueHandle
Returns:
true if it is visible. Otherwise false.

addItem

public void addItem(java.lang.Object item)
             throws SemanticException
Adds an item to the end of a list property. The handle must be working on a list property.

Parameters:
item - The new item to add.
Throws:
SemanticException - If the property is not a list property, or if the the value of the item is incorrect.

removeItem

public void removeItem(java.lang.Object item)
                throws SemanticException
Removes an item from a list property. The handle must be working on a list property.

Parameters:
item - The new item to add.
Throws:
SemanticException - If the property is not a list property, or if the the value of the item does not exist in the element.


Copyright © 2005 Actuate Corp. All rights reserved.