Top Description Fields Constructors Methods
org.eclipse.swt.dnd

public Class FileTransfer

extends ByteArrayTransfer
Class Inheritance
Imports
org.eclipse.swt.internal.*, org.eclipse.swt.internal.gtk.*

The class FileTransfer provides a platform specific mechanism for converting a list of files represented as a java String[] to a platform specific representation of the data and vice versa. Each String in the array contains the absolute path for a single file or directory.

An example of a java String[] containing a list of files is shown below:


    File file1 = new File("C:\\temp\\file1");
    File file2 = new File("C:\\temp\\file2");
    String[] fileData = new String[2];
    fileData[0] = file1.getAbsolutePath();
    fileData[1] = file2.getAbsolutePath();
See Also
Transfer

Field Summary

Modifier and TypeField and Description
private static FileTransfer
private static final String
private static final int
private static final String
private static final int

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv boolean
checkFile(Object object)

public static FileTransfer

Returns:

the singleton instance of the FileTransfer class
getInstance
()

Returns the singleton instance of the FileTransfer class.

protected int[]
getTypeIds()

Implements abstract org.eclipse.swt.dnd.Transfer.getTypeIds.

Returns the platform specific ids of the data types that can be converted using this transfer agent.
protected String[]
getTypeNames()

Implements abstract org.eclipse.swt.dnd.Transfer.getTypeNames.

Returns the platform specific names of the data types that can be converted using this transfer agent.
public void
javaToNative(Object
a java String[] containing the file names to be converted
object
,
TransferData
an empty TransferData object that will be filled in on return with the platform specific format of the data
transferData
)

Overrides org.eclipse.swt.dnd.ByteArrayTransfer.javaToNative.

This implementation of javaToNative converts a list of file names represented by a java String[] to a platform specific representation.
public Object

Returns:

a java String[] containing a list of file names if the conversion was successful; otherwise null
nativeToJava
(TransferData
the platform specific representation of the data to be converted
transferData
)

Overrides org.eclipse.swt.dnd.ByteArrayTransfer.nativeToJava.

This implementation of nativeToJava converts a platform specific representation of a list of file names to a java String[].
protected boolean
validate(Object
a java representation of the data to be converted
object
)

Overrides org.eclipse.swt.dnd.Transfer.validate.

Test that the object is of the correct format for this Transfer class.
Inherited from org.eclipse.swt.dnd.ByteArrayTransfer:
checkByteArraygetSupportedTypesisSupportedType

Field Detail

_instanceback to summary
private static FileTransfer _instance
GNOME_LISTback to summary
private static final String GNOME_LIST
GNOME_LIST_IDback to summary
private static final int GNOME_LIST_ID
URI_LISTback to summary
private static final String URI_LIST
URI_LIST_IDback to summary
private static final int URI_LIST_ID

Constructor Detail

FileTransferback to summary
private FileTransfer()

Method Detail

checkFileback to summary
pack-priv boolean checkFile(Object object)
getInstanceback to summary
public static FileTransfer getInstance()

Returns the singleton instance of the FileTransfer class.

Returns:FileTransfer

the singleton instance of the FileTransfer class

getTypeIdsback to summary
protected int[] getTypeIds()

Implements abstract org.eclipse.swt.dnd.Transfer.getTypeIds.

Doc from org.eclipse.swt.dnd.Transfer.getTypeIds.

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

Returns:int[]

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

Annotations
@Override
getTypeNamesback to summary
protected String[] getTypeNames()

Implements abstract org.eclipse.swt.dnd.Transfer.getTypeNames.

Doc from org.eclipse.swt.dnd.Transfer.getTypeNames.

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

Returns:String[]

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

Annotations
@Override
javaToNativeback to summary
public void javaToNative(Object object, TransferData transferData)

Overrides org.eclipse.swt.dnd.ByteArrayTransfer.javaToNative.

This implementation of javaToNative converts a list of file names represented by a java String[] to a platform specific representation. Each String in the array contains the absolute path for a single file or directory.

Parameters
object:Object

a java String[] containing the file names to be converted

transferData:TransferData

an empty TransferData object that will be filled in on return with the platform specific format of the data

Annotations
@Override
See Also
Transfer#nativeToJava
nativeToJavaback to summary
public Object nativeToJava(TransferData transferData)

Overrides org.eclipse.swt.dnd.ByteArrayTransfer.nativeToJava.

This implementation of nativeToJava converts a platform specific representation of a list of file names to a java String[]. Each String in the array contains the absolute path for a single file or directory.

Parameters
transferData:TransferData

the platform specific representation of the data to be converted

Returns:Object

a java String[] containing a list of file names if the conversion was successful; otherwise null

Annotations
@Override
See Also
Transfer#javaToNative
validateback to summary
protected boolean validate(Object object)

Overrides org.eclipse.swt.dnd.Transfer.validate.

Doc from org.eclipse.swt.dnd.Transfer.validate.

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

Parameters
object:Object

a java representation of the data to be converted

Returns:boolean

true if object is of the correct form for this transfer type

Annotations
@Override