|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.birt.report.model.api.ElementDetailHandle
org.eclipse.birt.report.model.api.ValueHandle
org.eclipse.birt.report.model.api.SimpleValueHandle
public abstract class SimpleValueHandle
Abstract base class that represents a handle for the value to either a property or a structure member.
Field Summary |
---|
Fields inherited from class org.eclipse.birt.report.model.api.ElementDetailHandle |
---|
elementHandle |
Constructor Summary | |
---|---|
SimpleValueHandle(DesignElementHandle element)
Constructs a handle with the given handle to an design element. |
Method Summary | |
---|---|
StructureHandle |
addItem(IStructure item)
Adds an item to the end of a list property or member. |
abstract void |
addItem(java.lang.Object item)
Adds an item to the end of a list property. |
void |
clearValue()
Clears the value of the property or member. |
java.lang.Object |
get(int n)
Returns the the nth entry in a list property or member. |
StructureHandle |
getAt(int n)
Returns the the nth entry in a list property or member. |
IChoice[] |
getChoices()
Returns the array of choices that are defined for this property or member. |
java.lang.String |
getDefaultUnit()
Gets the default unit of the property. |
abstract IPropertyDefn |
getDefn()
Gets the generic property definition. |
java.lang.String |
getDisplayValue()
gets the localized value of the property. |
double |
getFloatValue()
Gets the value as a double. |
int |
getIntValue()
Gets the value as an integer. |
java.util.ArrayList |
getListValue()
Gets the value as a list. |
java.math.BigDecimal |
getNumberValue()
Gets the value as a number (BigDecimal). |
java.lang.String |
getStringValue()
Gets the value as a string. |
int |
getTypeCode()
Returns the numeric code for the type of this property or member. |
abstract java.lang.Object |
getValue()
Gets the value of the property as a generic object. |
int |
indexOf(java.lang.Object o)
Returns the index in this list of the first occurrence of the specified element, or -1 if this list does not contain this element. |
StructureHandle |
insertItem(IStructure item,
int posn)
Inserts a new item into a list property or member at the given position. |
protected boolean |
isList()
Indicate if this handle is working on a list property. |
abstract boolean |
isReadOnly()
Checks whether a value is read-only in the property sheet. |
abstract boolean |
isVisible()
Checks whether a value is visible in the property sheet. |
java.util.Iterator |
iterator()
Returns an iterator over the values in a list property, or null if the property is not a list property. |
void |
moveItem(int from,
int to)
Moves an item within a list property or member. |
abstract void |
removeItem(int posn)
Removes an item from a list property or member. |
void |
removeItem(java.lang.Object item)
Removes an item from a list property or member. |
void |
removeItems(java.util.List items)
Removes all the items in the list from a list property or member. |
void |
replaceItem(IStructure oldItem,
IStructure newItem)
Replaces an old structure with a new one for the this property or member. |
void |
setFloatValue(double value)
Sets the value of the property or member to the given double. |
void |
setIntValue(int value)
Sets the value of the property or member to the given integer. |
void |
setNumberValue(java.math.BigDecimal value)
Sets the value of the property or member to the given number. |
void |
setStringValue(java.lang.String value)
Sets the value of the property or member to the given integer. |
abstract 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.ValueHandle |
---|
getPropertyDefn, getReference |
Methods inherited from class org.eclipse.birt.report.model.api.ElementDetailHandle |
---|
getDesign, getElement, getElementHandle, getModule |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimpleValueHandle(DesignElementHandle element)
element
- a handle to a report elementMethod Detail |
---|
public abstract IPropertyDefn getDefn()
public abstract java.lang.Object getValue()
getStringValue()
,
getIntValue()
,
getFloatValue()
,
getNumberValue()
public int getIntValue()
public java.lang.String getStringValue()
public double getFloatValue()
public java.math.BigDecimal getNumberValue()
public java.util.ArrayList getListValue()
public java.lang.String getDisplayValue()
public StructureHandle getAt(int n)
n
- The list index.
public java.lang.Object get(int n)
StructureHandle
.DesignElementHandle
if resolved, otherwise return the
qualified name of the referred element.null
.
n
- The list index.
public int indexOf(java.lang.Object o)
o
- element to search for.
public int getTypeCode()
PropertyType
class.
PropertyType
public java.util.Iterator iterator()
null
if the property is not a list property. The iterator
returns a StructureHandle
for each entry in the list. For
highlight rules, the iterator returns a list of
HighlightRuleHandle
s.
StructureHandle
,
StructureIterator
public void setIntValue(int value) throws SemanticException
value
- The value to set.
SemanticException
- If the property value cannot be converted from an integer, or
if the value of a choice is incorrect.public void setStringValue(java.lang.String value) throws SemanticException
value
- The value to set.
SemanticException
- If the value of a choice or other property is incorrect.public void setFloatValue(double value) throws SemanticException
value
- The value to set.
SemanticException
- If the property value cannot be converted from a double.public void setNumberValue(java.math.BigDecimal value) throws SemanticException
value
- The value to set.
SemanticException
- If the property value cannot be converted from a number.public void clearValue() throws SemanticException
SemanticException
- If the value cannot be cleared.public abstract void setValue(java.lang.Object value) throws SemanticException
null
, then the value is cleared.
value
- The new value.
SemanticException
- If the value is not valid for the property or member.setIntValue(int)
,
setStringValue(java.lang.String)
,
setFloatValue(double)
,
setNumberValue(java.math.BigDecimal)
,
clearValue()
public abstract void removeItem(int posn) throws PropertyValueException
posn
- The position of the item to remove.
PropertyValueException
- If the property is not a list property.
java.lang.IndexOutOfBoundsException
- if the given posn
is out of range
(index < 0 || index >= list.size())
.public final void removeItem(java.lang.Object item) throws PropertyValueException
StructureHandle
or Structure
.DesignElementHandle
or IDesignElement
.
item
- the item to remove
PropertyValueException
- If the property is not a list property, or if the given item
is not contained in the list.public void removeItems(java.util.List items) throws PropertyValueException
StructureHandle
items
- the item list to remove
PropertyValueException
- If the property or the member is not a list type, or if any
item in the list is not foundpublic void replaceItem(IStructure oldItem, IStructure newItem) throws SemanticException
oldItem
- the old item to be replaced.newItem
- the new item.
SemanticException
- if the property/member does not contain the list value or the
new structure is invalid or the old structure is not
contained in the list.public StructureHandle addItem(IStructure item) throws SemanticException
item
- The new item to add.
SemanticException
- If the property is not a list property, or if the the value
of the item is incorrect.public abstract void addItem(java.lang.Object item) throws SemanticException
item
- The new item to add.
SemanticException
- If the property is not a list property, or if the the value
of the item is incorrect.public StructureHandle insertItem(IStructure item, int posn) throws SemanticException
item
- The new item to insert.posn
- The insert position.
SemanticException
- If the property is not a list property, or if the the value
of the item is incorrect.
java.lang.IndexOutOfBoundsException
- if the given posn
is out of range
(index < 0 || index > list.size())
.public void moveItem(int from, int to) throws PropertyValueException
from
- The current position of the item to moveto
- The new position of the item to move.
PropertyValueException
- If the property is not a list property.
java.lang.IndexOutOfBoundsException
- if the given from or to index is out of range
(index < 0 || index >= list.size())
.public IChoice[] getChoices()
null
, if this property has no choice.Choice
protected boolean isList()
true
if the handle is working on a list property,
otherwise return false
public java.lang.String getDefaultUnit()
public abstract boolean isVisible()
true
if it is visible. Otherwise false
.public abstract boolean isReadOnly()
true
if it is read-only. Otherwise
false
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |