public interface IClipboardIdProvider
GraphClipboard
to assign IDs for elements in the clipboard.
IDs are created when items are copied (or cut) into the clipboard and queried when the items are pasted from the
clipboard.
Providing a custom ID provider allows for identifying conceptually identical items across different graph instances.
The default implementation uses the IModelItem
object reference as the ID.
Modifier and Type | Method and Description |
---|---|
Object |
getId(IGraphClipboardContext context,
IModelItem originalItem)
Gets the ID for the given
originalItem . |
IModelItem |
getItem(IGraphClipboardContext context,
Object id)
Gets the item which is represented by the given
id . |
Object getId(IGraphClipboardContext context, IModelItem originalItem)
originalItem
.context
- The clipboard contextoriginalItem
- The original item which is copied. The item is part of the original graph from which the item is copied.HashMap
.IModelItem getItem(IGraphClipboardContext context, Object id)
id
.context
- The clipboard context.id
- The ID to get the item for.null
if the item cannot be located or is invalid. The item
needs to be part of the target graph for paste operations.