Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Constructor of class extending AbstractUIPlugin is not called
Constructor of class extending AbstractUIPlugin is not called [message #324491] Thu, 24 January 2008 21:24 Go to next message
Eclipse UserFriend
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 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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();
>> }
>> }
>>
Previous Topic:splashHandler
Next Topic:getImageDescriptorFromProgram, what format filename input parameter expects ?
Goto Forum:
  


Current Time: Tue Sep 16 17:23:09 EDT 2025

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

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

Back to the top