Remarks
Examples
const nodeDecorator = graph.decorator.nodes
// Set a custom IClipboardHelper for all nodes in the graph
nodeDecorator.clipboardHelper.addConstant(new MyClipboardHelper())See Also
Developer's Guide
Demos
- Shows different ways of using the class GraphClipboard for Copy & Paste operations.
Members
Methods
This method is called during the copy operation of the given item.
If the source graph is a managed folding view, the item is always a master item.
This instance is retained and reused during the paste operation. As a result, you can maintain state on the instance and retrieve it in a subsequent invocation of onPasted.
Parameters
- context: IGraphClipboardContext
- The context in which this interface is used.
- item: IModelItem
- The item to copy to the clipboard.
See Also
Developer's Guide
This method is called during the cut operation of the given item.
If the source graph is a managed folding view, the item is always a master item.
This instance is retained and reused during the paste operation. As a result, you can maintain state on the instance and retrieve it in a subsequent invocation of onPasted.
Parameters
- context: IGraphClipboardContext
- The context in which this interface is used.
- item: IModelItem
- The item to cut to the clipboard.
See Also
Developer's Guide
This method is called after the item has been duplicated in the graph.
original and duplicate are master items.Parameters
- context: IGraphClipboardContext
- The context in which this interface is used.
- original: IModelItem
- The original item which is duplicated.
- duplicate: IModelItem
- The duplicate of the original item.
See Also
Developer's Guide
This method is called after the item has been pasted from the clipboard.
The item is always a master item since the clipboard graph is not a managed folding view.
The instance which has been retrieved during onCopied or onCut for the original item is retained and re-used here. This allows the developer to store state in these calls and then retrieve it here to modify the pasted item.
Parameters
- context: IGraphClipboardContext
- The context in which this interface is used.
- item: IModelItem
- The item that has been created during the paste operation.
See Also
Developer's Guide
Determines whether the given item can or should be copied to the clipboard.
item is always a view item.Parameters
- context: IGraphClipboardContext
- The context in which this interface is used.
- item: IModelItem
- The item in question.
Return Value
- boolean
- Whether this item should be copied.
See Also
Developer's Guide
Determines whether the given item can or should be cut to the clipboard.
item is always a view item.Parameters
- context: IGraphClipboardContext
- The context in which this interface is used.
- item: IModelItem
- The item in question.
Return Value
- boolean
- Whether this item should be cut.
See Also
Developer's Guide
Determines whether the given item can or should be duplicated in the source graph.
item is always a view item.Parameters
- context: IGraphClipboardContext
- The context in which this interface is used.
- item: IModelItem
- The item in the source graph.
Return Value
- boolean
- Whether this item should be duplicated.
See Also
Developer's Guide
Determines whether the given item can or should be pasted from the clipboard to the target graph.
item is always a master item since the clipboard graph is not a managed folding view.Parameters
- context: IGraphClipboardContext
- The context in which this interface is used.
- item: IModelItem
- The item in the clipboard graph.
Return Value
- boolean
- Whether this item should be pasted.
See Also
Developer's Guide