DefaultTransferDriver Class

com.bea.ide.core.datatransfer
DefaultTransferDriver Class

public abstract class DefaultTransferDriver

    extends Object
    implements ITransferDriver

Hierarchy
Object
  DefaultTransferDriver
All Implemented Interfaces

ITransferDriver

Constructor Summary

DefaultTransferDriver()

 

Method Summary

public boolean
canImport(Transferable t)
Indicates whether the view would accept an import of the given Transferable prior to actually attempting to import it.
public Transferable
createTransferable(IElement el, int action)
Creates a Transferable to use as the source for a data transfer.
public boolean
delete(IElement el)
Called to delete the currently selected elements in the data model.
public boolean
isDeleteable(IElement el)
Indicates whether the given IElement can be deleted.
public boolean
isTransferable(IElement el, int actions)
Indicates whether a Transferable for the given IElement can be created.
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.
 
Methods from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
   
Methods from interface com.bea.ide.core.datatransfer.ITransferDriver
canImport, canImport, createTransferable, delete, importData, isDeleteable, isTransferable, transferComplete
 

Constructor Detail

DefaultTransferDriver

public DefaultTransferDriver()
 

Method Detail

canImport(Transferable) Method

public boolean canImport(Transferable t)
Description copied from ITransferDriver.canImport(Transferable)
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.

Parameters

t
Transferable to test for import

Returns

true if the data can be inserted, false otherwise

createTransferable(IElement, int) Method

public Transferable createTransferable(IElement el, 
                                       int action)
Description copied from ITransferDriver.createTransferable(IElement, int)
Creates a 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.

Parameters

el
IElement that is the current Application selected element, may be null.

Returns

Transferable representation of the data to be transferred, may be null.

delete(IElement) Method

public boolean delete(IElement el)
Description copied from ITransferDriver.delete(IElement)
Called to delete the currently selected elements in the data model. The shell's Cut and Delete actions will call this method.

Parameters

el
IElement that is the current Application selected element, may be null.

Returns

true if the data was deleted, false otherwise

isDeleteable(IElement) Method

public boolean isDeleteable(IElement el)
Description copied from ITransferDriver.isDeleteable(IElement)
Indicates whether the given IElement can be deleted. The shell's Cut and Delete action will use this method to determine enabling.

Parameters

el
IElement that is the current Application selected element, may be null.

Returns

true if the data may be deleted, false otherwise

isTransferable(IElement, int) Method

public boolean isTransferable(IElement el, 
                              int actions)
Description copied from ITransferDriver.isTransferable(IElement, int)
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.

Parameters

el
IElement that is the current Application selected element, may be null.
actions
Actions that should be checked for transferability

transferComplete(Transferable, boolean, int) Method

public boolean transferComplete(Transferable t, 
                                boolean success, 
                                int action)
Description copied from ITransferDriver.transferComplete(Transferable, boolean, int)
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.

Parameters

t
Transferable that was used in the transfer
success
Boolean value indicating whether or not the drop completed successfully
action
DnDConstants integer value indicating the type of action the drop represented

Returns

boolean value indicating whether the given transferable is still valid. This is used for example, to clear the clipboard, if the transferable isn't valid anymore