Methods for handling transfer of data to and from a view's data model.
The shell's Cut, Copy, Paste, and Delete actions uses this interface to move Transferables to and from the clipboard. To participate in cut/copy/paste, an IDocumentView must have an ITransferDriver implementation added as a driver. It is also must set the IDocumentView.PROP_SelectedElement property with an IElement when a selection change occurs.
Non-document views need to implement IDriverSupport and IPropertySupport
DefaultTransferDriver
Method Summary |
public boolean |
|
public boolean |
|
public |
|
public boolean | |
public boolean |
|
public boolean |
|
public boolean |
|
public boolean |
|
Method Detail |
public boolean canImport(DataFlavor
[] rgFlavors)
Indicates whether the view would accept an import of a transferable
with the given DataFlavors
public boolean canImport(Transferable
t)
Indicates whether the view would accept an import of the given
Transferable prior to actually attempting to import it.
Generally the view will only need to check the Transferable's
set of data flavors.
The shell's Paste action will call this method to determine if
the current clipboard content may be inserted.
publicCreates aTransferable
createTransferable(IElement
el, int action)
Transferable
to use as the source for
a data transfer. Returns the representation of the data to
be transferred.
The shell's Cut and Copy actions will use this method to get
the Transferable to place in the clipboard.
public boolean delete(IElement
el)
Called to delete the currently selected elements in the data model.
The shell's Cut and Delete actions will call this method.
public boolean importData(Transferable
t)
Causes a transfer to the view of a Transferable.
The Transferable represents the data to be imported into the component.
The shell Paste action will call this method.
public boolean isDeleteable(IElement
el)
Indicates whether the given IElement can be deleted.
The shell's Cut and Delete action will use this method to
determine enabling.
public boolean isTransferable(IElement
el,
int actions)
Indicates whether a Transferable for the given IElement
can be created. The shell's Cut and Copy actions will use this method to
determine enabling.
public boolean transferComplete(Transferable
t,
boolean success,
int action)
Called on the source of a drag and drop or cut/copy when the drop/paste operation is completed. This should
be used to handle any results based on the type of action, or cleanup any visual changes
due to the start of a drag and drop.