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

Bug 318634

Summary: [ui] Dragging things from the Snippet or Palette view does not bring focus to the editor
Product: [WebTools] WTP Source Editing Reporter: Sarika Sinha <sarika.sinha>
Component: wst.sseAssignee: Sarika Sinha <sarika.sinha>
Status: RESOLVED FIXED QA Contact: Nitin Dahyabhai <thatnitind>
Severity: normal    
Priority: P3 CC: neil.hauge, nsand.dev
Version: unspecifiedFlags: nsand.dev: pmc_approved? (david_williams)
nsand.dev: pmc_approved? (raghunathan.srinivasan)
nsand.dev: pmc_approved? (naci.dai)
nsand.dev: pmc_approved? (deboer)
neil.hauge: pmc_approved+
nsand.dev: pmc_approved? (kaloyan)
nsand.dev: review+
thatnitind: review+
Target Milestone: 3.2.1   
Hardware: PC   
OS: Windows XP   
Whiteboard: PMC_approved
Attachments:
Description Flags
Setting focus after drop
nsand.dev: iplog+
patch none

Description Sarika Sinha CLA 2010-07-01 12:15:50 EDT
Build Identifier: I20100602-1502

If we drag something from Snippet or Palette view to Source editor, focus does not change to source editor.

Reproducible: Always

Steps to Reproduce:
1.Drag a widget from palette to source editor.
2.Focus remains at Palette view, Focus should have changed to Editor.
Comment 1 Sarika Sinha CLA 2010-07-01 13:11:31 EDT
Created attachment 173241 [details]
Setting focus after drop

This patch sets the focus to the target editor after drop action.
Comment 2 Nick Sandonato CLA 2010-07-01 13:43:05 EDT
Thanks, Sarika. This patch looks good to me.

I think this can alleviate some user frustration when it comes to adding DND content to our editors.

Nitin, would you mind taking a look at this for 3.2.1?
Comment 3 Nitin Dahyabhai CLA 2010-07-02 11:13:50 EDT
How well does this work both in editors that are just the StructuredTextEditor and cases where it's a Source page?  Since it activates the editor, what about cases where the file's out of sync with the workspace?
Comment 4 Nick Sandonato CLA 2010-07-02 11:55:59 EDT
Created attachment 173315 [details]
patch

Checks for parent editor parts for cases like the XML editor.
Comment 5 Nitin Dahyabhai CLA 2010-07-02 14:04:28 EDT
Approved.  Please write-up the PMC review details.
Comment 6 Nick Sandonato CLA 2010-07-02 14:15:46 EDT
* Explain why you believe this is a stop-ship defect. Or, if it is a "hotbug" (requested by an adopter) please document it as such.

Needed for an adopter as a usability issue. Context is never switched back over to the editor when something is dragged onto it, which can prevent immediate typing without the user manually focusing the editor again.

* Is there a work-around? If so, why do you believe the work-around is insufficient?

No.

* How has the fix been tested? Is there a test case attached to the bugzilla record? Has a JUnit Test been added?

The existing unit tests have been run along with ad hoc testing of drag and drop features on various SSE-based editors.

Give a brief technical overview. Who has reviewed this fix?

Once an item has been dropped onto the editor, the drop target adapter for Structured Source Editors will now activate the editor part that the item was dropped on. This will allow the user to immediately begin typing into the source of the editor again. It's a small update to our implementation of the drop target adapter.

Nitin and I have both reviewed the patch.

* What is the risk associated with this fix?

Very low.
Comment 7 Nick Sandonato CLA 2010-07-06 10:13:18 EDT
Released to Maintenance and HEAD.