Class CopyUtil


  • public class CopyUtil
    extends java.lang.Object
    The utility class for copy/paste. It is for the UI usage. Other uses should use DesignElementHandle.copy().
    • Constructor Detail

      • CopyUtil

        public CopyUtil()
    • Method Detail

      • copy

        public static IElementCopy copy​(DesignElementHandle source)
        Returns the copy of the current element.
        Parameters:
        source - the given element
        Returns:
        the copy of the given element
      • paste

        public static java.util.List paste​(IElementCopy copy,
                                           DesignElementHandle container,
                                           int slotID)
                                    throws SemanticException
        Pastes a report item to the slot. The item must be newly created and not yet added to the design.
        Parameters:
        copy - the copy from the return value of copy
        container - the target container
        slotID - the id of the target slot
        Returns:
        a list containing all errors for the pasted element
        Throws:
        SemanticException - if the element is not allowed in the slot
      • paste

        public static java.util.List paste​(IElementCopy copy,
                                           DesignElementHandle container,
                                           int slotID,
                                           int newPos)
                                    throws SemanticException
        Pastes a report item to the slot. The item must be newly created and not yet added to the design.
        Parameters:
        copy - the copy from the return value of copy
        container - the target container
        slotID - the id of the target slot
        newPos - the target position
        Returns:
        a list containing all errors for the pasted element
        Throws:
        SemanticException - if the element is not allowed in the slot
      • paste

        public static java.util.List paste​(IElementCopy copy,
                                           DesignElementHandle container,
                                           java.lang.String propName)
                                    throws SemanticException
        Pastes a report item to the slot. The item must be newly created and not yet added to the design.
        Parameters:
        copy - the copy from the return value of copy
        container - the target container
        propName - the property name of the target container
        Returns:
        a list containing all errors for the pasted element
        Throws:
        SemanticException - if the element is not allowed in the slot
      • paste

        public static java.util.List paste​(IElementCopy copy,
                                           DesignElementHandle container,
                                           java.lang.String propName,
                                           int newPos)
                                    throws SemanticException
        Pastes a report item to the slot. The item must be newly created and not yet added to the design.
        Parameters:
        copy - the copy from the return value of copy
        container - the target container
        propName - the property name of the target container
        newPos - the target position
        Returns:
        a list containing all errors for the pasted element
        Throws:
        SemanticException - if the element is not allowed in the slot
      • canPaste

        public static IPasteStatus canPaste​(IElementCopy copy,
                                            DesignElementHandle container,
                                            int slotID)
        /** Checks whether the given copy can be pasted into the given slot of the specified element.
        Parameters:
        copy - the copied instance
        container - the target element
        slotID - the target slot id
        Returns:
        true is the copy is good for pasting. Otherwise false.
      • canPaste

        public static IPasteStatus canPaste​(IElementCopy copy,
                                            DesignElementHandle container,
                                            java.lang.String propName)
        /** Checks whether the given copy can be pasted into the given slot of the specified element.
        Parameters:
        copy - the copied instance
        container - the target element
        propName - the target property name
        Returns:
        true is the copy is good for pasting. Otherwise false.