getDefault() returns null [message #234147] |
Sun, 25 April 2004 13:38  |
Eclipse User |
|
|
|
Originally posted by: dwojtas.myrealbox.com
Hi,
I havewritten a simple plugin with single preference page.
It is based on some samples found in the net.
This preference page makes use of the plugin.
Eg.
MyPlugin.getDefault().getPreferenceStore()
My preference page shows in the Window/Preferences menu,
but when I click in the pages tree to see my preference page I gen NPE
from getDefault()
What is the lifecycle of the plugin, when does it start?
How to make sure that my plugin started when I eter it's preference
page in configuration?
Darek
|
|
|
|
|
Re: getDefault() returns null [message #234766 is a reply to message #234338] |
Mon, 26 April 2004 16:02  |
Eclipse User |
|
|
|
Originally posted by: dwojtas.myrealbox.com
Thanks Christian!
That was it. Now it seems to work.
I added default, no arg constructor.
Do you know when exactly a call to
MyPlugin.getDefault().getPreferenceStore()
causes instantiation of the plugin?
What if at some point (but from some class within the plugin)
I call MyPlugin.getDefault() for the 1st time?
How does it know that it should initialize it before the 1st call?
Or maybe it can happen that it will not initialize before?
Darek
On Mon, 26 Apr 2004 10:33:07 +0200, "Christian Georgi" <...@test.com>
wrote:
>I recently had the same effect while porting my plugins to Eclipse 3.0. With
>this release, a plugin needs a default constructor under the condintions
>listed in the 3.0 porting guide:
>"Note also that if you mark you plug-in as 3.0 (using <?eclipse...?>) and
>your plug-in defines a Plugin class, you must either explicitly <import
>plugin="org.eclipse.core.runtime.compatibility"/> in the plug-in manifest or
>ensure that the Plugin class defines the default constructor."
>Disregarding this hint could cause the mentioned effect as the plugin
>doesn't get instantiated.
>
>Christian
>
>"Darek" <dwojtas@myrealbox.com> wrote in message
>news:rstn801hkpv54jp9fijotoag2rbkhn2tve@4ax.com...
>> Hi,
>>
>> I havewritten a simple plugin with single preference page.
>> It is based on some samples found in the net.
>> This preference page makes use of the plugin.
>> Eg.
>> MyPlugin.getDefault().getPreferenceStore()
>>
>> My preference page shows in the Window/Preferences menu,
>> but when I click in the pages tree to see my preference page I gen NPE
>> from getDefault()
>>
>> What is the lifecycle of the plugin, when does it start?
>> How to make sure that my plugin started when I eter it's preference
>> page in configuration?
>>
>> Darek
|
|
|
Powered by
FUDForum. Page generated in 0.07477 seconds