uk.ac.cisban.rod.gui.functions
Class TextTransferHandler
java.lang.Object
javax.swing.TransferHandler
uk.ac.cisban.rod.gui.functions.TextTransferHandler
- All Implemented Interfaces:
- java.io.Serializable
public class TextTransferHandler
- extends javax.swing.TransferHandler
Works together with ClipboardAdapter
to allow cut, copy, and paste
from right-click menus.
- See Also:
- Serialized Form
Nested classes/interfaces inherited from class javax.swing.TransferHandler |
javax.swing.TransferHandler.DropLocation, javax.swing.TransferHandler.TransferSupport |
Fields inherited from class javax.swing.TransferHandler |
COPY, COPY_OR_MOVE, LINK, MOVE, NONE |
Method Summary |
boolean |
canImport(javax.swing.TransferHandler.TransferSupport support)
We only support importing strings. |
protected java.awt.datatransfer.Transferable |
createTransferable(javax.swing.JComponent c)
Bundle up the data for export. |
protected void |
exportDone(javax.swing.JComponent c,
java.awt.datatransfer.Transferable data,
int action)
When the export is complete, remove the old text if the action
was a move. |
int |
getSourceActions(javax.swing.JComponent c)
These text fields handle both copy and move actions. |
boolean |
importData(javax.swing.TransferHandler.TransferSupport support)
Perform the actual import. |
Methods inherited from class javax.swing.TransferHandler |
canImport, exportAsDrag, exportToClipboard, getCopyAction, getCutAction, getPasteAction, getVisualRepresentation, importData |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TextTransferHandler
public TextTransferHandler()
importData
public boolean importData(javax.swing.TransferHandler.TransferSupport support)
- Perform the actual import. This method supports both drag and
drop and cut/copy/paste.
- Overrides:
importData
in class javax.swing.TransferHandler
createTransferable
protected java.awt.datatransfer.Transferable createTransferable(javax.swing.JComponent c)
- Bundle up the data for export.
- Overrides:
createTransferable
in class javax.swing.TransferHandler
getSourceActions
public int getSourceActions(javax.swing.JComponent c)
- These text fields handle both copy and move actions.
- Overrides:
getSourceActions
in class javax.swing.TransferHandler
exportDone
protected void exportDone(javax.swing.JComponent c,
java.awt.datatransfer.Transferable data,
int action)
- When the export is complete, remove the old text if the action
was a move.
- Overrides:
exportDone
in class javax.swing.TransferHandler
canImport
public boolean canImport(javax.swing.TransferHandler.TransferSupport support)
- We only support importing strings.
- Overrides:
canImport
in class javax.swing.TransferHandler
Copyright © 2010. All Rights Reserved.