Combobox in Eclipse Forms

Eclipse Forms is a framework for displaying widgets in a more website like style. It also has some convenient ways for creating these widget instances. You just need to create a FormToolkit instance and call the create methods.

FormToolkit toolkit = new FormToolkit(page.getDisplay());
Form form = toolkit.createForm(page);

toolkit.createText(form.getBody(), SWT.BORDER);

But some widgets are not out-of-the-box supported by the FormToolkit class. You can then create the widget by hand and use some toolkit methods to adjust the painting of the widget.

Control c = new MyControl(form.getBody());


In case of the combobox which is not out-of-the-box supported by the FormToolkit class you can use the CCombo widget.

CCombo combobox = new CCombo(form.getBody(), SWT.FLAT | SWT.BORDER);