[e-lang] java.awt.dnd.DropTarget unsafe?

Kevin Reid kpreid at mac.com
Fri Jul 14 09:49:57 EDT 2006


On Jul 13, 2006, at 23:27, marcs at skyhunter.com wrote:

> Kevin Reid wrote:
>> Why is java.awt.dnd.DropTarget marked unsafe, yet made available via
>> the powerbox to caplets?
>
> ...
> Given this, it is probably clear what the problem is. If the user  
> drag/drops onto the renderer-controlled portion of the screen, the  
> browser frame developer needs to be able to ensure that the frame  
> owner receives the drop, and also ensure that the renderer does not  
> receive the drop until the browser frame has determined that the  
> renderer should indeed receive the drop. Hence we grant the  
> authority via the powerbox, not via an ambient "safe" API call.
>
> Does that make sense?

Yes.

Ignoring the limitations of AWT, this restriction could also be  
provided by allowing containers to intercept drag events before their  
contents see them. This makes the restriction you describe  
implementable on a finer-grained basis.

However, it would slightly break another property (which the AWT/ 
Swing taming also doesn't provide): that a component can directly  
interact with the user, without being affected by its container. This  
is important if the component holds more authority than the container.

-- 
Kevin Reid                            <http://homepage.mac.com/kpreid/>




More information about the e-lang mailing list