Package ca.cgjennings.ui.dnd
Class ScrapBook.Selection<K>
- java.lang.Object
-
- ca.cgjennings.ui.dnd.ScrapBook.Selection<K>
-
- Type Parameters:
K
- the type of object represented by the selection
- All Implemented Interfaces:
java.awt.datatransfer.ClipboardOwner
,java.awt.datatransfer.Transferable
- Direct Known Subclasses:
ScrapBook.FileListSelection
,ScrapBook.ImageSelection
- Enclosing class:
- ScrapBook
public static class ScrapBook.Selection<K> extends java.lang.Object implements java.awt.datatransfer.Transferable, java.awt.datatransfer.ClipboardOwner
A base class for creating transferables with exactly one acceptableDataFlavor
.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.awt.datatransfer.DataFlavor
acceptedflavor
protected K
content
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
getTransferData(java.awt.datatransfer.DataFlavor flavor)
java.awt.datatransfer.DataFlavor[]
getTransferDataFlavors()
boolean
isDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor)
void
lostOwnership(java.awt.datatransfer.Clipboard clipboard, java.awt.datatransfer.Transferable contents)
-
-
-
Field Detail
-
acceptedflavor
protected java.awt.datatransfer.DataFlavor acceptedflavor
-
content
protected K content
-
-
Constructor Detail
-
Selection
public Selection(K content, java.awt.datatransfer.DataFlavor acceptedFlavor)
-
-
Method Detail
-
getTransferDataFlavors
public java.awt.datatransfer.DataFlavor[] getTransferDataFlavors()
- Specified by:
getTransferDataFlavors
in interfacejava.awt.datatransfer.Transferable
-
isDataFlavorSupported
public boolean isDataFlavorSupported(java.awt.datatransfer.DataFlavor flavor)
- Specified by:
isDataFlavorSupported
in interfacejava.awt.datatransfer.Transferable
-
getTransferData
public java.lang.Object getTransferData(java.awt.datatransfer.DataFlavor flavor) throws java.awt.datatransfer.UnsupportedFlavorException, java.io.IOException
- Specified by:
getTransferData
in interfacejava.awt.datatransfer.Transferable
- Throws:
java.awt.datatransfer.UnsupportedFlavorException
java.io.IOException
-
lostOwnership
public void lostOwnership(java.awt.datatransfer.Clipboard clipboard, java.awt.datatransfer.Transferable contents)
- Specified by:
lostOwnership
in interfacejava.awt.datatransfer.ClipboardOwner
-
-