Packagecom.yworks.graph.model
Interfacepublic interface IClipboardHelper

Interface that helps in clipboard actions that can be associated with each IModelItem in the context where clipboards are needed.



Public Methods
 MethodDefined By
  
copy(item:Object):Object
This method is called during the copy operation of the given item to retrieve additional state that can be later used during a operation.
IClipboardHelper
  
cut(item:Object):Object
This method is called during the cut operation of the given item to retrieve additional state that can be later used during a operation.
IClipboardHelper
  
paste(item:Object, userData:Object):void
This method is called after the item has been pasted from the clipboard.
IClipboardHelper
  
shouldCopy(item:Object):Boolean
Determines whether the given item can or should be copied to the clipboard.
IClipboardHelper
  
shouldCut(item:Object):Boolean
Determines whether the given item can or should be cut to the clipboard.
IClipboardHelper
  
shouldPaste(item:Object, userData:Object):Boolean
Determines whether the given item can or should be pasted from the clipboard to the target graph.
IClipboardHelper
Method Detail
copy()method
public function copy(item:Object):Object

This method is called during the copy operation of the given item to retrieve additional state that can be later used during a operation.

Parameters

item:Object — The item to copy to the clipboard.

Returns
Object — A custom user object that will later be provided to Paste.
cut()method 
public function cut(item:Object):Object

This method is called during the cut operation of the given item to retrieve additional state that can be later used during a operation.

Parameters

item:Object — The item to cut to the clipboard.

Returns
Object — A custom user object that will later be provided to Paste.
paste()method 
public function paste(item:Object, userData:Object):void

This method is called after the item has been pasted from the clipboard.

Parameters

item:Object — The item that has been created during the paste operation.
 
userData:Object — The data that had been queried during Cut or Copy respectively.

shouldCopy()method 
public function shouldCopy(item:Object):Boolean

Determines whether the given item can or should be copied to the clipboard.

Parameters

item:Object — The item to copy.

Returns
Boolean — true, if this item should be copied.
shouldCut()method 
public function shouldCut(item:Object):Boolean

Determines whether the given item can or should be cut to the clipboard.

Parameters

item:Object — The item to copy.

Returns
Boolean — true, if this item should be cut.
shouldPaste()method 
public function shouldPaste(item:Object, userData:Object):Boolean

Determines whether the given item can or should be pasted from the clipboard to the target graph.

Parameters

item:Object — The item in the clipboard.
 
userData:Object — The state memento that had been created during cut or copy.

Returns
Boolean — true, if this item should be pasted.