-
Bug
-
Resolution: Incomplete
-
P4
-
None
-
6
-
x86
-
windows_xp
FULL PRODUCT VERSION :
1.5.0._11-b03
1.6.0_02-b06
A DESCRIPTION OF THE PROBLEM :
The Javadoc for DropTarget.addDropTargetListener describes it as UNICAST only, and indeed DropTarget itself only accepts one DropTargetListener, (& I haven't worked out how to replace this, as I haven't found a way to get a ref to it to call removeDropTargetListener() with)
However, JTable.getDropTarget() returns TransferHandler.SwingDropTarget, which does accept multiple DropTargetListeners, breaking the javadoc documentation for DropTarget.addDropTargetListener. But this was exactly what I wanted to provide custom drag under feedback without having to re-implement the gory drop details. I could leave that to the default listener. The only downside is that I'm relying on an undocumented feature.
This info was only available in the source code. Either DropTarget should be changed to accept multiple listeners, or the javadoc to addDropTargetListener() should mention that subclasses could allow multiple listeners. Or both. Of course it makes sense for only one listener to implement the drop, and perhaps this is where the interface actually has 2 roles which should have been separated?
REPRODUCIBILITY :
This bug can be reproduced always.
1.5.0._11-b03
1.6.0_02-b06
A DESCRIPTION OF THE PROBLEM :
The Javadoc for DropTarget.addDropTargetListener describes it as UNICAST only, and indeed DropTarget itself only accepts one DropTargetListener, (& I haven't worked out how to replace this, as I haven't found a way to get a ref to it to call removeDropTargetListener() with)
However, JTable.getDropTarget() returns TransferHandler.SwingDropTarget, which does accept multiple DropTargetListeners, breaking the javadoc documentation for DropTarget.addDropTargetListener. But this was exactly what I wanted to provide custom drag under feedback without having to re-implement the gory drop details. I could leave that to the default listener. The only downside is that I'm relying on an undocumented feature.
This info was only available in the source code. Either DropTarget should be changed to accept multiple listeners, or the javadoc to addDropTargetListener() should mention that subclasses could allow multiple listeners. Or both. Of course it makes sense for only one listener to implement the drop, and perhaps this is where the interface actually has 2 roles which should have been separated?
REPRODUCIBILITY :
This bug can be reproduced always.