org.apache.log4j.chainsaw.dnd
Class FileDnDTarget

java.lang.Object
  extended by org.apache.log4j.chainsaw.dnd.FileDnDTarget
All Implemented Interfaces:
java.awt.dnd.DropTargetListener, java.util.EventListener

public class FileDnDTarget
extends java.lang.Object
implements java.awt.dnd.DropTargetListener

This class provides all the functionality to work out when files are dragged onto a particular JComponent instance, and then notifies listeners via the standard PropertyChangesListener semantics to indicate that a list of files have been dropped onto the target. If you wish to know whan the files have been dropped, subscribe to the "fileList" property change.

Author:
psmith

Field Summary
protected  int acceptableActions
           
 
Constructor Summary
FileDnDTarget(javax.swing.JComponent c)
           
 
Method Summary
 void addDropTargetToComponent(javax.swing.JComponent c)
           
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
           
 void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
           
 void dragEnter(java.awt.dnd.DropTargetDragEvent e)
           
 void dragExit(java.awt.dnd.DropTargetEvent dte)
           
 void dragOver(java.awt.dnd.DropTargetDragEvent e)
           
 void drop(java.awt.dnd.DropTargetDropEvent dtde)
           
 void dropActionChanged(java.awt.dnd.DropTargetDragEvent dtde)
           
 java.util.List getFileList()
           
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
           
 void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

acceptableActions

protected int acceptableActions
Constructor Detail

FileDnDTarget

public FileDnDTarget(javax.swing.JComponent c)
Method Detail

addDropTargetToComponent

public void addDropTargetToComponent(javax.swing.JComponent c)

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Parameters:
listener -

addPropertyChangeListener

public void addPropertyChangeListener(java.lang.String propertyName,
                                      java.beans.PropertyChangeListener listener)
Parameters:
propertyName -
listener -

dragEnter

public void dragEnter(java.awt.dnd.DropTargetDragEvent e)
Specified by:
dragEnter in interface java.awt.dnd.DropTargetListener

dragExit

public void dragExit(java.awt.dnd.DropTargetEvent dte)
Specified by:
dragExit in interface java.awt.dnd.DropTargetListener

dragOver

public void dragOver(java.awt.dnd.DropTargetDragEvent e)
Specified by:
dragOver in interface java.awt.dnd.DropTargetListener

drop

public void drop(java.awt.dnd.DropTargetDropEvent dtde)
Specified by:
drop in interface java.awt.dnd.DropTargetListener

dropActionChanged

public void dropActionChanged(java.awt.dnd.DropTargetDragEvent dtde)
Specified by:
dropActionChanged in interface java.awt.dnd.DropTargetListener

getFileList

public final java.util.List getFileList()
Returns:
Returns the fileList.

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Parameters:
listener -

removePropertyChangeListener

public void removePropertyChangeListener(java.lang.String propertyName,
                                         java.beans.PropertyChangeListener listener)
Parameters:
propertyName -
listener -


Copyright © 2007 Apache Software Foundation. All Rights Reserved.