Point size = computeSize (SWT.DEFAULT, SWT.DEFAULT); setSize (size); setPreferredSize (size);
public void setControl (Control control) {	checkWidget ();	if (control != null) {		if (control.isDisposed()) error (SWT.ERROR_INVALID_ARGUMENT);		if (control.parent != parent) error (SWT.ERROR_INVALID_PARENT);	}	int index = parent.indexOf (this);	if (index == -1) return;	Control newControl = control;	Control oldControl = this.control;	int hwnd = parent.handle;	int hwndChild = 0;	if (newControl != null) hwndChild = control.handle;	REBARBANDINFO rbBand = new REBARBANDINFO ();	rbBand.cbSize = REBARBANDINFO.sizeof;	rbBand.fMask = OS.RBBIM_CHILD;	rbBand.hwndChild = hwndChild;	this.control = newControl;	/*	* Feature in Windows.  When Windows sets the rebar band child,	* it makes the new child visible and hides the old child.  The	* fix is to save and restore the visibility of the controls.	*/			boolean hideNew = newControl != null && !newControl.getVisible ();	boolean showOld = oldControl != null && oldControl.getVisible ();	OS.SendMessage (hwnd, OS.RB_SETBANDINFO, index, rbBand);	if (hideNew) newControl.setVisible (false);	if (showOld) oldControl.setVisible (true);}