Class Section

    • Constructor Detail

      • Section

        protected Section()
        Default Constructor.
    • Method Detail

      • getDefaultStyleSheet

        public ElementStyleSheet getDefaultStyleSheet()
        Creates the global stylesheet for this element type. The global stylesheet is an immutable stylesheet that provides reasonable default values for some of the style keys.

        The global default stylesheet is always the last stylesheet that will be queried for values.

        Specified by:
        getDefaultStyleSheet in interface ReportElement
        Overrides:
        getDefaultStyleSheet in class Element
        Returns:
        the global stylesheet.
      • getElement

        public abstract Element getElement​(int index)
        Returns the element stored add the given index.
        Parameters:
        index - the element position within this section
        Returns:
        the element
        Throws:
        IndexOutOfBoundsException - if the index is invalid.
      • getElementCount

        public abstract int getElementCount()
        Returns the number of elements in this section.
        Returns:
        the number of elements of this section.
      • unregisterParent

        protected boolean unregisterParent​(Element element)
        Unregisters the given element from its parent. If the element is already a direct child of this section, this operation does nothing and returns 'true' to indicate that all the work is already done.

        This is a helper function and not meant to be used by the grand public.

        Parameters:
        element - the element to be unregistered from its current parent.
        Returns:
        true, if the element is a child of this section, false otherwise.
      • validateLooping

        protected void validateLooping​(Element element)
        Checks whether the element given is a parent of this section. Adding that element to the section would cause infinite loops later, so we prevent it early in the game.
        Parameters:
        element - the element to be checked for loops.
      • setElementAt

        public abstract void setElementAt​(int position,
                                          Element element)
      • removeElement

        protected abstract void removeElement​(Element element)
        Removes an element from the section.
        Parameters:
        element - the element to be section.
        Throws:
        NullPointerException - if the given element is null.
      • unregisterAsChild

        protected void unregisterAsChild​(Element element)
      • registerAsChild

        protected void registerAsChild​(Element element)
      • derive

        public Section derive​(boolean preserveElementInstanceIds)
        Description copied from class: Element
        Creates a deep copy of this element and regenerates all instance-ids.
        Overrides:
        derive in class Element
        Parameters:
        preserveElementInstanceIds - defines whether this call generates new instance-ids for the derived elements. Instance-IDs are used by the report processor to recognize reoccurring elements and must not changed within the report run. Outside of the report processors new instance ids should be generated at all times to separate instances and to make them uniquely identifiable.
        Returns:
        the copy of the element.
      • clone

        public Section clone()
        Description copied from class: Element
        Clones this Element, the datasource and the private stylesheet of this Element. The clone does no longer have a parent, as the old parent would not recognize that new object anymore.
        Specified by:
        clone in interface DataTarget
        Overrides:
        clone in class Element
        Returns:
        a clone of this Element.