Buggy code:
public class ActivityEnabler { private static final int ALL = 2 ; private static final int NONE = 0 ; private static final int SOME = 1 ; private ISelectionChangedListener selectionListener = new ISelectionChangedListener ( ) { public void selectionChanged ( SelectionChangedEvent event ) { } } ; private ICheckStateListener checkListener = new ICheckStateListener ( ) { public void checkStateChanged ( CheckStateChangedEvent event ) { } private void handleDuplicateActivities ( boolean checkedState , Object element ) { } private void handleActivityCheck ( Set checked , Object element ) { } private void handleRequiredActivities ( Set checked , Object element ) { } } ; protected CheckboxTreeViewer dualViewer ; private Set managedActivities = new HashSet ( 7 ) ; protected ActivityCategoryContentProvider provider = new ActivityCategoryContentProvider ( ) ; protected Text descriptionText ; private Properties strings ; private IMutableActivityManager activitySupport ; public ActivityEnabler ( IMutableActivityManager activitySupport , Properties strings ) { } public Control createControl ( Composite parent ) { Composite mainComposite = new Composite ( parent , SWT . NONE ) ; { GridLayout gridLayout = new GridLayout ( 1 , false ) ; gridLayout . marginHeight = 0 ; gridLayout . marginWidth = 0 ; mainComposite . setLayout ( gridLayout ) ; } Composite c = new Composite ( mainComposite , SWT . NONE ) ; c . setLayoutData ( new GridData ( GridData . FILL_HORIZONTAL ) ) ; { GridLayout gridLayout = new GridLayout ( 1 , true ) ; gridLayout . marginHeight = 0 ; gridLayout . marginWidth = 0 ; c . setLayout ( gridLayout ) ; } Label label = new Label ( c , SWT . NONE ) ; label . setText ( ( ( strings . getProperty ( ACTIVITY_NAME , ActivityEnabler_activities ) ) + ':' ) ) ; label . setLayoutData ( new GridData ( GridData . FILL_HORIZONTAL ) ) ; label . setFont ( parent . getFont ( ) ) ; dualViewer = new CheckboxTreeViewer ( c ) ; dualViewer . setSorter ( new ViewerSorter ( ) ) ; dualViewer . setLabelProvider ( new ActivityCategoryLabelProvider ( ) ) ; dualViewer . setContentProvider ( provider ) ; dualViewer . setInput ( activitySupport ) ; GridData data = new GridData ( GridData . FILL_HORIZONTAL ) ; GC gc = new GC ( dualViewer . getControl ( ) ) ; gc . setFont ( parent . getFont ( ) ) ; data . heightHint = Math . min ( Dialog . convertHeightInCharsToPixels ( gc . getFontMetrics ( ) , 18 ) , 200 ) ; gc . dispose ( ) ; dualViewer . getControl ( ) . setLayoutData ( data ) ; dualViewer . getControl ( ) . setFont ( parent . getFont ( ) ) ; Composite buttonComposite = new Composite ( c , SWT . NONE ) ; <START_BUG> buttonComposite . setLayoutData ( new GridData ( GridData . HORIZONTAL_ALIGN_END ) ) ; <END_BUG> { GridLayout gridLayout = new GridLayout ( 2 , true ) ; gridLayout . marginHeight = 0 ; gridLayout . marginWidth = 0 ; buttonComposite . setLayout ( gridLayout ) ; } Button selectAllButton = new Button ( buttonComposite , SWT . PUSH ) ; selectAllButton . setFont ( parent . getFont ( ) ) ; selectAllButton . setText ( ActivityEnabler_selectAll ) ; selectAllButton . addSelectionListener ( new SelectionAdapter ( ) { public void widgetSelected ( SelectionEvent e ) { toggleTreeEnablement ( true ) ; } } ) ; selectAllButton . setLayoutData ( new GridData ( GridData . FILL_BOTH ) ) ; Button deselectAllButton = new Button ( buttonComposite , SWT . PUSH ) ; deselectAllButton . setFont ( parent . getFont ( ) ) ; deselectAllButton . setText ( ActivityEnabler_deselectAll ) ; deselectAllButton . addSelectionListener ( new SelectionAdapter ( ) { public void widgetSelected ( SelectionEvent e ) { toggleTreeEnablement ( false ) ; } } ) ; deselectAllButton . setLayoutData ( new GridData ( GridData . FILL_BOTH ) ) ; c = new Composite ( mainComposite , SWT . NONE ) ; c . setLayoutData ( new GridData ( GridData . FILL_BOTH ) ) ; { GridLayout gridLayout = new GridLayout ( 1 , true ) ; gridLayout . marginHeight = 0 ; gridLayout . marginWidth = 0 ; c . setLayout ( gridLayout ) ; } label = new Label ( c , SWT . NONE ) ; label . setText ( ActivityEnabler_description ) ; label . setLayoutData ( new GridData ( GridData . FILL_HORIZONTAL ) ) ; label . setFont ( parent . getFont ( ) ) ; descriptionText = new Text ( c , ( ( ( ( SWT . READ_ONLY ) | ( SWT . WRAP ) ) | ( SWT . BORDER ) ) | ( SWT . V_SCROLL ) ) ) ; descriptionText . setFont ( parent . getFont ( ) ) ; descriptionText . setLayoutData ( new GridData ( ( ( GridData . FILL_BOTH ) | ( GridData . VERTICAL_ALIGN_BEGINNING ) ) ) ) ; setInitialStates ( ) ; dualViewer . addCheckStateListener ( checkListener ) ; dualViewer . addSelectionChangedListener ( selectionListener ) ; dualViewer . setSelection ( new StructuredSelection ( ) ) ; return mainComposite ; } private Collection getCategoryActivityIds ( String categoryId ) { } private void setInitialStates ( ) { } private void setEnabledStates ( Set enabledActivities ) { } public void updateActivityStates ( ) { } public void restoreDefaults ( ) { } protected void toggleTreeEnablement ( boolean enabled ) { } }

Fix:
buttonComposite . setLayoutData ( new GridData ( GridData . HORIZONTAL_ALIGN_BEGINNING ) ) ;