public interface IClipboardHelper
IModelItem
s.
Implementations of this interface can decorate
the ILookup.lookup(java.lang.Class)
method of IModelItem
s to change their behavior during clipboard
actions.
The easiest way to decorate certain model items with a custom IClipboardHelper
implementation is via the various
decorators available on GraphDecorator
:
Modifier and Type | Method and Description |
---|---|
Object |
copy(IGraphClipboardContext context,
IModelItem item)
This method is called during the copy operation of the given item to retrieve additional state that can be later used
during a
paste(IGraphClipboardContext, IModelItem, Object) operation. |
Object |
cut(IGraphClipboardContext context,
IModelItem item)
This method is called during the cut operation of the given item to retrieve additional state that can be later used
during a
paste(IGraphClipboardContext, IModelItem, Object) operation. |
void |
paste(IGraphClipboardContext context,
IModelItem item,
Object userData)
This method is called after the item has been pasted from the clipboard.
|
boolean |
shouldCopy(IGraphClipboardContext context,
IModelItem item)
Determines whether the given item can or should be copied to the clipboard.
|
boolean |
shouldCut(IGraphClipboardContext context,
IModelItem item)
Determines whether the given item can or should be cut to the clipboard.
|
boolean |
shouldPaste(IGraphClipboardContext context,
IModelItem item,
Object userData)
Determines whether the given item can or should be pasted from the clipboard to the target graph.
|
Object copy(IGraphClipboardContext context, IModelItem item)
paste(IGraphClipboardContext, IModelItem, Object)
operation.
If the source graph is a managed folding view, the item
is always a master item.
context
- The context in which this interface is used, can be null
item
- The item to copy to the clipboard.paste(IGraphClipboardContext, IModelItem, Object)
.Object cut(IGraphClipboardContext context, IModelItem item)
paste(IGraphClipboardContext, IModelItem, Object)
operation.
If the source graph is a managed folding view, the item
is always a master item.
context
- The context in which this interface is used, can be null
item
- The item to cut to the clipboard.paste(IGraphClipboardContext, IModelItem, Object)
.void paste(IGraphClipboardContext context, IModelItem item, Object userData)
The item
is always a master item since the clipboard graph is not a managed folding view.
context
- The context in which this interface is used, can be null
item
- The item that has been created during the paste operation.userData
- The data that had been queried during cut(IGraphClipboardContext, IModelItem)
or copy(IGraphClipboardContext, IModelItem)
respectively.boolean shouldCopy(IGraphClipboardContext context, IModelItem item)
If the source graph is a managed folding view, the 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.
context
- The context in which this interface is used, can be null
item
- The item in question.boolean shouldCut(IGraphClipboardContext context, IModelItem item)
If the source graph is a managed folding view, the 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.
context
- The context in which this interface is used, can be null
item
- The item in question.boolean shouldPaste(IGraphClipboardContext context, IModelItem item, Object userData)
The item
is always a master item since the clipboard graph is not a managed folding view.
context
- The context in which this interface is used, can be null
item
- The item in the clipboard graph.userData
- The state memento that had been created during cut(IGraphClipboardContext, IModelItem)
or
copy(IGraphClipboardContext, IModelItem)
.