KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openide > util > datatransfer > MultiTransferObject


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19 package org.openide.util.datatransfer;
20
21 import java.awt.datatransfer.*;
22
23 import java.io.IOException JavaDoc;
24
25
26 /** Interface for transferring multiple objects at once.
27 *
28 * @author Jaroslav Tulach
29 * @version 0.12 Dec 16, 1997
30 */

31 public interface MultiTransferObject {
32     /** Get the number of transferred elements.
33     * @return the count
34     */

35     public int getCount();
36
37     /** Get the transferable at some index.
38      * @param index the index
39      * @return the transferable
40      */

41     public Transferable getTransferableAt(int index);
42
43     /** Test whether a given data flavor is supported by the item at <code>index</code>.
44     *
45     * @param index the index
46     * @param flavor the flavor to test
47     * @return <CODE>true</CODE> if the flavor is supported
48     */

49     public boolean isDataFlavorSupported(int index, DataFlavor flavor);
50
51     /** Test whether each transferred item supports at least one of these
52     * flavors. Different items may support different flavors, however.
53     * @param array array of flavors
54     * @return <code>true</code> if all items support one or more flavors
55     */

56     public boolean areDataFlavorsSupported(DataFlavor[] array);
57
58     /** Get list of all supported flavors for the item at an index.
59     * @param i the index
60     * @return array of supported flavors
61     */

62     public DataFlavor[] getTransferDataFlavors(int i);
63
64     /** Get transfer data for the item at some index.
65     * @param indx the index
66     * @param flavor the flavor desired
67     * @return transfer data for item at that index
68     * @throws IOException if there is an I/O problem
69     * @throws UnsupportedFlavorException if that flavor is not supported
70     */

71     public Object JavaDoc getTransferData(int indx, DataFlavor flavor)
72     throws UnsupportedFlavorException, IOException JavaDoc;
73 }
74
Popular Tags