org.hd.d.pg2k.clApp.uploader
Class FileTransferHandler

java.lang.Object
  extended by javax.swing.TransferHandler
      extended by org.hd.d.pg2k.clApp.uploader.FileTransferHandler
All Implemented Interfaces:
java.io.Serializable

 class FileTransferHandler
extends javax.swing.TransferHandler

Class to help DnD (drag-and-drop) files into the JWS uploader. Package-visible for access by the GUI classes.

TODO: Extend this to accept URLs, eg dragged from a browser.


Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.TransferHandler
javax.swing.TransferHandler.DropLocation, javax.swing.TransferHandler.TransferSupport
 
Field Summary
(package private)  javax.swing.JCheckBox autoSuffixCheckBox
          The "auto" file-guess mode check box; never null.
private  UploaderLogic logic
          The business-logic component; never null.
private static long serialVersionUID
           
(package private)  UploadInfoBean uib
          The exhibit description bean; never null.
(package private)  javax.swing.table.AbstractTableModel uploadTableModel
          The model for the table so we can force a redraw; never null.
 
Fields inherited from class javax.swing.TransferHandler
COPY, COPY_OR_MOVE, LINK, MOVE, NONE
 
Constructor Summary
FileTransferHandler(javax.swing.JCheckBox autoSuffixCheckBox, javax.swing.table.AbstractTableModel uploadTableModel, UploaderLogic logic, UploadInfoBean uib)
          Create a new instance ready to receive files and drop them into the selected-files database.
 
Method Summary
 boolean canImport(javax.swing.JComponent c, java.awt.datatransfer.DataFlavor[] flavors)
          Returns true iff we can import at least one of the specified data flavors.
private  boolean hasFileFlavor(java.awt.datatransfer.DataFlavor[] flavors)
           
private  boolean hasStringFlavor(java.awt.datatransfer.DataFlavor[] flavors)
          To accept URLs as text strings?
 boolean importData(javax.swing.JComponent c, java.awt.datatransfer.Transferable t)
          Attempt to import file lists, or http and ftp URLs.
 
Methods inherited from class javax.swing.TransferHandler
canImport, createTransferable, exportAsDrag, exportDone, exportToClipboard, getCopyAction, getCutAction, getPasteAction, getSourceActions, getVisualRepresentation, importData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

logic

private final UploaderLogic logic
The business-logic component; never null.


uploadTableModel

final javax.swing.table.AbstractTableModel uploadTableModel
The model for the table so we can force a redraw; never null.


autoSuffixCheckBox

final javax.swing.JCheckBox autoSuffixCheckBox
The "auto" file-guess mode check box; never null.


uib

final UploadInfoBean uib
The exhibit description bean; never null.

Constructor Detail

FileTransferHandler

FileTransferHandler(javax.swing.JCheckBox autoSuffixCheckBox,
                    javax.swing.table.AbstractTableModel uploadTableModel,
                    UploaderLogic logic,
                    UploadInfoBean uib)
Create a new instance ready to receive files and drop them into the selected-files database.

Method Detail

importData

public boolean importData(javax.swing.JComponent c,
                          java.awt.datatransfer.Transferable t)
Attempt to import file lists, or http and ftp URLs.

Overrides:
importData in class javax.swing.TransferHandler

canImport

public boolean canImport(javax.swing.JComponent c,
                         java.awt.datatransfer.DataFlavor[] flavors)
Returns true iff we can import at least one of the specified data flavors. This will be false unless:

Overrides:
canImport in class javax.swing.TransferHandler

hasFileFlavor

private boolean hasFileFlavor(java.awt.datatransfer.DataFlavor[] flavors)

hasStringFlavor

private boolean hasStringFlavor(java.awt.datatransfer.DataFlavor[] flavors)
To accept URLs as text strings?


DHD Multimedia Gallery V1.53.0

Copyright (c) 1996-2009, Damon Hart-Davis. All rights reserved.