ca.bc.webarts.widgets.dnd
Class FileDropBean
java.lang.Object
|
+--ca.bc.webarts.widgets.dnd.FileDropBean
- All Implemented Interfaces:
- java.io.Serializable
- public class FileDropBean
- extends java.lang.Object
- implements java.io.Serializable
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 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
- See Also:
- Serialized Form
Field Summary |
private javax.swing.event.EventListenerList |
listenerList
|
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
listenerList
private javax.swing.event.EventListenerList listenerList
FileDropBean
public FileDropBean()
- Creates new FileDropBean
addFileDropTarget
public void 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
removeFileDropTarget
public boolean removeFileDropTarget(java.awt.Component comp)
- Unregisters a component as a drop target.
- Parameters:
comp
- The component to unregister- Since:
- 1.1
addFileDropListener
public void addFileDropListener(FileDropListener listener)
- Register a listener for
FileDropEvent
s.
- Parameters:
listener
- The listener to register- Since:
- 1.1
removeFileDropListener
public void removeFileDropListener(FileDropListener listener)
- Unregister a listener for
FileDropEvent
s.
- Parameters:
listener
- The listener to unregister- Since:
- 1.1
fireFileDropHappened
protected void fireFileDropHappened(java.io.File[] files)
- Fires a
FileDropEvent
with the given non-null
list of dropped files.
- Parameters:
files
- The files that were dropped- Since:
- 1.1