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

Bug 252509

Summary: [Editor] Using the delete key in the XSD design view fails for items that are normally removed by the delete key
Product: [WebTools] WTP Source Editing Reporter: Steven Hung <sghung>
Component: wst.xsdAssignee: Keith Chong <keith.chong.ca>
Status: CLOSED FIXED QA Contact: Keith Chong <keith.chong.ca>
Severity: normal    
Priority: P3 CC: valentinbaciu
Version: 3.1   
Target Milestone: 3.1 M4   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Steven Hung CLA 2008-10-28 18:11:34 EDT
Build ID: WTP 3.1

Steps To Reproduce:
Note: this problem is not always reproducible, however this problem has been reproduced on two different machines

1) Open GolfCountryClub/GolfCountryClub.xsd
2) Create a new complex type
3) Add a few elements
4) Use the delete key on these newly created elements and nothing happens
5) Go to the source view and then back to the design view
6) Now delete the same elements using the keyboard and it works

More information:
Comment 1 Keith Chong CLA 2008-11-12 09:19:35 EST
Appears to be a timing issue.   If you add the elements slowly, it's fine.

When the edit manager is initializing the cell editor, it tries to save the current delete action (which should be applicable to the design view, which handles the deletion of XSD components).  This is saved because when the cell editor is active, a different delete action handler is enabled, which is applicable to the cell editor (for deleting characters in the text field).  The editor part's global Action Bar is updated to use these specific actions at appropriate times.

When the edit manager is bringing down the cell editor, it tries to restore the 'saved' delete action, which should be the one applicable to the design view.

This all should happen ok, when you add the elements slowly...ie.  after adding an element, dismiss the cell editor first before invoking the context menu to add another element.

If you add elements in rapid succession, the 'old' cell editor may still be active, so when it's trying to bring up the 'new' cell editor for the new element, it will actually save the cell editor's delete action, since that is the current one in the action bar.

Target fix for 3.1M4.
Comment 2 Keith Chong CLA 2008-11-12 17:00:23 EST
Fix released for 3.1 M4
Comment 3 Keith Chong CLA 2008-12-17 12:09:57 EST
Steven, this works fine for me using wtp-sdk-S-3.1M4-20081215095735.
Comment 4 Valentin Baciu CLA 2008-12-17 13:43:36 EST
Closing.