Class UserPropertyDefn
java.lang.Object
org.eclipse.birt.report.model.metadata.PropertyDefn
org.eclipse.birt.report.model.metadata.ElementPropertyDefn
org.eclipse.birt.report.model.api.core.UserPropertyDefn
- All Implemented Interfaces:
Cloneable
,IStructure
,IElementPropertyDefn
,IPropertyDefn
,org.eclipse.birt.report.model.core.IPropertySet
,org.eclipse.birt.report.model.metadata.IContainerDefn
,org.eclipse.birt.report.model.validators.ISemanticTriggerDefnSetProvider
public final class UserPropertyDefn
extends org.eclipse.birt.report.model.metadata.ElementPropertyDefn
implements IStructure
Represents a user-defined property. User-defined properties are created by
the user and reside on elements. If element E has a user-defined property,
and element C extends E, then element C also has all the user-defined
properties defined on element E.
The user property definition implements the IStructure
interface
so that it can be accessed generically, and changes can be done though the
command mechanism to allow undo/redo of style changes.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Name of the choices member.static final String
Name of the default member.static final String
Name of the display name ID member.static final String
Name of the display name member.static final String
Name of the isVisible member.static final String
Name of the name member.static final String
Name of the structure itself.static final String
Name of the type member.Fields inherited from class org.eclipse.birt.report.model.metadata.ElementPropertyDefn
groupNameKey, isInheritable, useOwnSearch
Fields inherited from class org.eclipse.birt.report.model.metadata.PropertyDefn
allowedChoices, allowedUnits, allowExpression, context, defaultUnit, defaultValue, definedBy, details, displayNameID, expressionType, intrinsic, isEncryptable, isList, messages, name, nameConfig, returnType, runtimeSettable, since, subType, triggers, trimOption, type, valueRequired, valueValidator
Fields inherited from interface org.eclipse.birt.report.model.api.metadata.IPropertyDefn
COMMERCIAL_PROPERTY, EXTENSION_MODEL_PROPERTY, EXTENSION_PROPERTY, ODA_PROPERTY, SYSTEM_PROPERTY, USER_PROPERTY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
build()
Builds the semantic information for this property.void
checkUserPropertyDefn
(org.eclipse.birt.report.model.core.Module module, org.eclipse.birt.report.model.core.DesignElement element) Checks whether the element can take the given user property definition and the definition is valid.copy()
Makes a copy of this user property definition.static List<IPropertyType>
Gets valid types for user property.getDefn()
Gets the definition of the structure which represents the user property definition.Gets the display name of this user property definition.getLocalProperty
(org.eclipse.birt.report.model.core.Module module, org.eclipse.birt.report.model.metadata.PropertyDefn propDefn) Gets the locale value of a property.User-defined methods are not supported.Gets the object definition of the user property definition.getProperty
(org.eclipse.birt.report.model.core.Module module, String memberName) Gets the locale value of a property.getProperty
(org.eclipse.birt.report.model.core.Module module, org.eclipse.birt.report.model.metadata.PropertyDefn prop) Gets the value of property by the given property definition.Returns the structure definition for this value.Gets the name predefined for this structure.int
Gets the property type.boolean
Justifies whether the structure is generated in design time or not.boolean
Justifies whether the structure can be referred by other design elements.boolean
Checks whether the property is visible to the property sheet.void
setChoices
(UserChoice[] choiceArray) Sets the (anonymous) set of choices for a property.void
setDefault
(Object value) Sets the default value for the property.void
setDisplayName
(String theName) Sets the display name of the property.void
setProperty
(org.eclipse.birt.report.model.metadata.PropertyDefn prop, Object value) Sets the value for the given property definition.void
setType
(org.eclipse.birt.report.model.metadata.PropertyType typeDefn) Sets the property type.void
setVisible
(boolean isVisible) Sets whether the property is visible to the property sheet.protected String
validateExtendedChoicesByDisplayName
(org.eclipse.birt.report.model.core.Module module, String displayName) Checks whetherdisplayName
matches any items in the choice set for an extended choice property type on a user defined choice set.Methods inherited from class org.eclipse.birt.report.model.metadata.ElementPropertyDefn
canInherit, enableContextSearch, getGroupName, getGroupNameKey, hasOwnModel, isEditable, isReadOnly, isStyleProperty
Methods inherited from class org.eclipse.birt.report.model.metadata.PropertyDefn
allowExpression, buildDefn, buildTriggerDefnSet, buildTrimOption, canContain, canContain, definedBy, doValidateValueWithExpression, getAllowedChoices, getAllowedElements, getAllowedElements, getAllowedUnits, getBooleanValue, getChoices, getCompatibleTypeAndValue, getContext, getDefault, getDefaultUnit, getDetails, getDisplayNameID, getDisplayValue, getFloatValue, getIntValue, getMessages, getName, getNameConfig, getNumberValue, getReturnType, getSince, getStringValue, getSubType, getSubTypeCode, getTargetElementType, getTriggerDefnSet, getType, getTypeCode, getXmlValue, hasChoices, isElementType, isEncryptable, isExtended, isIntrinsic, isList, isListType, isRuntimeSettable, isStructureMember, isSupportedSubType, isSystemProperty, isUserProperty, isValueRequired, setContext, setDetails, setDisplayNameID, setIsList, setMessages, setName, setNameConfig, setOwner, setReturnType, setRuntimeSettable, setSince, setTrimOption, toString, validateValue, validateXml
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.eclipse.birt.report.model.metadata.IContainerDefn
canContain, canContain, getAllowedElements, getAllowedElements, getName, getNameConfig
Methods inherited from interface org.eclipse.birt.report.model.api.metadata.IPropertyDefn
allowExpression, getAllowedChoices, getAllowedUnits, getChoices, getContext, getDefault, getDisplayNameID, getTargetElementType, getTypeCode, hasChoices, isEncryptable, isList
-
Field Details
-
TYPE_MEMBER
Name of the type member.- See Also:
-
NAME_MEMBER
Name of the name member.- See Also:
-
ISVISIBLE_MEMBER
Name of the isVisible member.- See Also:
-
DEFAULT_MEMBER
Name of the default member.- See Also:
-
DISPLAY_NAME_MEMBER
Name of the display name member.- See Also:
-
DISPLAY_NAME_ID_MEMBER
Name of the display name ID member.- See Also:
-
STRUCTURE_NAME
Name of the structure itself. This is the name used to identify the structure in the meta-data dictionary.- See Also:
-
CHOICES_MEMBER
Name of the choices member.- See Also:
-
-
Constructor Details
-
UserPropertyDefn
public UserPropertyDefn()Default constructor.
-
-
Method Details
-
getAllowedTypes
Gets valid types for user property. Each one in the list is an instance ofIPropertyType
.- Returns:
- the list of allowed property types for user property.
-
getProperty
public Object getProperty(org.eclipse.birt.report.model.core.Module module, org.eclipse.birt.report.model.metadata.PropertyDefn prop) Gets the value of property by the given property definition.- Specified by:
getProperty
in interfaceorg.eclipse.birt.report.model.core.IPropertySet
- Parameters:
module
- the moduleprop
- definition of the property to get- Returns:
- value of the property.
-
setProperty
Sets the value for the given property definition.- Specified by:
setProperty
in interfaceorg.eclipse.birt.report.model.core.IPropertySet
- Parameters:
prop
- definition of the property to setvalue
- value to set
-
getStructName
Gets the name predefined for this structure.- Specified by:
getStructName
in interfaceIStructure
- Returns:
- structure name "UserProperty".
-
getValueType
public int getValueType()Gets the property type.- Specified by:
getValueType
in interfaceIPropertyDefn
- Specified by:
getValueType
in classorg.eclipse.birt.report.model.metadata.PropertyDefn
- Returns:
- integer represented user property type.
-
copy
Makes a copy of this user property definition.- Specified by:
copy
in interfaceIStructure
- Returns:
- IStructure of this property definition, or null if this property definition can not be cloned.
-
getDefn
Gets the definition of the structure which represents the user property definition.- Specified by:
getDefn
in interfaceIStructure
- Returns:
- structure definition.
-
getObjectDefn
Gets the object definition of the user property definition.- Specified by:
getObjectDefn
in interfaceorg.eclipse.birt.report.model.core.IPropertySet
- Returns:
- object definition.
-
getDisplayName
Gets the display name of this user property definition. The search will check the translation dictionary firstly, then look at the instance itself. If no display name defined, the XML name will be returned.- Specified by:
getDisplayName
in interfaceorg.eclipse.birt.report.model.metadata.IContainerDefn
- Overrides:
getDisplayName
in classorg.eclipse.birt.report.model.metadata.PropertyDefn
- Returns:
- display name of this user property.
-
setDisplayName
Sets the display name of the property. Use this only for testing; you should normally set the display name message ID so that the name can be retrieved from a message catalog and localized.- Parameters:
theName
- the display name to set
-
setChoices
Sets the (anonymous) set of choices for a property. The choices are stored here directly, they are not named and stored in the data dictionary as are choices for system properties.- Parameters:
choiceArray
- choice array to be set.
-
validateExtendedChoicesByDisplayName
protected String validateExtendedChoicesByDisplayName(org.eclipse.birt.report.model.core.Module module, String displayName) Checks whetherdisplayName
matches any items in the choice set for an extended choice property type on a user defined choice set. IfdisplayName
exists in the choice set, return the name of this choice. Otherwise, returnnull
.- Overrides:
validateExtendedChoicesByDisplayName
in classorg.eclipse.birt.report.model.metadata.PropertyDefn
- Parameters:
module
- the moduledisplayName
- the candidate display name- Returns:
- the choice name if found. Otherwise, return
null
.
-
getStructDefn
Description copied from class:org.eclipse.birt.report.model.metadata.PropertyDefn
Returns the structure definition for this value.- Specified by:
getStructDefn
in interfaceIPropertyDefn
- Overrides:
getStructDefn
in classorg.eclipse.birt.report.model.metadata.PropertyDefn
- Returns:
- the structure definition, or null if this value is not a list of structures
-
getMethodInfo
User-defined methods are not supported.- Specified by:
getMethodInfo
in interfaceIElementPropertyDefn
- Overrides:
getMethodInfo
in classorg.eclipse.birt.report.model.metadata.ElementPropertyDefn
- Returns:
null
-
setType
public void setType(org.eclipse.birt.report.model.metadata.PropertyType typeDefn) Sets the property type.- Overrides:
setType
in classorg.eclipse.birt.report.model.metadata.PropertyDefn
- Parameters:
typeDefn
- the property type
-
checkUserPropertyDefn
public void checkUserPropertyDefn(org.eclipse.birt.report.model.core.Module module, org.eclipse.birt.report.model.core.DesignElement element) throws UserPropertyException, org.eclipse.birt.report.model.metadata.MetaDataException Checks whether the element can take the given user property definition and the definition is valid.- Parameters:
module
- the moduleelement
- the design element that holds the user-defined property- Throws:
UserPropertyException
- if the element is not allowed to have user property or the user property definition is invalid.org.eclipse.birt.report.model.metadata.MetaDataException
- if the user property definition is inconsistent.
-
getLocalProperty
public Object getLocalProperty(org.eclipse.birt.report.model.core.Module module, org.eclipse.birt.report.model.metadata.PropertyDefn propDefn) Description copied from interface:IStructure
Gets the locale value of a property.- Specified by:
getLocalProperty
in interfaceIStructure
- Parameters:
module
- the modulepropDefn
- definition of the property to get- Returns:
- value of the item as an object, or null if the item is not set locally or is not found.
-
getProperty
Description copied from interface:IStructure
Gets the locale value of a property.- Specified by:
getProperty
in interfaceIStructure
- Parameters:
module
- the modulememberName
- the name of the property definition- Returns:
- value of the item as an object, or null if the item is not set locally or is not found.
-
isReferencable
public boolean isReferencable()Description copied from interface:IStructure
Justifies whether the structure can be referred by other design elements.- Specified by:
isReferencable
in interfaceIStructure
- Returns:
- true if the structure is referencable, otherwise false
-
setDefault
Description copied from class:org.eclipse.birt.report.model.metadata.PropertyDefn
Sets the default value for the property.- Overrides:
setDefault
in classorg.eclipse.birt.report.model.metadata.PropertyDefn
- Parameters:
value
- The default value to set.
-
build
public void build() throws org.eclipse.birt.report.model.metadata.MetaDataExceptionDescription copied from class:org.eclipse.birt.report.model.metadata.ElementPropertyDefn
Builds the semantic information for this property. Called once while loading the meta-data. The build must succeed, or a programming error has occurred.- Overrides:
build
in classorg.eclipse.birt.report.model.metadata.ElementPropertyDefn
- Throws:
org.eclipse.birt.report.model.metadata.MetaDataException
- if the build is failed
-
isDesignTime
public boolean isDesignTime()Description copied from interface:IStructure
Justifies whether the structure is generated in design time or not.- Specified by:
isDesignTime
in interfaceIStructure
- Returns:
if the structure is generated in design time, otherwise return .
-
isVisible
public boolean isVisible()Checks whether the property is visible to the property sheet.- Specified by:
isVisible
in interfaceIElementPropertyDefn
- Overrides:
isVisible
in classorg.eclipse.birt.report.model.metadata.ElementPropertyDefn
- Returns:
true
if property is visible.
-
setVisible
public void setVisible(boolean isVisible) Sets whether the property is visible to the property sheet.- Parameters:
isVisible
-
-