Bug 82942 - [content assist] Content assist for controls created by cell editor does not work
Summary: [content assist] Content assist for controls created by cell editor does not ...
Status: RESOLVED INVALID
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2005-01-17 03:28 EST by Stefan Holzknecht CLA
Modified: 2007-06-22 10:04 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Holzknecht CLA 2005-01-17 03:28:16 EST
We are using the new content assistant feature available in text controls
created by cell editors (these cell editors are used at several places, e.g. in
property sources, in dialogs..). Because of limitations in jface code the
disposing and life time  of the text controls does not work correctly. It
happens that a 'glue'-handler does not install or uninstall correctly in case a
table (or other controls) contains more than one content assist enabled control
or in case the text control gets disposed.
The code responsible for that seems to be located in:
org.eclipse.jface.contentassist.AbstractControlContentAssistSubjectAdapter line
   600 and following:
			/*
			 * @see
org.eclipse.swt.events.FocusListener#focusGained(org.eclipse.swt.events.FocusEvent)
			 */
			public void focusGained(FocusEvent e) {
				// install a CueHandler on every parent control
				if (DEBUG)
					System.out.println("Focus Gained: " + e.widget); //$NON-NLS-1$

				if (fHoverHandler == null) {
					fHoverHandler= new HoverHandler(this);
					fControl.addMouseTrackListener(fHoverHandler);
				}
				
				Control c= fControl.getParent();
				while (c != null) {
					if (DEBUG)
						System.out.println("install CueHandler: " + c.toString()); //$NON-NLS-1$
					CueHandler cueHandler= new CueHandler(this);
					Assert.isTrue(c.getData(ANNOTATION_HANDLER) == null, "parent control has
CueHandler: " + c.toString()); //$NON-NLS-1$
					c.setData(ANNOTATION_HANDLER, cueHandler);
					c.addPaintListener(cueHandler);
					c.addMouseTrackListener(cueHandler);
					c.redraw();
					if (c instanceof Shell)
						break;
					else
						c= c.getParent();
				}
			}

This code just accept only one installed control. The nice Assert statement is
bothering in particular.
Comment 1 Dani Megert CLA 2005-01-17 09:54:02 EST
Which build?

>Because of limitations in jface code the disposing and life time  of the text 
>controls does not work correctly.
To which bug or document do you refer?

Please use a better summary next time or risk that it gets closed as WORKSFORME
when the developer goes through the summary list.

Reopen the bug once the additional information has been provided.
Comment 2 Dani Megert CLA 2007-06-22 09:59:17 EDT
Get rid of deprecated state.
Comment 3 Dani Megert CLA 2007-06-22 10:04:32 EDT
.