com.levigo.jadice.swing.dnd
Class CompositeExportHandler<S>

java.lang.Object
  extended by com.levigo.jadice.swing.dnd.CompositeExportHandler<S>
All Implemented Interfaces:
ExportHandler<S>

public class CompositeExportHandler<S>
extends Object
implements ExportHandler<S>

An ExportHandler encompassing a set of delegate ExportHandlers. 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.

See Also:
CompositeImportHandler

Constructor Summary
CompositeExportHandler(ExportHandler<S>... delegates)
          Create a CompositeExportHandler using the given array of delegate handlers.
CompositeExportHandler(List<? extends ExportHandler<S>> delegates)
          Create a CompositeExportHandler using the given list of delegate handlers.
 
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<DataFlavor> populateTransferDataFlavors(S selection, ExportParameters parameters)
           Return the list of DataFlavor(s) supported by this transfer handler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompositeExportHandler

public CompositeExportHandler(ExportHandler<S>... delegates)
Create a CompositeExportHandler using the given array of delegate handlers.

Parameters:
delegates - the delegate ExportHandlers

CompositeExportHandler

public CompositeExportHandler(List<? extends ExportHandler<S>> delegates)
Create a CompositeExportHandler using the given list of delegate handlers.

Parameters:
delegates - the delegate ExportHandlers
Method Detail

getTransferData

public Object getTransferData(S selection,
                              DataFlavor flavor,
                              ExportParameters parameters)
                       throws UnsupportedFlavorException
Description copied from interface: ExportHandler
Return the transfer data representation of the given selection.

Specified by:
getTransferData in interface ExportHandler<S>
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

populateTransferDataFlavors

public List<DataFlavor> populateTransferDataFlavors(S selection,
                                                    ExportParameters parameters)
Description copied from interface: ExportHandler

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.

Specified by:
populateTransferDataFlavors in interface ExportHandler<S>
Parameters:
selection - the selection of items to export
parameters - the export parameters containing additional context information
Returns:
the (possibly empty) list of DataFlavors.

getExportAction

public int getExportAction(S selection,
                           ExportParameters parameters)
Description copied from interface: ExportHandler
Return the provided DnD actions for given selection.

Specified by:
getExportAction in interface ExportHandler<S>
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.