This interface can be used to customize the clipboard behavior for individual IModelItems.
Remarks
Examples
Related Programming Samples
- Clipboard
- Shows different ways of using the class GraphClipboard for Copy & Paste operations.
Type Details
- yfiles module
- view-component
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.graph.IClipboardHelper
See Also
Methods
This method is called during the copy operation of the given item to retrieve additional state that can be later used during a paste operation.
Remarks
item
is always a master item.Parameters
A map of options to pass to the method.
- context - IGraphClipboardContext
- The context in which this interface is used, can be
null
- item - IModelItem
- The item to copy to the clipboard.
Returns
- ↪any
- A custom user object that will later be provided to paste.
See Also
This method is called during the cut operation of the given item to retrieve additional state that can be later used during a paste operation.
Remarks
item
is always a master item.Parameters
A map of options to pass to the method.
- context - IGraphClipboardContext
- The context in which this interface is used, can be
null
- item - IModelItem
- The item to cut to the clipboard.
Returns
- ↪any
- A custom user object that will later be provided to paste.
See Also
This method is called after the item has been pasted from the clipboard.
Remarks
item
is always a master item since the clipboard graph is not a managed folding view.Parameters
A map of options to pass to the method.
- context - IGraphClipboardContext
- The context in which this interface is used, can be
null
- item - IModelItem
- The item that has been created during the paste operation.
- userData - Object
See Also
Determines whether the given item can or should be copied to the clipboard.
Remarks
item
is always a view item. Furthermore, if collapsed nodes are to be copied, this method will be queried with the collapsed group node as item
for each "hidden" node that is currently not visible.Parameters
A map of options to pass to the method.
- context - IGraphClipboardContext
- The context in which this interface is used, can be
null
- item - IModelItem
- The item in question.
Returns
- ↪boolean
- Whether this item should be copied.
See Also
Determines whether the given item can or should be cut to the clipboard.
Remarks
item
is always a view item. Furthermore, if collapsed nodes are to be cut, this method will be queried with the collapsed group node as item
for each "hidden" node that is currently not visible.Parameters
A map of options to pass to the method.
- context - IGraphClipboardContext
- The context in which this interface is used, can be
null
- item - IModelItem
- The item in question.
Returns
- ↪boolean
- Whether this item should be cut.
See Also
Determines whether the given item can or should be pasted from the clipboard to the target graph.
Remarks
item
is always a master item since the clipboard graph is not a managed folding view.Parameters
A map of options to pass to the method.
- context - IGraphClipboardContext
- The context in which this interface is used, can be
null
- item - IModelItem
- The item in the clipboard graph.
- userData - Object
Returns
- ↪boolean
- Whether this item should be pasted.
See Also
Static Methods
Creates an implementation of the interface IClipboardHelper from the given definition.
Remarks
Parameters
A map of options to pass to the method.
- shouldCopy - function(IGraphClipboardContext, IModelItem):boolean
Determines whether the given item can or should be copied to the clipboard.
This property holds the implementation for shouldCopy.
- shouldCut - function(IGraphClipboardContext, IModelItem):boolean
Determines whether the given item can or should be cut to the clipboard.
This property holds the implementation for shouldCut.
- shouldPaste - function(IGraphClipboardContext, IModelItem, any):boolean
Determines whether the given item can or should be pasted from the clipboard to the target graph.
This property holds the implementation for shouldPaste.
- copy - function(IGraphClipboardContext, IModelItem):any
- cut - function(IGraphClipboardContext, IModelItem):any
- paste - function(IGraphClipboardContext, IModelItem, any):void
This method is called after the item has been pasted from the clipboard.
This property holds the implementation for paste.
Returns
- ↪IClipboardHelper
- An instance of the IClipboardHelper interface based on the given definition.