KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > java > awt > datatransfer > Transferable


1 /*
2  * @(#)Transferable.java 1.13 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package java.awt.datatransfer;
9
10 import java.io.IOException JavaDoc;
11
12 /**
13  * Defines the interface for classes that can be used to provide data
14  * for a transfer operation.
15  * <p>
16  * For information on using data transfer with Swing, see
17  * <a HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/dnd.html">
18  * How to Use Drag and Drop and Data Transfer</a>,
19  * a section in <em>The Java Tutorial</em>, for more information.
20  *
21  * @version 1.13, 12/19/03
22  * @author Amy Fowler
23  */

24
25 public interface Transferable {
26
27     /**
28      * Returns an array of DataFlavor objects indicating the flavors the data
29      * can be provided in. The array should be ordered according to preference
30      * for providing the data (from most richly descriptive to least descriptive).
31      * @return an array of data flavors in which this data can be transferred
32      */

33     public DataFlavor JavaDoc[] getTransferDataFlavors();
34
35     /**
36      * Returns whether or not the specified data flavor is supported for
37      * this object.
38      * @param flavor the requested flavor for the data
39      * @return boolean indicating whether or not the data flavor is supported
40      */

41     public boolean isDataFlavorSupported(DataFlavor JavaDoc flavor);
42
43     /**
44      * Returns an object which represents the data to be transferred. The class
45      * of the object returned is defined by the representation class of the flavor.
46      *
47      * @param flavor the requested flavor for the data
48      * @see DataFlavor#getRepresentationClass
49      * @exception IOException if the data is no longer available
50      * in the requested flavor.
51      * @exception UnsupportedFlavorException if the requested data flavor is
52      * not supported.
53      */

54     public Object JavaDoc getTransferData(DataFlavor JavaDoc flavor) throws UnsupportedFlavorException JavaDoc, IOException JavaDoc;
55
56 }
57
Popular Tags