package editor.gui.ccp.handler;

import java.awt.datatransfer.Transferable;
import java.util.Collection;
import java.util.function.Supplier;

import javax.swing.JComponent;
import javax.swing.TransferHandler;

import editor.database.card.Card;
import editor.gui.ccp.data.CardTransferData;

@SuppressWarnings("serial")
public class InventoryExportHandler extends TransferHandler
{
    private final Supplier<? extends Collection<? extends Card>> cards;

    public InventoryExportHandler(Supplier<? extends Collection<? extends Card>> c)
    {
        cards = c;
    }

    @Override
    public int getSourceActions(JComponent c)
    {
        return TransferHandler.COPY;
    }

    @Override
    public Transferable createTransferable(JComponent c)
    {
        return new CardTransferData(cards.get());
    }
}
@@ -283,16 +283,149 @@
 rData;%0A%0A
+/**%0A * This class is a handler for expording copied data from the inventory. It only%0A * supports copying single copies of cards.%0A */%0A
 @Suppres
@@ -506,16 +506,80 @@
 ndler%0A%7B%0A
+    /** Function for generating the list of cards to export. */%0A
     priv
@@ -643,16 +643,210 @@
 cards;%0A%0A
+    /**%0A     * Create a new inventory export handler that determines the cards to export%0A     * using the given function.%0A     * %0A     * @param c supplier of the list of cards to export%0A     */%0A
     publ

Add documentation to inventory exporter