gov.nasa.pds.ltdt.gui.util
Class ListTransferHandler
java.lang.Object
javax.swing.TransferHandler
gov.nasa.pds.ltdt.gui.util.ListTransferHandler
- All Implemented Interfaces:
- java.io.Serializable
public class ListTransferHandler
- extends javax.swing.TransferHandler
Handles data reformatting when a keyword got drag and drop from the
Dictionary List panel to Template Editing panel.
- Author:
- jwang
- See Also:
- Serialized Form
Fields inherited from class javax.swing.TransferHandler |
COPY, COPY_OR_MOVE, MOVE, NONE |
Method Summary |
boolean |
canImport(javax.swing.JComponent component,
java.awt.datatransfer.DataFlavor[] flavors)
flags true if the transferred data is indeed a string |
protected java.awt.datatransfer.Transferable |
createTransferable(javax.swing.JComponent component)
get a Transferable object |
protected java.lang.String |
exportString(javax.swing.JComponent component)
construct the string to be copied over to the target panel. |
int |
getSourceActions(javax.swing.JComponent component)
returns the type of action performed by this transfer |
Methods inherited from class javax.swing.TransferHandler |
exportAsDrag, exportDone, exportToClipboard, getCopyAction, getCutAction, getPasteAction, getVisualRepresentation, importData |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ListTransferHandler
public ListTransferHandler(MainWindow window)
exportString
protected java.lang.String exportString(javax.swing.JComponent component)
- construct the string to be copied over to the target panel.
The object type will be added with END OBJECT
The element type will be copied over straight
- Parameters:
component
-
- Returns:
- reformatted output string
createTransferable
protected java.awt.datatransfer.Transferable createTransferable(javax.swing.JComponent component)
- get a Transferable object
- Overrides:
createTransferable
in class javax.swing.TransferHandler
getSourceActions
public int getSourceActions(javax.swing.JComponent component)
- returns the type of action performed by this transfer
- Overrides:
getSourceActions
in class javax.swing.TransferHandler
canImport
public boolean canImport(javax.swing.JComponent component,
java.awt.datatransfer.DataFlavor[] flavors)
- flags true if the transferred data is indeed a string
- Overrides:
canImport
in class javax.swing.TransferHandler
Copyright © 2005-2008 NASA Jet Propulsion Laboratory, California Institute of Technology. All Rights Reserved.