Can't visually edit a subclass of Composite

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

Can't visually edit a subclass of Composite

Postby georg777 » Thu Feb 01, 2007 1:55 pm

Hi ,
I have a class that is a subclass of "org.eclipse.swt.widgets.Composite". I
need to subclass this class.
When I do this, I cannot use the SWT designer to add widgets. It just shows a
blank area that will not allow any widgets to be dragged onto.
Please advise. The FAQ said that it is ok to extend anything that is a subclass
of Control, as long as it has a two arg constructor. This subclass does, indeed
have that.
thanks for your help. It is holding me up a bit.
BTW I am using version 5.0.1.
Cheers,
Georg Haugland
georg777
 
Posts: 3
Joined: Thu Feb 01, 2007 1:40 pm

Re: Can't visually edit a subclass of Composite

Postby Eric Clayberg » Thu Feb 01, 2007 2:56 pm

1) You are using an old version of the product. Please update to v6.1.0.

2) We need to see a test case and your Eclipse ".log" file (assuming it contains any relevant exceptions).
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

Postby georg777 » Thu Feb 01, 2007 3:31 pm

I will upgrade tonight, but here is the test case.

I have a class called InternalShell that extends Composite.
This class has a constructor :

public InternalShell(Composite parent, int style){
super(parent, style);
}

This class shows up fine in the Windows Builder and I can add widgets to it.

When I create a subclass of this subclass:
RuleEditor extends InternalShell

public RuleEditor (Composite parent, int style){
super(parent, style);
}

There isn't even a little tab that let's me go to design mode.

I tried tricking your plugin by using the menu and creating a new composite , THEN changign the parent class to InternalShell and it let me have the design view, but wouldn't allow any adding of widgets..

I am sending the log as an attachment, there does seem to be relevant info in there .
georg777
 
Posts: 3
Joined: Thu Feb 01, 2007 1:40 pm

Postby georg777 » Thu Feb 01, 2007 4:00 pm

I installed the newest version, and tried to view the subclass of InternalShell called RuleEditor in the design tab.
THis time it DID give me a design tab, but when I clicked on it, an error dialog appeared that said
"java.lang.IllegalArgumentException: Argument cannot be null.

NOte:
This is with the nest version of WindowBuilderPro
georg777
 
Posts: 3
Joined: Thu Feb 01, 2007 1:40 pm

Postby Eric Clayberg » Thu Feb 01, 2007 5:46 pm

georg777 wrote:I will upgrade tonight, but here is the test case.

You need to actually send us a test case.

georg777 wrote:I have a class called InternalShell that extends Composite.
This class has a constructor :
public InternalShell(Composite parent, int style){
super(parent, style);
}
This class shows up fine in the Windows Builder and I can add widgets to it.
When I create a subclass of this subclass:
RuleEditor extends InternalShell
public RuleEditor (Composite parent, int style){
super(parent, style);
}
There isn't even a little tab that let's me go to design mode.

That means that you aren't opening the class with the Designer Editor. You are using the standard Java Editor instead.

georg777 wrote:I tried tricking your plugin by using the menu and creating a new composite , THEN changign the parent class to InternalShell and it let me have the design view, but wouldn't allow any adding of widgets.

There is no need to "trick" anything. Designer's Composite wizard allows you to specify a superclass.

georg777 wrote:I am sending the log as an attachment, there does seem to be relevant info in there .

Your log show numerous compilation problems (and other exceptions) associated with your InternalShell class. Since you did not include a test case, I don't know what those might be. You will need to correct those exceptions before Designer will be able to edit that class.
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

Postby Eric Clayberg » Thu Feb 01, 2007 5:53 pm

georg777 wrote:I installed the newest version, and tried to view the subclass of InternalShell called RuleEditor in the design tab.
THis time it DID give me a design tab, but when I clicked on it, an error dialog appeared that said
"java.lang.IllegalArgumentException: Argument cannot be null.

Your log shows various exceptions with your InternalShell class...

Code: Select all
java.lang.NullPointerException
   at com.novocode.naf.swt.custom.ishell.InternalShell.<init>(InternalShell.java:153)

java.lang.Error: Unresolved compilation problem:
   Type mismatch: cannot convert from Composite to DesktopForm
   at com.novocode.naf.swt.custom.ishell.InternalShell.<init>(InternalShell.java:84)

You will need to fix those exceptions before you will be able to edit that class or any class that uses it.

We still need to see a test case.
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