[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Custom Composites

hello,

are there any guides on how to create custom composites?

im currently extending composite and as my "components" are special composites, they do something like this:

// PanelComponents is-a Compositum, it contains several Copoments
// but adds a panel-look, statusbar, etc..
class PanelComponent extends Composite {

public void init() {
	content = new Group(this, SWT.NONE);
	content.setText(getLabel());
	
	status = new Group(this, SWT.NONE);
	RowLayout statusLayout = new RowLayout(SWT.HORIZONTAL);
	status.setLayout(statusLayout);
	}
}

class ScaleComponent extends Composite {

public void init() {
	scale = new Scale(this, SWT.HORIZONTAL);
	}
}

i want these components to be used like this:

PanelComponent panel = new PanelComponent(some-parent-composite, style);
ScaleComponent scale = new ScaleComponent(panel, style);
FoobarComponent foobar = new FoobarComponent(panel, style);

so the components like scale and foobar should be registered into the panel-component (compositum) and displayed in the panel's content-group. how to achieve this?

any advice?

thanks,
kai