public class CompositeImportHandler extends Object implements ImportHandler, com.levigo.jadice.swing.internal.transfer.SelfDescribingImportHandler
ImportHandler
encompassing a set of delegate ImportHandler
s. The data flavors
supported by this handler are the union of all supported data flavors of the element handlers.
The encompassed handlers will be called in the same order as the were given in the constructors. Hence integrators are advised to order the handlers from the most specific to the most general one.
CompositeExportHandler
Constructor and Description |
---|
CompositeImportHandler(ImportHandler... delegates)
Create a
CompositeImportHandler using the given array of delegate handlers. |
CompositeImportHandler(List<? extends ImportHandler> delegates)
Create a
CompositeImportHandler using the given list of delegate handlers. |
Modifier and Type | Method and Description |
---|---|
String |
getImportActionDescription(Transferable data,
int importAction,
ImportParameters parameters)
Return a more precise description of the performed import.
|
int |
getImportActionForFlavor(DataFlavor flavor,
ImportParameters parameters)
Returns the accepted DnD action for the given
DataFlavor by this import handler. |
boolean |
importData(Transferable t,
int dropAction,
ImportParameters parameters)
Import from the given
Transferable into the given ViewComponent . |
boolean |
isDataFlavorSupported(DataFlavor flavor,
ImportParameters parameters)
Check whether the given
DataFlavor is supported by this import handler. |
public CompositeImportHandler(ImportHandler... delegates)
CompositeImportHandler
using the given array of delegate handlers.delegates
- The delegate ImportHandler
spublic CompositeImportHandler(List<? extends ImportHandler> delegates)
CompositeImportHandler
using the given list of delegate handlers.delegates
- The delegate ImportHandler
spublic boolean importData(Transferable t, int dropAction, ImportParameters parameters) throws IOException, UnsupportedFlavorException, JadiceException
ImportHandler
Transferable
into the given ViewComponent
.importData
in interface ImportHandler
t
- The Transferable
to importdropAction
- the user drop action
of the
importparameters
- the import parameters containing additional context informationtrue
if the import succeededIOException
UnsupportedFlavorException
JadiceException
public boolean isDataFlavorSupported(DataFlavor flavor, ImportParameters parameters)
ImportHandler
DataFlavor
is supported by this import handler.isDataFlavorSupported
in interface ImportHandler
flavor
- The flavor in which the transfer bundle will be provided when supported.parameters
- the import parameters containing additional context informationtrue
if the given flavor is supported.public int getImportActionForFlavor(DataFlavor flavor, ImportParameters parameters)
ImportHandler
DataFlavor
by this import handler.getImportActionForFlavor
in interface ImportHandler
flavor
- The flavor in which the transfer bundle will be provided when supported.parameters
- the import parameters containing additional context informationint
one of the DnDConstants
action constants. Returns which DnD
action will be accepted by this import handler for the given flavor. If the flavor is
not supported DnDConstants.ACTION_NONE
will be returned.ImportHandler.getImportActionForFlavor(java.awt.datatransfer.DataFlavor,
ImportParameters)
public String getImportActionDescription(Transferable data, int importAction, ImportParameters parameters)
com.levigo.jadice.swing.internal.transfer.SelfDescribingImportHandler
null
is returned, the default description will be used.getImportActionDescription
in interface com.levigo.jadice.swing.internal.transfer.SelfDescribingImportHandler
importAction
- TODOnull
Copyright © 2024 levigo holding gmbh. All rights reserved.