com.levigo.jadice.swing.dnd
Interface ImportHandler

All Known Implementing Classes:
CompositeImportHandler, DocumentUnmarshallerPageImportHandler, FileImportHandler, ImageImportHandler, IntraDOCPPageImportHandler, IntraJVMPageImportHandler, ReorderPageImportHandler

public interface ImportHandler

ImportHandlers are responsible for the import of transfer data from representations suitable for Drag&Drop or Copy/Cut&Paste transfer.


Method Summary
 int getImportActionForFlavor(DataFlavor flavor, ImportParameters parameters)
          Returns the accepted DnD action for the given DataFlavor by this import handler.
 boolean importData(Transferable data, 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.
 

Method Detail

importData

boolean importData(Transferable data,
                   int dropAction,
                   ImportParameters parameters)
                   throws IOException,
                          UnsupportedFlavorException,
                          JadiceException
Import from the given Transferable into the given ViewComponent.

Parameters:
data - The Transferable to import
dropAction - the user drop action of the import
parameters - the import parameters containing additional context information
Returns:
true if the import succeeded
Throws:
IOException
UnsupportedFlavorException
JadiceException

isDataFlavorSupported

boolean isDataFlavorSupported(DataFlavor flavor,
                              ImportParameters parameters)
Check whether the given DataFlavor is supported by this import handler.

Parameters:
flavor - The flavor in which the transfer bundle will be provided when supported.
parameters - the import parameters containing additional context information
Returns:
true if the given flavor is supported.

getImportActionForFlavor

int getImportActionForFlavor(DataFlavor flavor,
                             ImportParameters parameters)
Returns the accepted DnD action for the given DataFlavor by this import handler.

Parameters:
flavor - The flavor in which the transfer bundle will be provided when supported.
parameters - the import parameters containing additional context information
Returns:
int 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.
See Also:
DnDConstants.ACTION_COPY, DnDConstants.ACTION_COPY_OR_MOVE, DnDConstants.ACTION_LINK, DnDConstants.ACTION_MOVE, DnDConstants.ACTION_NONE


Copyright © 1995-2020 levigo holding gmbh. All Rights Reserved.