Class MemberTransferHandler
- java.lang.Object
-
- javax.swing.TransferHandler
-
- org.openstreetmap.josm.gui.dialogs.relation.MemberTransferHandler
-
- All Implemented Interfaces:
java.io.Serializable
public class MemberTransferHandler extends javax.swing.TransferHandler
A transfer handler that helps with importing / exporting members for relations.- Since:
- 10604
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
MemberTransferHandler.AbstractRelationMemberConverter<T extends PrimitiveId>
-
Constructor Summary
Constructors Constructor Description MemberTransferHandler()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canImport(javax.swing.TransferHandler.TransferSupport support)
private static int
computeInsertionRow(javax.swing.TransferHandler.TransferSupport support, MemberTable destination)
protected java.awt.datatransfer.Transferable
createTransferable(javax.swing.JComponent c)
protected void
exportDone(javax.swing.JComponent sourceComponent, java.awt.datatransfer.Transferable data, int action)
int
getSourceActions(javax.swing.JComponent c)
boolean
importData(javax.swing.TransferHandler.TransferSupport support)
protected <T extends PrimitiveId>
voidimportData(MemberTable destination, int insertRow, java.util.Collection<T> memberData, MemberTransferHandler.AbstractRelationMemberConverter<T> toMemberFunction)
private boolean
importDataAt(javax.swing.TransferHandler.TransferSupport support, MemberTable destination, int insertRow)
protected void
importPrimitiveData(javax.swing.TransferHandler.TransferSupport support, MemberTable destination, int insertRow)
protected void
importRelationMemberData(javax.swing.TransferHandler.TransferSupport support, MemberTable destination, int insertRow)
-
-
-
Constructor Detail
-
MemberTransferHandler
public MemberTransferHandler()
-
-
Method Detail
-
getSourceActions
public int getSourceActions(javax.swing.JComponent c)
- Overrides:
getSourceActions
in classjavax.swing.TransferHandler
-
createTransferable
protected java.awt.datatransfer.Transferable createTransferable(javax.swing.JComponent c)
- Overrides:
createTransferable
in classjavax.swing.TransferHandler
-
canImport
public boolean canImport(javax.swing.TransferHandler.TransferSupport support)
- Overrides:
canImport
in classjavax.swing.TransferHandler
-
importData
public boolean importData(javax.swing.TransferHandler.TransferSupport support)
- Overrides:
importData
in classjavax.swing.TransferHandler
-
computeInsertionRow
private static int computeInsertionRow(javax.swing.TransferHandler.TransferSupport support, MemberTable destination)
-
importDataAt
private boolean importDataAt(javax.swing.TransferHandler.TransferSupport support, MemberTable destination, int insertRow)
-
importRelationMemberData
protected void importRelationMemberData(javax.swing.TransferHandler.TransferSupport support, MemberTable destination, int insertRow) throws java.awt.datatransfer.UnsupportedFlavorException, java.io.IOException
- Throws:
java.awt.datatransfer.UnsupportedFlavorException
java.io.IOException
-
importPrimitiveData
protected void importPrimitiveData(javax.swing.TransferHandler.TransferSupport support, MemberTable destination, int insertRow) throws java.awt.datatransfer.UnsupportedFlavorException, java.io.IOException
- Throws:
java.awt.datatransfer.UnsupportedFlavorException
java.io.IOException
-
importData
protected <T extends PrimitiveId> void importData(MemberTable destination, int insertRow, java.util.Collection<T> memberData, MemberTransferHandler.AbstractRelationMemberConverter<T> toMemberFunction)
-
exportDone
protected void exportDone(javax.swing.JComponent sourceComponent, java.awt.datatransfer.Transferable data, int action)
- Overrides:
exportDone
in classjavax.swing.TransferHandler
-
-