Class TemplateElementHandle

All Implemented Interfaces:
org.eclipse.birt.report.model.elements.interfaces.IDesignElementModel
Direct Known Subclasses:
TemplateDataSetHandle, TemplateReportItemHandle

public abstract class TemplateElementHandle extends ReportElementHandle
Abstract handle for template elements. A template element is a place holder to generate a real report item or data set element. Application reads the default element of it by method getDefaultElement() and clone a new report item or data set based on the default element. Then application can make some changes about the cloned element, such as set some property values, add some contents, delete some contents. Now, application can use the cloned element with changes or with no change to transform this place holder and get a real report item or data set.
See Also:
  • Constructor Details

    • TemplateElementHandle

      public TemplateElementHandle(org.eclipse.birt.report.model.core.Module module, org.eclipse.birt.report.model.core.DesignElement element)
      Constructs the handle for a report item with the given design and element. 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 Details

    • getAllowedType

      public String getAllowedType()
      Gets allowed type of the template element.
      Returns:
      the allowed type of the template element
    • getDescription

      public String getDescription()
      Returns the static description for the template element.
      Returns:
      the static description to display
    • getDisplayDescription

      public String getDisplayDescription()
      Returns the localized description for the template element. If the localized description for the description resource key is found, it will be returned. Otherwise, the static description will be returned.
      Returns:
      the localized description for the template element
    • setDescription

      public void setDescription(String description) throws SemanticException
      Sets the description of the template element. Sets the static description itself. If the template element is to be externalized, then set the description ID separately.
      Parameters:
      description - the new description for the template element
      Throws:
      SemanticException - if the property is locked.
    • getDescriptionKey

      public String getDescriptionKey()
      Returns the resource key of the static description of the template element.
      Returns:
      the resource key of the static description
    • setDescriptionKey

      public void setDescriptionKey(String resourceKey) throws SemanticException
      Sets the resource key of the static description of the template element.
      Parameters:
      resourceKey - the resource key of the static description
      Throws:
      SemanticException - if the property is locked.
    • getDefaultElement

      public DesignElementHandle getDefaultElement()
      Gets the default element of this template element.
      Returns:
      the default element of this template element
    • copyDefaultElement

      public IDesignElement copyDefaultElement()
      Returns a copy for the default element in the template element.
      Returns:
      a clone element of the default element