Can not split createFormContent method

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 not split createFormContent method

Postby dfayerma » Thu Jan 20, 2005 7:15 pm

On a PageEditor
If I split a createFormContent method into a several siple methods that are being calld from createFormContent, the Designer can not parse the Form with Null Pointer exception error.

Is it officially not supported?

Here is the stack trace:
java.lang.NullPointerException
at com.swtdesigner.model.swt.forms.control.FormsCompositeInfo.createSingleControl(SourceFile:58)
at com.swtdesigner.model.swt.widgets.control.ControlInfo.createControl(SourceFile:377)
at com.swtdesigner.model.swt.widgets.composite.AbstractCompositeInfo.createControl(SourceFile:135)
at com.swtdesigner.model.swt.widgets.composite.AbstractCompositeInfo.createControl(SourceFile:147)
at com.swtdesigner.model.swt.forms.control.FormsExpandableCompositeInfo.createControl(SourceFile:161)
at com.swtdesigner.model.swt.forms.control.FormsSectionInfo.createControl(SourceFile:111)
at com.swtdesigner.model.swt.widgets.composite.AbstractCompositeInfo.createControl(SourceFile:147)
at com.swtdesigner.model.swt.widgets.composite.AbstractCompositeInfo.createControl(SourceFile:147)
at com.swtdesigner.model.swt.widgets.custom.ScrolledCompositeInfo.createControl(SourceFile:57)
at com.swtdesigner.model.swt.widgets.composite.AbstractCompositeInfo.createControl(SourceFile:132)
at com.swtdesigner.model.JavaInfo.notifyPropertyChanged(SourceFile:5558)
at com.swtdesigner.model.swt.widgets.control.ControlInfo.notifyPropertyChanged(SourceFile:217)
at com.swtdesigner.model.JavaInfo.notifyPropertyChanged(SourceFile:5544)
at com.swtdesigner.gef.common.property.DesignerEditorPropertyComposite.handleRootNodeSelected(SourceFile:490)
at com.swtdesigner.gef.common.property.DesignerEditorPropertyComposite.updatePropertyComposite(SourceFile:643)
at com.swtdesigner.gef.DesignerEditor.parseCompilationUnit(SourceFile:755)
...
dfayerma
 
Posts: 30
Joined: Mon Sep 20, 2004 10:51 am
Location: Boston, USA

Re: Can not split createFormContent method

Postby Eric Clayberg » Thu Jan 20, 2005 7:37 pm

dfayerma wrote:On a PageEditor If I split a createFormContent method into a several siple methods that are being calld from createFormContent, the Designer can not parse the Form with Null Pointer exception error. Is it officially not supported?

It's supported just fine.

Convert the toolkit and body variables into fields before you extract any code into separate methods.

The extracted methods should have zero arguments.
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 dfayerma » Thu Jan 20, 2005 7:45 pm

Eric,
You are exactly on the money, I just found the same solution and was typing additional info for the message as I saw your reply.

It works now.
Thanks.
dfayerma
 
Posts: 30
Joined: Mon Sep 20, 2004 10:51 am
Location: Boston, USA


Return to SWT Designer

Who is online

Users browsing this forum: No registered users and 1 guest