Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 56840 - Delete a component using the delete key causes compile errors
Summary: Delete a component using the delete key causes compile errors
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: VE (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Richard Kulp CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 57022 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-03-30 17:40 EST by Peter Walker CLA
Modified: 2011-06-13 11:38 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Walker CLA 2004-03-30 17:40:06 EST
If you delete a component either from the canvas or a container, it deletes the 
field, the getter/initialization method and one character beyond the method 
causing compile errors if the extra character is not a blank.

Create a class extending JPanel and drop a JButton onto it. Select the button 
and delete it using the delete key. The button source code is delete and also 
the closing brace for the class is deleted.

Note: if you delete the button using any other mechanism it works fine (e.g. 
MB2-->Delete; the Delete icon on the toolbar; etc.).
Comment 1 Srimanth CLA 2004-04-02 14:15:00 EST
*** Bug 57022 has been marked as a duplicate of this bug. ***
Comment 2 Gili Mendel CLA 2004-04-07 10:08:00 EDT
It seems that Eclipse now binds a "org.eclipse.ui.edit.delete" command
to the DEL key.  Not sure if the code is complete, but the CU editor uses an
inner, package protected class (AdaptedSourceViewer() from
createJavaSourceViewer()) as the ITextOperationTarget.class target for the
(withing the rest) delete command.

To get a stable M8 build, I put a workaround (hack) to disable this command when
the JavaSource pane is not in focus, and enable it back when it is.  ... had to
use reflection to get into the Command's API.  

I am leaving this defect open so that we can fix it properly later on, but for
now, it is not a blocker anymore because the delete is working properly with
this hack (see the focusListener in the JavaVisualEditorPart)

Rich, open a bugzilla on JDT, if you feel that we need AdaptedSourceViewer to be
protected (not package protected).


Comment 3 Leopold Welsch CLA 2004-05-04 09:45:35 EDT
Hm' since my inital one (57022) is directed to this one I wanna add an new issue
with the solution here which is in 1.0 RC1:

I add a button on a panel, Click on the Button and a Text-Field appears. I press
DEL-Key and !!!! a character in the Code-pane is deleted. Quite NAUGHTY because
this is at ANY place of the Text!!!!

Perhaps a better solution is required.
Comment 4 Richard Kulp CLA 2004-05-04 10:36:15 EDT
This is an SWT problem that GEF will try to work around. They are aware of it
and it will be coming in a later GEF driver.
Comment 5 Peter Walker CLA 2004-08-17 17:48:20 EDT
I can longer recreate this problem on the latest VE code base. Either GEF fixed
this or some other code took care of it.
I tried deleting the component using the delete key which worked fine... leaving
the code intact.
I also tried the scenario with changing the text of a component using direct
edit (using the little text field) and this worked fine also.
Comment 6 Richard Kulp CLA 2004-09-17 10:27:08 EDT
Setting to 1.0M3 for ship.
Comment 7 Richard Kulp CLA 2004-09-20 12:37:39 EDT
Now that 1.0 is released, marking as verified.
Comment 8 Richard Kulp CLA 2004-09-20 12:39:04 EDT
Now that 1.0 is released, marking as closed.