Package com.iizigo.dnd
Class PropertiesTransfer
java.lang.Object
org.eclipse.swt.dnd.Transfer
org.eclipse.swt.dnd.ByteArrayTransfer
com.iizigo.dnd.PropertiesTransfer
The transfer class for properties in clip board or for drag-drop. The PropertiesTransfer class is used to transfer an array of GProp from one part to another in a drag and drop operation or a cut, copy, paste action.
This class can be used for a Viewer or an SWT component directly. A singleton is provided which may be serially reused (see getInstance). It is not intended to be sub classed.
- Author:
- Christopher Mindus
Field Summary
Method Summary
Modifier and TypeMethodDescriptionCreates a TransferData from a list of selected properties, where TransferData is typically used in drag-drop operations.static PropertiesTransfer
Gets the instance.protected int[]
Returns the platform specific Ids of the data types that can be converted using this transfer agent.protected String[]
Returns the platform specific names of the data types that can be converted using this transfer agent.void
javaToNative
(Object object, TransferData transferData) Converts the properties into a platform specific representation.nativeToJava
(TransferData transferData) Converts a platform specific representation of a byte array to aGProp[]
.protected boolean
Test that the object is of the correct format for this Transfer class.Methods inherited from class org.eclipse.swt.dnd.ByteArrayTransfer
getSupportedTypes, isSupportedType
Methods inherited from class org.eclipse.swt.dnd.Transfer
registerType
Field Details
TYPE_NAME
The transfer type for IIZI properties.- See Also:
Method Details
getInstance
Gets the instance.- Returns:
- The instance for properties transfer.
getTypeNames
Returns the platform specific names of the data types that can be converted using this transfer agent.- Specified by:
getTypeNames
in classTransfer
getTypeIds
protected int[] getTypeIds()Returns the platform specific Ids of the data types that can be converted using this transfer agent.- Specified by:
getTypeIds
in classTransfer
createDndTransferData
Creates a TransferData from a list of selected properties, where TransferData is typically used in drag-drop operations.- Parameters:
list
- The list of properties.- Returns:
- The TransferData instance, or null if list is empty.
validate
Test that the object is of the correct format for this Transfer class.javaToNative
Converts the properties into a platform specific representation.- Overrides:
javaToNative
in classByteArrayTransfer
- Parameters:
object
- A Javabyte[]
containing the data to be converted.transferData
- An emptyTransferData
object that will be filled in on return with the platform specific format of the data.
nativeToJava
Converts a platform specific representation of a byte array to aGProp[]
.- Overrides:
nativeToJava
in classByteArrayTransfer
- Parameters:
transferData
- The platform specific representation of the data to be converted.- Returns:
- A Java
byte[]
containing the converted data if the conversion was successful; otherwise null.