Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 351468

Summary: Enhance DesignerSourceDropTargetListener to support resource transfers
Product: [WebTools] Java Server Faces Reporter: Preston Appel <preston.appel>
Component: UIAssignee: Carlin Rogers <carlin.rogers>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: preston.appel, raghunathan.srinivasan
Version: unspecified   
Target Milestone: 3.3.1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Patch to allow resources to be dragged to the WPE none

Description Preston Appel CLA 2011-07-07 11:53:59 EDT
Build Identifier: I20110613-1736

Please enhance the drag-and-drop capabilities of the web page editor's source pane to allow for resources to be dragged to it.  The idea would be to then transform the dragged resource into a tag that would be inserted into the web page editor.

Reproducible: Always

Steps to Reproduce:
Currently, there is no way to drag a file to the web page editor and insert a tag based on that file.
Comment 1 Preston Appel CLA 2011-07-21 17:04:18 EDT
Created attachment 200125 [details]
Patch to allow resources to be dragged to the WPE

Patch does the following/all changes are to DesignerSourceDropTargetListener:

1.  Adds ResourceTransfer.getInstance() to the Transfer array that is returned from getTransfers method.

2.  Adds an else if clause to the getCommand method.  If ResourceTransfer.getInstance().isSupportedType(event.currentDataType)), then the code tries to adapt the file to an ITagDropSourceData and uses that in its command.

3.  Adds a check for a resource transfer supported type in the dragOver method.  Without this, the drop occurs at the position 0,0 in the WPE.
Comment 2 Carlin Rogers CLA 2011-07-22 23:28:45 EDT
The patch looks good. Checked it into HEAD. Thanks for the contribution Preston.