I built a simple RCP application that uses the CNF to display a data model.
When a CNF node is double clicked an editor is opened and the focus is
changed to the editor. If select another node, or click anywhere in the CNF
viewer without first clicking in the active view the CNF view does not
become active. I tried the same thing in Package Explorer and it worked
correctly. Is there a listener that I need to add to fix this?
"Francis Upton" <email@example.com> wrote in message
> As far as I know there is no other listener required for this. Can you
> say the version you are running and the platform?
I have exactly the same problem. I am also on 3.5 but i also had this under ganymede.
This appears to happen under windows and linux.
The strange thing is that this only happens in an RCP and not in the eclipse application itself.
Any help would be greatly appreciated as this leads to a problem of the selection not becoming active and so a double click (which opens the editor using a command) fails saying that the command was not found (as i have an activeWhen defined which requires a selection).
If anyone else is interested the issue is with setFocus in editors. Editors inheriting from FormEditor with pages added extending from FormPage, set the focus to the pages scrolled form. This seems to cause problems.
Overriding the setFocus method in the subclassed FormEditor and explicitly delegating setFocus to the subclassed FormPage (which then sets the focus to an internal control) seems to get rid of the problem.
I have resolved this issue. I am new to RCP so I had stubbed out an editor
that consisted of only a Label. When I changed that to a Text the focus
worked as expected. The setFocus method must set focus to a component that
can accept focus.