Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Strange Behavior when adding a FormPage into SharedHeaderFormEditor
Strange Behavior when adding a FormPage into SharedHeaderFormEditor [message #328055] Tue, 13 May 2008 12:39 Go to next message
Jan Kohnert is currently offline Jan KohnertFriend
Messages: 196
Registered: July 2009
Senior Member
Hello,

Im using a SharedHeaderFormEditor and want to add a FormPage into the
editors 'body'
In SharedHeaderFormEditor addPages function I'm doing the following:

@Override
protected void addPages() {
try {
myFormPage = new MyFormPage(this, MyFormPage.ID, "MyFormPage");
addPage(0, myFormPage);
} catch (PartInitException e) {
e.printStackTrace();
}
}

As result I'm getting an exception refer to FormEditor line 490:
java.lang.NullPointerException
at org.eclipse.ui.forms.editor.FormEditor.pageChange(FormEditor .java:490)
at
org.eclipse.ui.forms.editor.FormEditor.setActivePage(FormEdi tor.java:623)
...

When debugging into this I find the following line:
fpage.getPartControl().setMenu(getContainer().getMenu());

In my case getContainer().getMenu() returns null. (why ever...). This
seems to cause the exception.

Is this a bug, or is there something obviously wrong with my code?

Thanks,
Jan
Re: Strange Behavior when adding a FormPage into SharedHeaderFormEditor [message #328057 is a reply to message #328055] Tue, 13 May 2008 12:59 Go to previous message
Jan Kohnert is currently offline Jan KohnertFriend
Messages: 196
Registered: July 2009
Senior Member
I solved the problem myself.

I'd tried araound for hours before posting this email. Just a minute after
this I thought to try one last thing.
My mistake was to create the forms content in createPartControl() and not
in createFormContent().

Thanks
Previous Topic:Troubleshooting OSGi
Next Topic:How To Access Folders When Testing Plugins
Goto Forum:
  


Current Time: Thu Jul 25 22:34:03 GMT 2024

Powered by FUDForum. Page generated in 0.03125 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top