javax.swing
Class TransferHandler.SwingDropTarget

java.lang.Object
  extended byjava.awt.dnd.DropTarget
      extended byjavax.swing.TransferHandler.SwingDropTarget
All Implemented Interfaces:
DropTargetListener, EventListener, Serializable, UIResource
Enclosing class:
TransferHandler

static class TransferHandler.SwingDropTarget
extends DropTarget
implements UIResource

This is the default drop target for drag and drop operations if one isn't provided by the developer. DropTarget only supports one DropTargetListener and doesn't function properly if it isn't set. This class sets the one listener as the linkage of drop handling to the TransferHandler, and adds support for additional listeners which some of the ComponentUI implementations install to manipulate a drop insertion location.


Nested Class Summary
 
Nested classes inherited from class java.awt.dnd.DropTarget
DropTarget.DropTargetAutoScroller
 
Field Summary
private  EventListenerList listenerList
           
 
Fields inherited from class java.awt.dnd.DropTarget
 
Constructor Summary
(package private) TransferHandler.SwingDropTarget(JComponent c)
           
 
Method Summary
 void addDropTargetListener(DropTargetListener dtl)
          Adds a new DropTargetListener (UNICAST SOURCE).
 void dragEnter(DropTargetDragEvent e)
          The DropTarget intercepts dragEnter() notifications before the registered DropTargetListener gets them.
 void dragExit(DropTargetEvent e)
          The DropTarget intercepts dragExit() notifications before the registered DropTargetListener gets them.
 void dragOver(DropTargetDragEvent e)
          The DropTarget intercepts dragOver() notifications before the registered DropTargetListener gets them.
 void drop(DropTargetDropEvent e)
          The DropTarget intercepts drop() notifications before the registered DropTargetListener gets them.
 void dropActionChanged(DropTargetDragEvent e)
          The DropTarget intercepts dropActionChanged() notifications before the registered DropTargetListener gets them.
 void removeDropTargetListener(DropTargetListener dtl)
          Removes the current DropTargetListener (UNICAST SOURCE).
 
Methods inherited from class java.awt.dnd.DropTarget
addNotify, clearAutoscroll, createDropTargetAutoScroller, createDropTargetContext, getComponent, getDefaultActions, getDropTargetContext, getFlavorMap, initializeAutoscrolling, isActive, removeNotify, setActive, setComponent, setDefaultActions, setFlavorMap, updateAutoscroll
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

listenerList

private EventListenerList listenerList
Constructor Detail

TransferHandler.SwingDropTarget

TransferHandler.SwingDropTarget(JComponent c)
Method Detail

addDropTargetListener

public void addDropTargetListener(DropTargetListener dtl)
                           throws TooManyListenersException
Description copied from class: DropTarget
Adds a new DropTargetListener (UNICAST SOURCE).

Overrides:
addDropTargetListener in class DropTarget
Parameters:
dtl - The new DropTargetListener

Throws:
TooManyListenersException

removeDropTargetListener

public void removeDropTargetListener(DropTargetListener dtl)
Description copied from class: DropTarget
Removes the current DropTargetListener (UNICAST SOURCE).

Overrides:
removeDropTargetListener in class DropTarget
Parameters:
dtl - the DropTargetListener to deregister.

dragEnter

public void dragEnter(DropTargetDragEvent e)
Description copied from class: DropTarget
The DropTarget intercepts dragEnter() notifications before the registered DropTargetListener gets them.

Specified by:
dragEnter in interface DropTargetListener
Overrides:
dragEnter in class DropTarget
Parameters:
e - the DropTargetDragEvent

dragOver

public void dragOver(DropTargetDragEvent e)
Description copied from class: DropTarget
The DropTarget intercepts dragOver() notifications before the registered DropTargetListener gets them.

Specified by:
dragOver in interface DropTargetListener
Overrides:
dragOver in class DropTarget
Parameters:
e - the DropTargetDragEvent

dragExit

public void dragExit(DropTargetEvent e)
Description copied from class: DropTarget
The DropTarget intercepts dragExit() notifications before the registered DropTargetListener gets them.

Specified by:
dragExit in interface DropTargetListener
Overrides:
dragExit in class DropTarget
Parameters:
e - the DropTargetEvent

drop

public void drop(DropTargetDropEvent e)
Description copied from class: DropTarget
The DropTarget intercepts drop() notifications before the registered DropTargetListener gets them.

Specified by:
drop in interface DropTargetListener
Overrides:
drop in class DropTarget
Parameters:
e - the DropTargetDropEvent

dropActionChanged

public void dropActionChanged(DropTargetDragEvent e)
Description copied from class: DropTarget
The DropTarget intercepts dropActionChanged() notifications before the registered DropTargetListener gets them.

Specified by:
dropActionChanged in interface DropTargetListener
Overrides:
dropActionChanged in class DropTarget
Parameters:
e - the DropTargetDragEvent