Package org.eclipse.gef.dnd

# Class SimpleObjectTransfer

java.lang.Object
org.eclipse.swt.dnd.Transfer
org.eclipse.swt.dnd.ByteArrayTransfer
org.eclipse.gef.dnd.SimpleObjectTransfer

Direct Known Subclasses:
  `TemplateTransfer`

public abstract class SimpleObjectTransfer extends ByteArrayTransfer
Holds on to the object being transferred in a field so that DropTargetListeners can know what's being dragged before the drop occurs. The object isn't converted to bytes, so this Transfer will only work when dragging within the same instance of Eclipse. Subclasses should maintain a single instance of their Transfer and provide a static method to obtain that instance.

## Constructor Summary

Constructors
Constructor
Description
`SimpleObjectTransfer()`

## Method Summary

Modifier and Type
Method
Description
`Object`
`getObject()`
Returns the Object.
`void`
`javaToNative(Object object, TransferData transferData)`
The data object is not converted to bytes.
`Object`
`nativeToJava(TransferData transferData)`
The data object is not converted to bytes.
`void`
`setObject(Object obj)`
Sets the Object.

### Methods inherited from class org.eclipse.swt.dnd.ByteArrayTransfer

`getSupportedTypes, isSupportedType`

### Methods inherited from class org.eclipse.swt.dnd.Transfer

`getTypeIds, getTypeNames, registerType, validate`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### SimpleObjectTransfer

public SimpleObjectTransfer()

## Method Details

### getObject

public Object getObject()
Returns the Object.

Returns:
  The Object

### javaToNative

public void javaToNative(Object object, TransferData transferData)
The data object is not converted to bytes. It is held onto in a field. Instead, a checksum is written out to prevent unwanted drags across mulitple running copies of Eclipse.

Overrides:
  `javaToNative` in class `ByteArrayTransfer`
See Also:
  - `Transfer.javaToNative(Object, TransferData)`

### nativeToJava

public Object nativeToJava(TransferData transferData)
The data object is not converted to bytes. It is held onto in a field. Instead, a checksum is written out to prevent unwanted drags across mulitple running. copies of Eclipse.

Overrides:
  `nativeToJava` in class `ByteArrayTransfer`
See Also:
  - `Transfer.nativeToJava(TransferData)`

### setObject

public void setObject(Object obj)
Sets the Object.

Parameters:
  `obj` - The Object