Project: Eclipse_Platform_UI
Bug 182122 [Dialogs] CheckedTreeSelectionDialog#createSelectionButtons(Composite) fails to align the selection buttons to the right
Reported: 2007-04-12 08:54:55 | Status: verified fixed

Build ID: I20070323-1616 The first of the layout problems is that the selection buttons have unnecessary space on the right: 1. CheckedTreeSelectionDialog#createSelectionButtons(Composite) configures the buttonComposite it creates with a GridLayout that initially starts with 2 numColumns. 2. Later it uses Dialog#createButton(Composite,int,String,boolean) to create the buttons "Selection All" and "Deselect All" with their parent set to buttonComposite. Because the method in question retrieves the layout of the specified parent (i.e. buttonComposite) and increases its numColumns for each created Button, the GridLayout of buttonComposite ends up with numColumns set to 4 while there are only 2 Buttons. 3. So buttonComposite is left with unintended space on the right which is easily visible when buttonComposite is aligned to the right. The second of the layout problems is that the selection buttons are aligned to the left: 1. CheckedTreeSelectionDialog#createSelectionButtons(Composite) creates a GridData with GridData.HORIZONTAL_ALIGN_END|GridData.GRAB_HORIZONTAL which I think is intended to align buttonComposite to the right like ListSelectionDialog has the buttons "Select All" and "Deselect All" to the right. However, the GridData in question is not attached to any control with setLayoutData(Object) but is remembered in the argument composite using setData(Object) and doesn't seem to be retrieved later on. 2. So buttonComposite is left aligned to the left which is in contrast to the right-aligned buttons of ListSelectionDialog. More information: I think CheckedTreeSelectionDialog and ListSelectionDialog should be consistent and align the selection buttons to the same side.

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/CheckedTreeSelectionDialog.java