net.iharder.dnd.FileDropBean Class Reference

List of all members.

Detailed Description

If you wish to use the FileDrop package as a JavaBean, this class will act as an interface to the FileDrop class that handles all the dirty work.

After instantiating the bean, add components as drop targets using the addFileDropTarget() method. If the component is a java.awt.Container, then all elements contained within will be marked as a drop target as well. Using the FileDrop technique manually in your code will give you more options.

I'm releasing this code into the Public Domain. Enjoy.

Original author: Robert Harder, rharder@usa.net

Author:
Robert Harder

rharder@usa.net

Version:
1.1


Public Member Functions

 FileDropBean ()
 Creates new FileDropBean.
void addFileDropListener (FileDropListener listener)
 Register a listener for FileDropEvents.
void addFileDropTarget (java.awt.Component comp)
 Registers a component as a drop target.
void removeFileDropListener (FileDropListener listener)
 Unregister a listener for FileDropEvents.
boolean removeFileDropTarget (java.awt.Component comp)
 Unregisters a component as a drop target.

Protected Member Functions

void fireFileDropHappened (java.io.File[] files)
 Fires a FileDropEvent with the given non-null list of dropped files.

Private Attributes

javax.swing.event.EventListenerList listenerList

Static Private Attributes

static final long serialVersionUID = -635164729709460738L
 Prevent serialization collisions.


Constructor & Destructor Documentation

net.iharder.dnd.FileDropBean.FileDropBean (  ) 

Creates new FileDropBean.


Member Function Documentation

void net.iharder.dnd.FileDropBean.addFileDropListener ( FileDropListener  listener  ) 

Register a listener for FileDropEvents.

Parameters:
listener The listener to register
Since:
1.1

void net.iharder.dnd.FileDropBean.addFileDropTarget ( java.awt.Component  comp  ) 

Registers a component as a drop target.

If the component is a container, then all elements contained within will also be registered as drop targets, though only the outer container will change borders during a drag and drop operation (and even then, only if the container is a Swing component).

Parameters:
comp The component to register as a drop target
Since:
1.1

void net.iharder.dnd.FileDropBean.removeFileDropListener ( FileDropListener  listener  ) 

Unregister a listener for FileDropEvents.

Parameters:
listener The listener to unregister
Since:
1.1

boolean net.iharder.dnd.FileDropBean.removeFileDropTarget ( java.awt.Component  comp  ) 

Unregisters a component as a drop target.

Parameters:
comp The component to unregister
Since:
1.1

void net.iharder.dnd.FileDropBean.fireFileDropHappened ( java.io.File[]  files  )  [protected]

Fires a FileDropEvent with the given non-null list of dropped files.

Parameters:
files The files that were dropped
Since:
1.1


Member Data Documentation

final long net.iharder.dnd.FileDropBean.serialVersionUID = -635164729709460738L [static, private]

Prevent serialization collisions.

javax.swing.event.EventListenerList net.iharder.dnd.FileDropBean.listenerList [private]

Initial value:

        new javax.swing.event.EventListenerList()


The documentation for this class was generated from the following file:
Generated on Wed Aug 8 17:02:59 2007 for CALO by  doxygen 1.5.2