Custom widgets as reuasable components

SWT Designer allows you to create the views, editors, perspectives, pref pages, composites, etc. that comprise Eclipse SWT & RCP applications and plug-ins.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

Custom widgets as reuasable components

Postby DirkSegelhorst » Tue Apr 07, 2009 12:44 am

Hi

I am trying to create a custom widget (subclassing Composite) in order to have a reusable but extensible UI component. The current implementation adds a group and a button:

MyCustom extends Composite
|- Group
|- Button

Using the designer to add this custom widget to a user defined UI (e.g. a dialog), anything seems to works well, but I am not able to add any child widgets to the group. The designer knows only the MyCustom Composite but not the children (even if they are public). Is there any way to create reusable but extensible components like this?

Thanks
Dirk
DirkSegelhorst
 
Posts: 3
Joined: Tue Apr 07, 2009 12:32 am

Re: Custom widgets as reuasable components

Postby Eric Clayberg » Wed Apr 08, 2009 11:00 am

DirkSegelhorst wrote:I am trying to create a custom widget (subclassing Composite) in order to have a reusable but extensible UI component. The current implementation adds a group and a button:
MyCustom extends Composite
|- Group
|- Button
Using the designer to add this custom widget to a user defined UI (e.g. a dialog), anything seems to works well, but I am not able to add any child widgets to the group. The designer knows only the MyCustom Composite but not the children (even if they are public). Is there any way to create reusable but extensible components like this?

Designer handles this type of component just fine (see the following screen shot as an example). Just make sure that any exposed components have a public accessor.

CustomContainer.png
CustomContainer.png (157.14 KiB) Viewed 322 times
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA


Return to SWT Designer

Who is online

Users browsing this forum: No registered users and 2 guests