Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » 3.1M6: accelerator on action = NullPointerException in ActionContributionItem.update
3.1M6: accelerator on action = NullPointerException in ActionContributionItem.update [message #453970] Fri, 15 April 2005 09:21 Go to next message
Christophe Labouisse is currently offline Christophe LabouisseFriend
Messages: 5
Registered: July 2009
Junior Member
When migrating a standalone SWT/JFace application from 3.1M5a to 3.1M6 I
got the following error when opening the main application window:

java.lang.NullPointerException
at org.eclipse.jface.action.ActionContributionItem.update(Actio nContributionItem.java:749)
at org.eclipse.jface.action.ActionContributionItem.fill(ActionC ontributionItem.java:281)
at org.eclipse.jface.action.MenuManager.update(MenuManager.java :627)
at org.eclipse.jface.action.MenuManager.update(MenuManager.java :549)
at org.eclipse.jface.action.MenuManager.fill(MenuManager.java:2 32)
at org.eclipse.jface.action.MenuManager.update(MenuManager.java :627)
at org.eclipse.jface.action.MenuManager.update(MenuManager.java :549)
at org.eclipse.jface.action.MenuManager.createMenuBar(MenuManag er.java:158)
at org.eclipse.jface.window.ApplicationWindow.createTrimWidgets (ApplicationWindow.java:332)
at org.eclipse.jface.window.ApplicationWindow.configureShell(Ap plicationWindow.java:320)
at net.ggtools.grand.ui.widgets.GraphWindow.configureShell(Grap hWindow.java:251)
at org.eclipse.jface.window.Window.createShell(Window.java:483)
at org.eclipse.jface.window.Window.create(Window.java:417)
at org.eclipse.jface.window.Window.open(Window.java:770)
at net.ggtools.grand.ui.Application.run(Application.java:251)

I find out that this is related to the accelerator in the actions I add to
the menus, and removing the call to setAccelerator in the actions
constructors solves the problem. Since I'd really like to have
accelerators I'm wondering if I don't miss something in my menu creation.

The ApplicationWindow menu manager is created like this:

protected MenuManager createMenuManager() {
manager = new MenuManager();
manager.add(new FileMenuManager(this));
...
}

With the constructor of FileMenuManager being:

public FileMenuManager(GraphWindow window) {
super("File");
add(new OpenFileAction(window));
...
}
Re: 3.1M6: accelerator on action = NullPointerException in ActionContributionIte [message #453971 is a reply to message #453970] Fri, 15 April 2005 09:36 Go to previous messageGo to next message
Matthias Germann is currently offline Matthias GermannFriend
Messages: 2
Registered: July 2009
Junior Member
I have the same problem.
Re: 3.1M6: accelerator on action = NullPointerException in ActionContributionItem.update [message #453979 is a reply to message #453970] Fri, 15 April 2005 13:02 Go to previous message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
Hi Christophe,

I can't comment on whether your code is correct/complete, but I notice that
your stack looks similar to recent report
https://bugs.eclipse.org/bugs/show_bug.cgi?id=90415 , so you should CC
yourself to it to see its resolution.

Grant

"Christophe Labouisse" <news-1@labouisse.org> wrote in message
news:pan.2005.04.15.09.21.00.936910@labouisse.org...
> When migrating a standalone SWT/JFace application from 3.1M5a to 3.1M6 I
> got the following error when opening the main application window:
>
> java.lang.NullPointerException
> at
org.eclipse.jface.action.ActionContributionItem.update(Actio nContributionIte
m.java:749)
> at
org.eclipse.jface.action.ActionContributionItem.fill(ActionC ontributionItem.
java:281)
> at
org.eclipse.jface.action.MenuManager.update(MenuManager.java :627)
> at
org.eclipse.jface.action.MenuManager.update(MenuManager.java :549)
> at org.eclipse.jface.action.MenuManager.fill(MenuManager.java:2 32)
> at
org.eclipse.jface.action.MenuManager.update(MenuManager.java :627)
> at
org.eclipse.jface.action.MenuManager.update(MenuManager.java :549)
> at
org.eclipse.jface.action.MenuManager.createMenuBar(MenuManag er.java:158)
> at
org.eclipse.jface.window.ApplicationWindow.createTrimWidgets (ApplicationWind
ow.java:332)
> at
org.eclipse.jface.window.ApplicationWindow.configureShell(Ap plicationWindow.
java:320)
> at
net.ggtools.grand.ui.widgets.GraphWindow.configureShell(Grap hWindow.java:251
)
> at org.eclipse.jface.window.Window.createShell(Window.java:483)
> at org.eclipse.jface.window.Window.create(Window.java:417)
> at org.eclipse.jface.window.Window.open(Window.java:770)
> at net.ggtools.grand.ui.Application.run(Application.java:251)
>
> I find out that this is related to the accelerator in the actions I add to
> the menus, and removing the call to setAccelerator in the actions
> constructors solves the problem. Since I'd really like to have
> accelerators I'm wondering if I don't miss something in my menu creation.
>
> The ApplicationWindow menu manager is created like this:
>
> protected MenuManager createMenuManager() {
> manager = new MenuManager();
> manager.add(new FileMenuManager(this));
> ...
> }
>
> With the constructor of FileMenuManager being:
>
> public FileMenuManager(GraphWindow window) {
> super("File");
> add(new OpenFileAction(window));
> ...
> }
>
>
Previous Topic:CardLayout equivalent TabFolder
Next Topic:Scrolled and only one scrollbar
Goto Forum:
  


Current Time: Sun Mar 07 21:48:07 GMT 2021

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

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

Back to the top