|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.alee.utils.DragUtils
public final class DragUtils
This class provides a set of utilities to simplify work with swing drag and drop.
Field Summary | |
---|---|
static java.lang.String |
URI_LIST_MIME_TYPE
URI list mime type. |
static java.lang.String |
uriListSeparator
URI string data separator. |
Constructor Summary | |
---|---|
DragUtils()
|
Method Summary | |
---|---|
static boolean |
canPassDrop(java.awt.Component component,
javax.swing.TransferHandler.TransferSupport info)
Returns whether can pass drop action to closest component parent that has its own TransferHandler. |
static boolean |
canPassDrop(javax.swing.TransferHandler.TransferSupport info)
Returns whether can pass drop action to closest component parent that has its own TransferHandler. |
static java.lang.String |
fileListToTextURIList(java.util.List<java.io.File> files)
Returns text URI list for the specified list of files. |
static java.util.List<java.io.File> |
getImportedFiles(java.awt.datatransfer.Transferable t)
Returns list of imported files retrieved from the specified transferable. |
static java.awt.Image |
getImportedImage(java.awt.datatransfer.Transferable t)
Returns improrted image retrieved from the specified transferable. |
static java.awt.datatransfer.DataFlavor |
getUriListDataFlavor()
Returns URI list data flavor. |
static boolean |
hasURIListFlavor(java.awt.datatransfer.DataFlavor[] flavors)
Returns whether flavors array has URI list flavor or not. |
static boolean |
passDropAction(java.awt.Component component,
javax.swing.TransferHandler.TransferSupport info)
Passes drop action to closest component parent that has its own TransferHandler. |
static boolean |
passDropAction(javax.swing.TransferHandler.TransferSupport info)
Passes drop action to closest component parent that has its own TransferHandler. |
static java.util.List<java.io.File> |
textURIListToFileList(java.lang.String data)
Returns list of files from the specified text URI list. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String URI_LIST_MIME_TYPE
public static final java.lang.String uriListSeparator
Constructor Detail |
---|
public DragUtils()
Method Detail |
---|
public static java.awt.Image getImportedImage(java.awt.datatransfer.Transferable t)
t
- transferable
public static java.util.List<java.io.File> getImportedFiles(java.awt.datatransfer.Transferable t)
t
- transferable
public static java.util.List<java.io.File> textURIListToFileList(java.lang.String data)
data
- text list of URI
public static java.lang.String fileListToTextURIList(java.util.List<java.io.File> files)
files
- list of files to convert
public static boolean hasURIListFlavor(java.awt.datatransfer.DataFlavor[] flavors)
flavors
- flavors array
public static java.awt.datatransfer.DataFlavor getUriListDataFlavor()
public static boolean canPassDrop(javax.swing.TransferHandler.TransferSupport info)
info
- transfer support
public static boolean canPassDrop(java.awt.Component component, javax.swing.TransferHandler.TransferSupport info)
component
- component to pass drop action frominfo
- transfer support
public static boolean passDropAction(javax.swing.TransferHandler.TransferSupport info)
info
- transfer support
public static boolean passDropAction(java.awt.Component component, javax.swing.TransferHandler.TransferSupport info)
component
- component to pass drop action frominfo
- transfer support
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |