Wizards - SWT - Composite

Subclasses of the SWT Composite or Group class can be created using the SWT Composite wizard. The wizard can be selected from the drop down Designer wizard menu or from the Eclipse New wizard.

To use the wizard, select the project source folder and package to contain the class. Then enter the class name and hit the Finish button.

Options are also provided to select either Composite or Group as the superclass.

 

Play movie. Requires a web connection.
Play Movie

 

The wizard generates the following code.

import org.eclipse.swt.widgets.Composite;
 
public class SWTCompositeTest extends Composite {
    public SWTCompositeTest(Composite parent, int style) {
        super(parent, style);
    }
    public void dispose() {
        super.dispose();
    }
    protected void checkSubclass() {
    }
}

SWT Composites can use any widget and layout manager.

Use the "Expose property..." item added to property table popup menu to expose any widget property as a public property of the class. Use the "Expose control" item added to the popup menu in the design view to add an accessor for any widget.