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 StringName of the choices member.static final StringName of the default member.static final StringName of the display name ID member.static final StringName of the display name member.static final StringName of the isVisible member.static final StringName of the name member.static final StringName of the structure itself.static final StringName of the type member.Fields inherited from class org.eclipse.birt.report.model.metadata.ElementPropertyDefn
groupNameKey, isInheritable, useOwnSearchFields 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, valueValidatorFields 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 TypeMethodDescriptionvoidbuild()Builds the semantic information for this property.voidcheckUserPropertyDefn(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.intGets the property type.booleanJustifies whether the structure is generated in design time or not.booleanJustifies whether the structure can be referred by other design elements.booleanChecks whether the property is visible to the property sheet.voidsetChoices(UserChoice[] choiceArray) Sets the (anonymous) set of choices for a property.voidsetDefault(Object value) Sets the default value for the property.voidsetDisplayName(String theName) Sets the display name of the property.voidsetProperty(org.eclipse.birt.report.model.metadata.PropertyDefn prop, Object value) Sets the value for the given property definition.voidsetType(org.eclipse.birt.report.model.metadata.PropertyType typeDefn) Sets the property type.voidsetVisible(boolean isVisible) Sets whether the property is visible to the property sheet.protected StringvalidateExtendedChoicesByDisplayName(org.eclipse.birt.report.model.core.Module module, String displayName) Checks whetherdisplayNamematches 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, isStylePropertyMethods 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, validateXmlMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.birt.report.model.metadata.IContainerDefn
canContain, canContain, getAllowedElements, getAllowedElements, getName, getNameConfigMethods 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:
getPropertyin 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:
setPropertyin 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:
getStructNamein interfaceIStructure- Returns:
- structure name "UserProperty".
-
getValueType
public int getValueType()Gets the property type.- Specified by:
getValueTypein interfaceIPropertyDefn- Specified by:
getValueTypein classorg.eclipse.birt.report.model.metadata.PropertyDefn- Returns:
- integer represented user property type.
-
copy
Makes a copy of this user property definition.- Specified by:
copyin 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:
getDefnin interfaceIStructure- Returns:
- structure definition.
-
getObjectDefn
Gets the object definition of the user property definition.- Specified by:
getObjectDefnin 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:
getDisplayNamein interfaceorg.eclipse.birt.report.model.metadata.IContainerDefn- Overrides:
getDisplayNamein 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 whetherdisplayNamematches any items in the choice set for an extended choice property type on a user defined choice set. IfdisplayNameexists in the choice set, return the name of this choice. Otherwise, returnnull.- Overrides:
validateExtendedChoicesByDisplayNamein 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.PropertyDefnReturns the structure definition for this value.- Specified by:
getStructDefnin interfaceIPropertyDefn- Overrides:
getStructDefnin 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:
getMethodInfoin interfaceIElementPropertyDefn- Overrides:
getMethodInfoin 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:
setTypein 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:IStructureGets the locale value of a property.- Specified by:
getLocalPropertyin 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:IStructureGets the locale value of a property.- Specified by:
getPropertyin 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:IStructureJustifies whether the structure can be referred by other design elements.- Specified by:
isReferencablein interfaceIStructure- Returns:
- true if the structure is referencable, otherwise false
-
setDefault
Description copied from class:org.eclipse.birt.report.model.metadata.PropertyDefnSets the default value for the property.- Overrides:
setDefaultin 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.ElementPropertyDefnBuilds the semantic information for this property. Called once while loading the meta-data. The build must succeed, or a programming error has occurred.- Overrides:
buildin 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:IStructureJustifies whether the structure is generated in design time or not.- Specified by:
isDesignTimein 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:
isVisiblein interfaceIElementPropertyDefn- Overrides:
isVisiblein classorg.eclipse.birt.report.model.metadata.ElementPropertyDefn- Returns:
trueif property is visible.
-
setVisible
public void setVisible(boolean isVisible) Sets whether the property is visible to the property sheet.- Parameters:
isVisible-
-