Class CopyUtil
java.lang.Object
org.eclipse.birt.report.model.api.util.CopyUtil
The utility class for copy/paste. It is for the UI usage. Other uses should
use
DesignElementHandle.copy()
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic IPasteStatus
canPaste
(IElementCopy copy, DesignElementHandle container, int slotID) /** Checks whether the given copy can be pasted into the given slot of the specified element.static IPasteStatus
canPaste
(IElementCopy copy, DesignElementHandle container, String propName) /** Checks whether the given copy can be pasted into the given slot of the specified element.static IElementCopy
copy
(DesignElementHandle source) Returns the copy of the current element.static List
paste
(IElementCopy copy, DesignElementHandle container, int slotID) Pastes a report item to the slot.static List
paste
(IElementCopy copy, DesignElementHandle container, int slotID, int newPos) Pastes a report item to the slot.static List
paste
(IElementCopy copy, DesignElementHandle container, String propName) Pastes a report item to the slot.static List
paste
(IElementCopy copy, DesignElementHandle container, String propName, int newPos) Pastes a report item to the slot.
-
Constructor Details
-
CopyUtil
public CopyUtil()
-
-
Method Details
-
copy
Returns the copy of the current element.- Parameters:
source
- the given element- Returns:
- the copy of the given element
-
paste
public static 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 ofcopy
container
- the target containerslotID
- 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 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 ofcopy
container
- the target containerslotID
- the id of the target slotnewPos
- 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 List paste(IElementCopy copy, DesignElementHandle container, 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 ofcopy
container
- the target containerpropName
- 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 List paste(IElementCopy copy, DesignElementHandle container, 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 ofcopy
container
- the target containerpropName
- the property name of the target containernewPos
- 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
/** Checks whether the given copy can be pasted into the given slot of the specified element.- Parameters:
copy
- the copied instancecontainer
- the target elementslotID
- the target slot id- Returns:
true
is the copy is good for pasting. Otherwisefalse
.
-
canPaste
public static IPasteStatus canPaste(IElementCopy copy, DesignElementHandle container, String propName) /** Checks whether the given copy can be pasted into the given slot of the specified element.- Parameters:
copy
- the copied instancecontainer
- the target elementpropName
- the target property name- Returns:
true
is the copy is good for pasting. Otherwisefalse
.
-