com.vaadin.event
Interface Transferable

All Superinterfaces:
Serializable
All Known Implementing Classes:
DataBoundTransferable, DragAndDropWrapper.WrapperTransferable, Table.TableTransferable, TransferableImpl, Tree.TreeTransferable

public interface Transferable
extends Serializable

Transferable wraps the data that is to be imported into another component. Currently Transferable is only used for drag and drop.

Since:
6.3

Method Summary
 Object getData(String dataFlavor)
          Returns the data from Transferable by its data flavor (aka data type).
 Collection<String> getDataFlavors()
           
 Component getSourceComponent()
           
 void setData(String dataFlavor, Object value)
          Stores data of given data flavor to Transferable.
 

Method Detail

getData

Object getData(String dataFlavor)
Returns the data from Transferable by its data flavor (aka data type). Data types can be any string keys, but MIME types like "text/plain" are commonly used.

Note, implementations of Transferable often provide a better typed API for accessing data.

Parameters:
dataFlavor - the data flavor to be returned from Transferable
Returns:
the data stored in the Transferable or null if Transferable contains no data for given data flavour

setData

void setData(String dataFlavor,
             Object value)
Stores data of given data flavor to Transferable. Possibly existing value of the same data flavor will be replaced.

Parameters:
dataFlavor - the data flavor
value - the new value of the data flavor

getDataFlavors

Collection<String> getDataFlavors()
Returns:
a collection of data flavors ( data types ) available in this Transferable

getSourceComponent

Component getSourceComponent()
Returns:
the component that created the Transferable or null if the source component is unknown


Copyright © 2000-2011 Vaadin Ltd. All Rights Reserved.