public class LocalTransfer
extends ByteArrayTransfer
LocalTransfer.getInstance()
,
so that you can include it in when adding drag support to a viewer.
See EditingDomainViewerDropAdapter
and ViewerDragAdapter
for more details.
As an added guard, the time is recorded and serialized in javaToNative to that native to java can ensure that it's returns the value that was really to have been transferred.
Modifier and Type | Field and Description |
---|---|
protected static LocalTransfer |
instance
This is initialized and returned by
getInstance() . |
protected java.lang.Object |
object
This records the data being transferred.
|
protected long |
startTime
This records the time at which the transfer data was recorded.
|
protected static int |
TYPE_ID
This is the ID that is registered to the name.
|
protected static java.lang.String |
TYPE_NAME
This is the register transfer type name.
|
Modifier | Constructor and Description |
---|---|
protected |
LocalTransfer()
This creates an instance; typically you get one from
getInstance() . |
Modifier and Type | Method and Description |
---|---|
static LocalTransfer |
getInstance()
This returns the one instance of this transfer agent.
|
protected int[] |
getTypeIds()
This returns the transfer IDs that this agent supports.
|
java.lang.String[] |
getTypeNames()
This returns the transfer names that this agent supports.
|
void |
javaToNative(java.lang.Object object,
TransferData transferData)
This records the object and current time and encodes only the current time into the transfer data.
|
java.lang.Object |
nativeToJava(TransferData transferData)
This decodes the time of the transfer and returns the recorded the object if the recorded time and the decoded time match.
|
protected static final java.lang.String TYPE_NAME
protected static final int TYPE_ID
protected static LocalTransfer instance
getInstance()
.protected long startTime
protected java.lang.Object object
protected LocalTransfer()
getInstance()
.public static LocalTransfer getInstance()
protected int[] getTypeIds()
public java.lang.String[] getTypeNames()
public void javaToNative(java.lang.Object object, TransferData transferData)
public java.lang.Object nativeToJava(TransferData transferData)