Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Problem in PreferenceDialog
Problem in PreferenceDialog [message #449618] Tue, 16 May 2006 18:08 Go to next message
Eclipse User
Originally posted by: aschneid.onlinehome.de

Hi
I have a problem when calling the following from an RCP application:

PreferenceNode one = new PreferenceNode( "one", new FieldEditorPageOne());

PreferenceNode two = new PreferenceNode("two", "Logging", null,
FieldEditorPageTwo.class.getName());

The first one works, but when selecting the second page, I get the
following in the log:

!ENTRY org.eclipse.jface 4 2 2006-05-16 23:57:14.438
!MESSAGE Problems occurred when invoking code from plug-in:
"org.eclipse.jface".
!STACK 0
java.lang.NullPointerException
at
org.eclipse.jface.preference.PreferenceNode.createPage(Prefe renceNode.java:161)
at
org.eclipse.jface.preference.PreferenceDialog.createPage(Pre ferenceDialog.java:1241)

What can be wrong?

Regards,
Achim
Re: Problem in PreferenceDialog [message #449633 is a reply to message #449618] Wed, 17 May 2006 07:53 Go to previous messageGo to next message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

asc wrote:
> Hi
> I have a problem when calling the following from an RCP application:
>
> PreferenceNode one = new PreferenceNode( "one", new FieldEditorPageOne());
>
> PreferenceNode two = new PreferenceNode("two", "Logging", null,
> FieldEditorPageTwo.class.getName());
>
> The first one works, but when selecting the second page, I get the
> following in the log:
>
> !ENTRY org.eclipse.jface 4 2 2006-05-16 23:57:14.438
> !MESSAGE Problems occurred when invoking code from plug-in:
> "org.eclipse.jface".
> !STACK 0
> java.lang.NullPointerException
> at
> org.eclipse.jface.preference.PreferenceNode.createPage(Prefe renceNode.java:161)

If I had to guess, the PreferenceNode is returning null from the call to
createObject(classname) ... set a breakpoint in
PreferenceNode#createPage() and you can find out.

Later,
PW


Re: Problem in PreferenceDialog [message #449692 is a reply to message #449633] Wed, 17 May 2006 16:52 Go to previous messageGo to next message
Eclipse User
Originally posted by: aschneid.onlinehome.de

Paul Webster wrote:
>
> If I had to guess, the PreferenceNode is returning null from the call to
> createObject(classname) ... set a breakpoint in
> PreferenceNode#createPage() and you can find out.
>
> Later,
> PW

Paul,
yes, yes you are right - setting the breakpoint shows that the
createObject is failing because the classname somehow cannot be
resolved- but the question is why?

Regards,
Achim
Re: Problem in PreferenceDialog [message #449728 is a reply to message #449692] Thu, 18 May 2006 07:54 Go to previous messageGo to next message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

asc wrote:
>
> Paul,
> yes, yes you are right - setting the breakpoint shows that the
> createObject is failing because the classname somehow cannot be
> resolved- but the question is why?

your plugin depends on the jface plugin ... but that means that jface
can't load a class from your plugin. That's why it fails.

i.e. you can use that constructor in a java app using JFace+SWT, but not
in a plugin, in RCP or Eclipse.

Later,
PW


Re: Problem in PreferenceDialog [message #449831 is a reply to message #449728] Sat, 20 May 2006 18:10 Go to previous messageGo to next message
Eclipse User
Originally posted by: aschneid.onlinehome.de

Paul Webster wrote:
> asc wrote:
>
>>
>> Paul,
>> yes, yes you are right - setting the breakpoint shows that the
>> createObject is failing because the classname somehow cannot be
>> resolved- but the question is why?
>
>
> your plugin depends on the jface plugin ... but that means that jface
> can't load a class from your plugin. That's why it fails.
>
> i.e. you can use that constructor in a java app using JFace+SWT, but not
> in a plugin, in RCP or Eclipse.
>
> Later,
> PW

Paul, (sorry, where on business trip)

do you mean its not possible at all? Or is there any way?

Regards
Achim
Re: Problem in PreferenceDialog [message #449857 is a reply to message #449831] Tue, 23 May 2006 09:38 Go to previous message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

asc wrote:
>
> Paul, (sorry, where on business trip)
>
> do you mean its not possible at all? Or is there any way?

I mean AFAIK, you cannot use that constructor while in a plugin. The
problem is the jface plugin cannot load a class from a dependent plugin.

If you were just using the jface jar as part of a java app
(non-eclipse), it would work.

Later,
PW


Previous Topic:system32 and DLLs
Next Topic:Tasks and Bookmarks
Goto Forum:
  


Current Time: Thu Jul 31 13:44:47 EDT 2014

Powered by FUDForum. Page generated in 0.02103 seconds