Version: 1.1.1

ca.ucalgary.seahawk.gui
Class FileAndTextTransferHandler

java.lang.Object
  extended by javax.swing.TransferHandler
      extended by ca.ucalgary.seahawk.gui.FileAndTextTransferHandler
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
MobyObjectTransferHandler

public class FileAndTextTransferHandler
extends TransferHandler

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.TransferHandler
TransferHandler.DropLocation, TransferHandler.TransferSupport
 
Field Summary
 
Fields inherited from class javax.swing.TransferHandler
COPY, COPY_OR_MOVE, LINK, MOVE, NONE
 
Constructor Summary
FileAndTextTransferHandler(MobyContentGUI mcg)
          By default, opens pasted data in a new tab of the GUI
FileAndTextTransferHandler(MobyContentGUI mcg, boolean openNewDataInNewTab)
           
 
Method Summary
 boolean canImport(JComponent comp, DataFlavor[] flavors)
          Overrides same method in parent class, tells the dropper if we'll accept the data before the drop is actually attempted.
 String convertToString(Transferable t, boolean get_plain_text)
           
 void exportDone(JComponent c, Transferable t, int action)
           
 int getSourceActions(JComponent c)
          Our components are copy-only
 boolean importData(JComponent c, Transferable t)
           
 
Methods inherited from class javax.swing.TransferHandler
canImport, exportAsDrag, exportToClipboard, getCopyAction, getCutAction, getPasteAction, getVisualRepresentation, importData
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileAndTextTransferHandler

public FileAndTextTransferHandler(MobyContentGUI mcg)
By default, opens pasted data in a new tab of the GUI


FileAndTextTransferHandler

public FileAndTextTransferHandler(MobyContentGUI mcg,
                                  boolean openNewDataInNewTab)
Method Detail

importData

public boolean importData(JComponent c,
                          Transferable t)
Overrides:
importData in class TransferHandler

convertToString

public String convertToString(Transferable t,
                              boolean get_plain_text)
                       throws Exception
Throws:
Exception

canImport

public boolean canImport(JComponent comp,
                         DataFlavor[] flavors)
Overrides same method in parent class, tells the dropper if we'll accept the data before the drop is actually attempted.

Overrides:
canImport in class TransferHandler

getSourceActions

public int getSourceActions(JComponent c)
Our components are copy-only

Overrides:
getSourceActions in class TransferHandler

exportDone

public void exportDone(JComponent c,
                       Transferable t,
                       int action)
Overrides:
exportDone in class TransferHandler

Version: 1.1.1

Submit a bug or feature
Generated: Sat May 29 04:26:35 EDT 2010