Bug 202382 - [Forms] Behaviour of Section with fixed style changed between Eclipse 3.0 and 3.1 (and later)
Summary: [Forms] Behaviour of Section with fixed style changed between Eclipse 3.0 and...
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: User Assistance (show other bugs)
Version: 3.1.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.4 M3   Edit
Assignee: Adam Archer CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2007-09-06 02:26 EDT by Kai Nacke CLA
Modified: 2007-10-19 16:08 EDT (History)
1 user (show)

See Also:


Attachments
Proposed fix for Eclipse 3.3 (497 bytes, patch)
2007-09-14 04:50 EDT, Kai Nacke CLA
kai: review?
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kai Nacke CLA 2007-09-06 02:26:34 EDT
Build ID: M20060118-1600

Steps To Reproduce:
1. Create a section and assign a shortcut:
final Section addressSection = toolkit.createSection(this, SWT.NONE);
addressSection.setText("&Adresse");

2. Add a text field to the section
final Composite nameComposite = toolkit.createComposite(addressComposite, SWT.NONE);
toolkit.createLabel(nameComposite, "Name", SWT.NONE);
final Text nameText = toolkit.createText(nameComposite, null, SWT.NONE);

3. Run this in a Eclipse 3.0 dialog. Pressing the shortcut key ALT-A moves the focus to the text input file nameText.

4. Run this in a Eclipse 3.1 dialog. Pressing the shortcut key ALT-A hides the section!


More information:
In the ExpandableComposite which is the base class of Section, there is always a TraverseListener added to the object. This TraverseListener always toggles the state of the section, even if isFixedStyle() returns true.

To restore the old behaviour, simply call programmaticToggleState() only if isFixedSytle() returns false.
Comment 1 Kai Nacke CLA 2007-09-14 04:50:27 EDT
Created attachment 78409 [details]
Proposed fix for Eclipse 3.3

A small patch implementing the solution suggested in the bug description.
Comment 2 Chris Goldthorpe CLA 2007-09-14 14:57:36 EDT
Adam, can you review this patch?
Comment 3 Adam Archer CLA 2007-10-19 15:24:43 EDT
The patch is fine. Setting a mnemonic on a non-expandable section is a slightly odd use case, but it does let you focus on it with a keyboard shortcut.

Regardless, we should certainly prevent the section from being collapsed in this case.

+1
Comment 4 Chris Goldthorpe CLA 2007-10-19 16:08:12 EDT
Patch committd to HEAD.