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:
java.lang.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
IStructureinterface 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
Fields Modifier and Type Field Description static java.lang.StringCHOICES_MEMBERName of the choices member.static java.lang.StringDEFAULT_MEMBERName of the default member.static java.lang.StringDISPLAY_NAME_ID_MEMBERName of the display name ID member.static java.lang.StringDISPLAY_NAME_MEMBERName of the display name member.static java.lang.StringISVISIBLE_MEMBERName of the isVisible member.static java.lang.StringNAME_MEMBERName of the name member.static java.lang.StringSTRUCTURE_NAMEName of the structure itself.static java.lang.StringTYPE_MEMBERName 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 Constructor Description UserPropertyDefn()Default constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbuild()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.IStructurecopy()Makes a copy of this user property definition.static java.util.List<IPropertyType>getAllowedTypes()Gets valid types for user property.IStructureDefngetDefn()Gets the definition of the structure which represents the user property definition.java.lang.StringgetDisplayName()Gets the display name of this user property definition.java.lang.ObjectgetLocalProperty(org.eclipse.birt.report.model.core.Module module, org.eclipse.birt.report.model.metadata.PropertyDefn propDefn)Gets the locale value of a property.IMethodInfogetMethodInfo()User-defined methods are not supported.IObjectDefngetObjectDefn()Gets the object definition of the user property definition.java.lang.ObjectgetProperty(org.eclipse.birt.report.model.core.Module module, java.lang.String memberName)Gets the locale value of a property.java.lang.ObjectgetProperty(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.IStructureDefngetStructDefn()Returns the structure definition for this value.java.lang.StringgetStructName()Gets the name predefined for this structure.intgetValueType()Gets the property type.booleanisDesignTime()Justifies whether the structure is generated in design time or not.booleanisReferencable()Justifies whether the structure can be referred by other design elements.booleanisVisible()Checks whether the property is visible to the property sheet.voidsetChoices(UserChoice[] choiceArray)Sets the (anonymous) set of choices for a property.voidsetDefault(java.lang.Object value)Sets the default value for the property.voidsetDisplayName(java.lang.String theName)Sets the display name of the property.voidsetProperty(org.eclipse.birt.report.model.metadata.PropertyDefn prop, java.lang.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 java.lang.StringvalidateExtendedChoicesByDisplayName(org.eclipse.birt.report.model.core.Module module, java.lang.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, 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 Detail
-
TYPE_MEMBER
public static final java.lang.String TYPE_MEMBER
Name of the type member.- See Also:
- Constant Field Values
-
NAME_MEMBER
public static final java.lang.String NAME_MEMBER
Name of the name member.- See Also:
- Constant Field Values
-
ISVISIBLE_MEMBER
public static final java.lang.String ISVISIBLE_MEMBER
Name of the isVisible member.- See Also:
- Constant Field Values
-
DEFAULT_MEMBER
public static final java.lang.String DEFAULT_MEMBER
Name of the default member.- See Also:
- Constant Field Values
-
DISPLAY_NAME_MEMBER
public static final java.lang.String DISPLAY_NAME_MEMBER
Name of the display name member.- See Also:
- Constant Field Values
-
DISPLAY_NAME_ID_MEMBER
public static final java.lang.String DISPLAY_NAME_ID_MEMBER
Name of the display name ID member.- See Also:
- Constant Field Values
-
STRUCTURE_NAME
public static final java.lang.String STRUCTURE_NAME
Name of the structure itself. This is the name used to identify the structure in the meta-data dictionary.- See Also:
- Constant Field Values
-
CHOICES_MEMBER
public static final java.lang.String CHOICES_MEMBER
Name of the choices member.- See Also:
- Constant Field Values
-
-
Method Detail
-
getAllowedTypes
public static java.util.List<IPropertyType> 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 java.lang.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
public void setProperty(org.eclipse.birt.report.model.metadata.PropertyDefn prop, java.lang.Object value)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
public java.lang.String 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
public IStructure 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
public IStructureDefn getDefn()
Gets the definition of the structure which represents the user property definition.- Specified by:
getDefnin interfaceIStructure- Returns:
- structure definition.
-
getObjectDefn
public IObjectDefn getObjectDefn()
Gets the object definition of the user property definition.- Specified by:
getObjectDefnin interfaceorg.eclipse.birt.report.model.core.IPropertySet- Returns:
- object definition.
-
getDisplayName
public java.lang.String 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
public void setDisplayName(java.lang.String theName)
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
public void setChoices(UserChoice[] choiceArray)
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 java.lang.String validateExtendedChoicesByDisplayName(org.eclipse.birt.report.model.core.Module module, java.lang.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
public IStructureDefn 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
public IMethodInfo 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.MetaDataExceptionChecks 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 java.lang.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
public java.lang.Object getProperty(org.eclipse.birt.report.model.core.Module module, java.lang.String memberName)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
public void setDefault(java.lang.Object value)
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-
-
-