I

IClipboardHelper

This interface can be used to customize the clipboard behavior for individual IModelItems.
Inheritance Hierarchy

Remarks

Implementations of this interface can decorate the lookup method of IModelItems to change their behavior during clipboard actions.

Examples

The easiest way to decorate certain model items with a custom IClipboardHelper implementation is via the various decorators available on GraphDecorator:
Using GraphDecorator to attach a custom IClipboardHelper to nodes
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

No filters for this type

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.

abstract

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.

abstract

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.
If the graph is a managed view, both original and duplicate are master items.
abstract

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.

abstract

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.
If the source graph is a managed folding view, the item is always a view item.
abstract

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.
If the source graph is a managed folding view, the item is always a view item.
abstract

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.
If the graph is a managed folding view, the item is always a view item.
abstract

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.
The item is always a master item since the clipboard graph is not a managed folding view.
abstract

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

Static Methods

static

Parameters

Return Value

IClipboardHelper