Custom controls not working

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 controls not working

Postby TlighT » Tue Sep 27, 2005 7:28 am

I can't get custom controls to work. What I do is:

- Create a new SWT Project using the wizard
- Create a new Composite using the wizard (changing nothing to the generated code)
- Create a new Application Window using the wizard
- In the designer "Choose Composite"
- Select the composite I just created

And then nothing happens. I should be able to drop the custom composite on the application shell, right? I cannot use custom composites or other custom controls. They show up in the preferences page under "Custom Controls", but not in the designer palette. Also, when I manually add the custom control to the code, the designer doesn't show it.

Is there any code I should add to the controls so that the designer recognizes them?

I've tried different builds of the designer (4.1.0 and 4.1.1) but none worked. I'm using Eclipse 3.1 (build id: I20050627-1435).

I'm using a lot of custom controls, so the designer becomes unusable when I can't use them in it.
Posts: 2
Joined: Tue Sep 13, 2005 3:46 am

Re: Custom controls not working

Postby Eric Clayberg » Tue Sep 27, 2005 6:26 pm

Make sure that your custom control is complied (a .class file should exist) so that it can be instantiated.

Try refreshing/rebuilding your project. I would expect it to work after that.
Eric Clayberg
Software Engineering Manager

Author: "Eclipse Plug-ins"
Eric Clayberg
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Postby TlighT » Wed Sep 28, 2005 5:49 am

The problem was that Eclipse was running with jre 1.4, but all my projects were compiled for 1.5, so the designer was unable to load the generated .class files.

Running eclipse with the 1.5 jre solved the problem.
Posts: 2
Joined: Tue Sep 13, 2005 3:46 am

Return to SWT Designer

Who is online

Users browsing this forum: No registered users and 1 guest