Constructor of class extending AbstractUIPlugin is not called [message #324491] |
Thu, 24 January 2008 21:24  |
Eclipse User |
|
|
|
Originally posted by: weber.lars.googlemail.com
Hi!
I'm about to write a plugin and I am stuck with nullpointer, I don't
understand. Google Codesearch and Krugle did not get me any further.
My class extends org.eclipse.ui.plugin.AbstractUIPlugin.
Everything works fine, but when I execute my plugin, then I get a
nullpointer exeption in my getStore() method.
I once called the constructor by myself, but then the getPreferenceStore
returns null.
As far as I have understood, the DClarePlugin Class is initialized by
Eclipse (Europa) and I don't have to do this? What did I misunderstand.
Where is the right place to initialize this class.
Thanks,
Lars
public class DClarePlugin extends AbstractUIPlugin {
private static DClarePlugin plugin;
public DClarePlugin() {
super();
plugin = this;
}
public static DClarePlugin getDefault() {
return plugin;
}
public static IPreferenceStore getStore() {
//getDefault returns NULL!
return getDefault().getPreferenceStore();
}
}
|
|
|
Re: Constructor of class extending AbstractUIPlugin is not called [message #324493 is a reply to message #324491] |
Fri, 25 January 2008 02:29   |
Eclipse User |
|
|
|
Originally posted by: merks.ca.ibm.com
This is a multi-part message in MIME format.
--------------010503010105080701020107
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
Lars,
Does your MANIFEST.MF contains a line like this?
Bundle-Activator: org.example.DClarePlugin
Lars Weber wrote:
> Hi!
>
> I'm about to write a plugin and I am stuck with nullpointer, I don't
> understand. Google Codesearch and Krugle did not get me any further.
>
> My class extends org.eclipse.ui.plugin.AbstractUIPlugin.
> Everything works fine, but when I execute my plugin, then I get a
> nullpointer exeption in my getStore() method.
>
> I once called the constructor by myself, but then the
> getPreferenceStore returns null.
> As far as I have understood, the DClarePlugin Class is initialized by
> Eclipse (Europa) and I don't have to do this? What did I
> misunderstand. Where is the right place to initialize this class.
>
>
> Thanks,
> Lars
>
>
> public class DClarePlugin extends AbstractUIPlugin {
> private static DClarePlugin plugin;
>
> public DClarePlugin() {
> super();
> plugin = this;
> }
>
> public static DClarePlugin getDefault() {
> return plugin;
> }
>
> public static IPreferenceStore getStore() {
> //getDefault returns NULL!
> return getDefault().getPreferenceStore();
> }
> }
>
--------------010503010105080701020107
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Lars,<br>
<br>
Does your MANIFEST.MF contains a line like this?<br>
<blockquote>Bundle-Activator: org.example.DClarePlugin <br>
</blockquote>
<br>
<br>
Lars Weber wrote:
<blockquote
cite="mid:24d1c319297301dd98a0b2d5d9d6cbb9$1@www.eclipse.org"
type="cite">Hi!
<br>
<br>
I'm about to write a plugin and I am stuck with nullpointer, I don't
understand. Google Codesearch and Krugle did not get me any further.
<br>
<br>
My class extends org.eclipse.ui.plugin.AbstractUIPlugin.
<br>
Everything works fine, but when I execute my plugin, then I get a
nullpointer exeption in my getStore() method.
<br>
<br>
I once called the constructor by myself, but then the
getPreferenceStore returns null. <br>
As far as I have understood, the DClarePlugin Class is initialized by
Eclipse (Europa) and I don't have to do this? What did I misunderstand.
Where is the right place to initialize this class.
<br>
<br>
<br>
Thanks,
<br>
Lars
<br>
<br>
<br>
public class DClarePlugin extends AbstractUIPlugin {
<br>
|
|
|
[solved] Re: Constructor of class extending AbstractUIPlugin is not called [message #324503 is a reply to message #324493] |
Fri, 25 January 2008 05:37  |
Eclipse User |
|
|
|
Originally posted by: weber.lars.googlemail.com
Thanks Ed!
That was the solution!
Greetings from Germany,
Lars
Ed Merks wrote:
> Does your MANIFEST.MF contains a line like this?
> Bundle-Activator: org.example.DClarePlugin
> Lars Weber wrote:
>> Hi!
>>
>> I'm about to write a plugin and I am stuck with nullpointer, I don't
>> understand. Google Codesearch and Krugle did not get me any further.
>>
>> My class extends org.eclipse.ui.plugin.AbstractUIPlugin.
>> Everything works fine, but when I execute my plugin, then I get a
>> nullpointer exeption in my getStore() method.
>>
>> I once called the constructor by myself, but then the
>> getPreferenceStore returns null.
>> As far as I have understood, the DClarePlugin Class is initialized by
>> Eclipse (Europa) and I don't have to do this? What did I
>> misunderstand. Where is the right place to initialize this class.
>>
>>
>> Thanks,
>> Lars
>>
>>
>> public class DClarePlugin extends AbstractUIPlugin {
>> private static DClarePlugin plugin;
>>
>> public DClarePlugin() {
>> super();
>> plugin = this;
>> }
>>
>> public static DClarePlugin getDefault() {
>> return plugin;
>> }
>>
>> public static IPreferenceStore getStore() {
>> //getDefault returns NULL!
>> return getDefault().getPreferenceStore();
>> }
>> }
>>
|
|
|
Powered by
FUDForum. Page generated in 0.04825 seconds