public class ExTransferable extends Object implements Transferable
Modifier and Type | Class and Description |
---|---|
static class |
ExTransferable.Multi
Transferable object for multiple transfer.
|
static class |
ExTransferable.Single
Support for transferable owner with only one data flavor.
|
Modifier and Type | Field and Description |
---|---|
static Transferable |
EMPTY
An implementation of
Transferable that contains no data. |
static DataFlavor |
multiFlavor
Flavor for transfer of multiple objects.
|
Modifier and Type | Method and Description |
---|---|
void |
addTransferListener(TransferListener l)
Adds a listener to watch the life-cycle of this object.
|
static ExTransferable |
create(Transferable t)
Method to create a new extended transferable from a plain transferable.
|
Object |
getTransferData(DataFlavor flavor) |
DataFlavor[] |
getTransferDataFlavors() |
boolean |
isDataFlavorSupported(DataFlavor flavor) |
void |
put(ExTransferable.Single single)
Add a new flavor with its data.
|
void |
remove(DataFlavor flavor)
Remove a flavor from the supported set.
|
void |
removeTransferListener(TransferListener l)
Removes a listener.
|
public static final Transferable EMPTY
Transferable
that contains no data.public static final DataFlavor multiFlavor
public void put(ExTransferable.Single single)
single
- the single transferable to usepublic void remove(DataFlavor flavor)
flavor
- the flavor to removepublic DataFlavor[] getTransferDataFlavors()
getTransferDataFlavors
in interface Transferable
public boolean isDataFlavorSupported(DataFlavor flavor)
isDataFlavorSupported
in interface Transferable
public Object getTransferData(DataFlavor flavor) throws UnsupportedFlavorException, IOException
getTransferData
in interface Transferable
UnsupportedFlavorException
IOException
public static ExTransferable create(Transferable t)
ExTransferable
, then it
is returned as is.
Otherwise the data is copied.t
- transferable to create support forpublic final void addTransferListener(TransferListener l)
l
- the listenerpublic final void removeTransferListener(TransferListener l)