Package org.eclipse.rap.rwt.dnd
Class ClientFileTransfer
- java.lang.Object
-
- org.eclipse.swt.dnd.Transfer
-
- org.eclipse.rap.rwt.dnd.ClientFileTransfer
-
public class ClientFileTransfer extends Transfer
The classClientFileTransfer
allows the user to drop files from the user's file system on aDropTarget
. The DropEvent will contain data of the typeClientFile[]
.- Since:
- 2.3
- See Also:
Transfer
,ClientFile
,ClientFileUploader
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ClientFileTransfer
getInstance()
TransferData[]
getSupportedTypes()
Returns a list of the platform specific data types that can be converted using this transfer agent.protected int[]
getTypeIds()
Returns the platform specific ids of the data types that can be converted using this transfer agent.protected java.lang.String[]
getTypeNames()
Returns the platform specific names of the data types that can be converted using this transfer agent.boolean
isSupportedType(TransferData transferData)
Returns true if theTransferData
data type can be converted using this transfer agent, or false otherwise (including if transferData isnull
).void
javaToNative(java.lang.Object object, TransferData transferData)
Converts a java representation of data to a platform specific representation of the data.java.lang.Object
nativeToJava(TransferData transferData)
Converts a platform specific representation of data to a java representation.-
Methods inherited from class org.eclipse.swt.dnd.Transfer
registerType, validate
-
-
-
-
Method Detail
-
getInstance
public static ClientFileTransfer getInstance()
-
getSupportedTypes
public TransferData[] getSupportedTypes()
Description copied from class:Transfer
Returns a list of the platform specific data types that can be converted using this transfer agent.Only the data type fields of the
TransferData
objects are filled in.- Specified by:
getSupportedTypes
in classTransfer
- Returns:
- a list of the data types that can be converted using this transfer agent
-
isSupportedType
public boolean isSupportedType(TransferData transferData)
Description copied from class:Transfer
Returns true if theTransferData
data type can be converted using this transfer agent, or false otherwise (including if transferData isnull
).- Specified by:
isSupportedType
in classTransfer
- Parameters:
transferData
- a platform specific description of a data type; only the data type fields of theTransferData
object need to be filled in- Returns:
- true if the transferData data type can be converted using this transfer agent
-
getTypeIds
protected int[] getTypeIds()
Description copied from class:Transfer
Returns the platform specific ids of the data types that can be converted using this transfer agent.- Specified by:
getTypeIds
in classTransfer
- Returns:
- the platform specific ids of the data types that can be converted using this transfer agent
-
getTypeNames
protected java.lang.String[] getTypeNames()
Description copied from class:Transfer
Returns the platform specific names of the data types that can be converted using this transfer agent.- Specified by:
getTypeNames
in classTransfer
- Returns:
- the platform specific names of the data types that can be converted using this transfer agent.
-
javaToNative
public void javaToNative(java.lang.Object object, TransferData transferData)
Description copied from class:Transfer
Converts a java representation of data to a platform specific representation of the data.On a successful conversion, the transferData.result field will be set to 1. If this transfer agent is unable to perform the conversion, the transferData.result field will be set to a failure value of 0.
IMPORTANT: This method is not part of the RWT public API. It is marked public only so that it can be shared within the packages provided by RWT. It should never be accessed from application code.
- Specified by:
javaToNative
in classTransfer
- Parameters:
object
- a java representation of the data to be converted; the type of Object that is passed in is dependent on theTransfer
subclass.transferData
- an empty TransferData object; this object will be filled in on return with the platform specific representation of the data
-
nativeToJava
public java.lang.Object nativeToJava(TransferData transferData)
Description copied from class:Transfer
Converts a platform specific representation of data to a java representation.IMPORTANT: This method is not part of the RWT public API. It is marked public only so that it can be shared within the packages provided by RWT. It should never be accessed from application code.
- Specified by:
nativeToJava
in classTransfer
- Parameters:
transferData
- the platform specific representation of the data to be converted- Returns:
- a java representation of the converted data if the conversion was
successful; otherwise null. If transferData is
null
thennull
is returned. The type of Object that is returned is dependent on theTransfer
subclass.
-
-