Class ExtendedItemHandle

  • All Implemented Interfaces:
    IReportItemMethodContext, org.eclipse.birt.report.model.elements.interfaces.IDesignElementModel, org.eclipse.birt.report.model.elements.interfaces.IExtendedItemModel, org.eclipse.birt.report.model.elements.interfaces.IInternalReportItemModel, org.eclipse.birt.report.model.elements.interfaces.IReportItemModel, org.eclipse.birt.report.model.elements.interfaces.IStyledElementModel

    public class ExtendedItemHandle
    extends ReportItemHandle
    implements org.eclipse.birt.report.model.elements.interfaces.IExtendedItemModel, IReportItemMethodContext
    Represents an extended element. An extended item represents a custom element added by the application. Extended items can use user-defined properties, can use scripts, or a combination of the two. Extended items often require user-defined properties.

    An extended element has a plug-in property that is a name of a Java class that implements the behavior for the element.

    See Also:
    ExtendedItem
    • Constructor Detail

      • ExtendedItemHandle

        public ExtendedItemHandle​(org.eclipse.birt.report.model.core.Module module,
                                  org.eclipse.birt.report.model.core.DesignElement element)
        Constructs the handle with the report design and the element it holds. The application generally does not create handles directly. Instead, it uses one of the navigation methods available on other element handles.
        Parameters:
        module - the module
        element - the model representation of the element
    • Method Detail

      • getExtensionName

        public java.lang.String getExtensionName()
        Returns the extension name defined by the extended item.
        Returns:
        the extension name as a string
      • loadExtendedElement

        public void loadExtendedElement()
                                 throws ExtendedElementException
        Loads the instance of extended element. When the application invokes UI for the extended element, such as listing property values in property sheet, set the value of the extension-defined properties and so other operations, the application must create an instance of the extension element first. The created extended element reads its information cached by the handle and de-serialize the extension model.
        Throws:
        ExtendedElementException - if the serialized model is invalid
      • getExtensionPropertyDefinitionList

        public java.util.List getExtensionPropertyDefinitionList()
        Returns the list of extension property definition. All these properties are just those defined in extension plugin.
        Returns:
        the list of extension property definition.
      • getMethods

        public java.util.List getMethods()
        Returns the methods defined on the extension element definition and the methods defined within the extension model property inside.
        Overrides:
        getMethods in class DesignElementHandle
        Returns:
        the list of methods
      • filtersIterator

        public java.util.Iterator filtersIterator()
        Returns an iterator over filter. The iterator returns instances of FilterConditionHandle that represents filter condition object.
        Returns:
        iterator over filters.
        See Also:
        FilterCondition
      • getExternalScript

        public java.lang.String getExternalScript()
        Returns the external script defined in the extended element model.
        Returns:
        the script
      • setExternalScript

        public void setExternalScript​(java.lang.String theScript)
                               throws SemanticException
        Sets the scripts in the extension element model.
        Parameters:
        theScript - the script to be set
        Throws:
        SemanticException - if fail to set the scripts
      • getAltText

        public java.lang.String getAltText()
        Returns the alternate text of this extended item.
        Returns:
        the alternate text of the extended item.
      • getAltTextKey

        public java.lang.String getAltTextKey()
        Returns the resource key of the alternate text of this extended item.
        Overrides:
        getAltTextKey in class ReportItemHandleImpl
        Returns:
        the resource key of the alternate text
      • setAltText

        public void setAltText​(java.lang.String altText)
                        throws SemanticException
        Sets the alt text of this extended item.
        Parameters:
        altText - the alt text
        Throws:
        SemanticException - if the property is locked.
      • getMethods

        public java.util.List getMethods​(java.lang.String context)
        Returns functions that can be called in the given method.
        Overrides:
        getMethods in class ReportItemHandleImpl
        Parameters:
        context - the method name in string
        Returns:
        a list containing IMethodInfo for functions
      • getUndefinedProperties

        public java.util.Map<java.lang.String,​UndefinedPropertyInfo> getUndefinedProperties()
        Gets the map of all name/value pair. The property in the map is either set an invalid value or the definition is not found. Key is the name of the property and value is instance of UndefinedPropertyInfo.
        Returns:
        map of invalid property value or undefined property
      • getIllegalContents

        public java.util.Map<java.lang.String,​java.util.List<IllegalContentInfo>> getIllegalContents()
        Gets all the illegal contents. The key is the property name where the contents reside. The value is the list of item that are illegal to be inserted. Each item in the list is instance of IllegalContentInfo.
        Returns:
      • getExtensionVersion

        public java.lang.String getExtensionVersion()
        Gets the extension version of this element.
        Returns:
        extension version of this element
      • setExtensionVersion

        public void setExtensionVersion​(java.lang.String extensionVersion)
                                 throws SemanticException
        Sets the extension version of this element.
        Parameters:
        extensionVersion -
        Throws:
        SemanticException
      • makeUniqueName

        public void makeUniqueName​(java.lang.String namePrefix)
                            throws NameException
        Makes a unique name for this element with the given name prefix.
        Parameters:
        namePrefix - the name prefix
        Throws:
        NameException