com.levigo.jadice.swing.dnd
Interface ExportHandler<S>

Type Parameters:
S - The type of selection the handler implementation can export.
All Known Implementing Classes:
CompositeExportHandler, IntraDOCPPageExportHandler, IntraJVMPageExportHandler, PageTextExportHandler, RasterizedPageImageExportHandler, RasterizedSelectionExportHandler, ReorderPageExportHandler, SelectedTextExportHandler

public interface ExportHandler<S>

Implementations of this interface are responsible for turning a selection (usually of pages presented within a ViewComponent) into a representation suitable for Drag & Drop or Copy/Cut & Paste transfer.

See Also:
TransferHandler, DragSource, DropTarget, DataFlavor

Method Summary
 int getExportAction(S selection, ExportParameters parameters)
          Return the provided DnD actions for given selection.
 Object getTransferData(S selection, DataFlavor flavor, ExportParameters parameters)
          Return the transfer data representation of the given selection.
 List<? extends DataFlavor> populateTransferDataFlavors(S selection, ExportParameters parameters)
           Return the list of DataFlavor(s) supported by this transfer handler.
 

Method Detail

populateTransferDataFlavors

List<? extends DataFlavor> populateTransferDataFlavors(S selection,
                                                       ExportParameters parameters)

Return the list of DataFlavor(s) supported by this transfer handler. The DataFlavor(s) supported by this export handler may depend on the selection and the source ViewComponent.

If some prerequisites of the specific ExportHandler are not met, it may return an empty list.

Parameters:
selection - the selection of items to export
parameters - the export parameters containing additional context information
Returns:
the (possibly empty) list of DataFlavors.

getTransferData

Object getTransferData(S selection,
                       DataFlavor flavor,
                       ExportParameters parameters)
                       throws UnsupportedFlavorException
Return the transfer data representation of the given selection.

Parameters:
selection - the selection of items to export
flavor - The flavor in which the transfer data shall be exported
parameters - the export parameters containing additional context information
Returns:
the transfer data representation
Throws:
UnsupportedFlavorException - if the flavor is not supported by this ExportHandler

getExportAction

int getExportAction(S selection,
                    ExportParameters parameters)
Return the provided DnD actions for given selection.

Parameters:
selection - the selection of items to export
parameters - the export parameters containing additional context information
Returns:
int one of the DnDConstants action constants. Returns which DnD action will be provided by this export 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.