Class CopyUtil
- java.lang.Object
-
- org.eclipse.birt.report.model.api.util.CopyUtil
-
public class CopyUtil extends java.lang.Object
The utility class for copy/paste. It is for the UI usage. Other uses should useDesignElementHandle.copy()
.
-
-
Constructor Summary
Constructors Constructor Description CopyUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description 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.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.static IElementCopy
copy(DesignElementHandle source)
Returns the copy of the current element.static java.util.List
paste(IElementCopy copy, DesignElementHandle container, int slotID)
Pastes a report item to the slot.static java.util.List
paste(IElementCopy copy, DesignElementHandle container, int slotID, int newPos)
Pastes a report item to the slot.static java.util.List
paste(IElementCopy copy, DesignElementHandle container, java.lang.String propName)
Pastes a report item to the slot.static java.util.List
paste(IElementCopy copy, DesignElementHandle container, java.lang.String propName, int newPos)
Pastes a report item to the slot.
-
-
-
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 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 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 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 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 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 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 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
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 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, java.lang.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
.
-
-