Transfer

<code>Transfer</code> provides a mechanism for converting between a java representation of data and a platform specific representation of data and vice versa. It is used in data transfer operations such as drag and drop and clipboard copy/paste.

<p>You should only need to become familiar with this class if you are implementing a Transfer subclass and you are unable to subclass the ByteArrayTransfer class.</p>

@see ByteArrayTransfer @see <a href="http://www.eclipse.org/swt/snippets/#dnd">Drag and Drop snippets</a> @see <a href="http://www.eclipse.org/swt/examples.php">SWT Example: DNDExample</a> @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>

Members

Functions

getSupportedTypes
TransferData[] getSupportedTypes()

Returns a list of the platform specific data types that can be converted using this transfer agent.

getTypeIds
int[] getTypeIds()

Returns the platform specific ids of the data types that can be converted using this transfer agent.

getTypeNames
String[] getTypeNames()

Returns the platform specific names of the data types that can be converted using this transfer agent.

isSupportedType
bool isSupportedType(TransferData transferData)

Returns true if the <code>TransferData</code> data type can be converted using this transfer agent, or false otherwise (including if transferData is <code>null</code>).

javaToNative
void javaToNative(Object object, TransferData transferData)

Converts a java representation of data to a platform specific representation of the data.

nativeToJava
Object nativeToJava(TransferData transferData)

Converts a platform specific representation of data to a java representation.

validate
bool validate(Object object)

Test that the object is of the correct format for this Transfer class.

Static functions

registerType
int registerType(String formatName)

Registers a name for a data type and returns the associated unique identifier.

Meta