Community
Participate
Working Groups
Build Identifier: 20100218-1602 setFocus() on FormEditor inherits from MultiPageEditorPart. In the case of an IFormPage page, this sends focus directly to the ScrolledForm control managed by ManagedForm, bypassing the focus behavior implemented by ManagedForm and using the behavior of ScrolledForm, which is the same as any other Composite. I suggest that either ManagedForm should return a control that delegates focus traversal to the managed form, or FormEditor's setFocus() should override MultiPageEditorPart to explicitly handle focus for form pages. A workaround is to override setFocus() in the editor (MyLyn's TaskEditor appears to do this), or in the child controls (the PDE editor seems to take this approach). Reproducible: Always Steps to Reproduce: 1. Create a FormEditor. 2. Add an IFormPage to the editor with some child controls and IFormParts. 3. Open the editor. 4. Defocus and refocus on the page (for example, by switching editors/pages). 5. Focus will be on the first control accepting focus, not the first IFormPart.
Can you attach an example plug-in which illustrates the problem?
Created attachment 182943 [details] FormEditor focus behavior example Source code for a simple example FormEditor, demonstrating inconsistent focus behavior. The form consists of two identical pages containing two SectionPart objects, each containing a Composite with two Text controls and a Button control. The left SectionPart attempts to control focus using IFormPart.setFocus(). This only works when programmatically triggered using the "Focus IFormPart" button. The right SectionPart attempts to control focus using Control.setFocus(). This works when the Section client is focused (by clicking on it, for example). Flipping pages should demonstrate the focus behavior of FormEditor.setFocus() (inherited from MultiPageEditorPart), which is to focus on the first focusable control. (In this case, the first Section's description.) ManagedForm.setFocus() is not used. I don't recall why this behavior bothered me originally. Perhaps I expected too much of the IFormPart focus mechanism.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug. If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie.