Community
Participate
Working Groups
Create a "Hello RCP" application. Add <extension point="org.eclipse.ui.actionSets"> <actionSet label="KeyBindingActionSet" visible="true" id="org.eclipse.ui.actionSet.keyBindings"> <action label="showKeyAssist" class="org.eclipse.ui.internal.handlers.ShowKeyAssistHandler" menubarPath="help/group.main" id="org.eclipse.ui.actions.showKeyAssistHandler" definitionId="org.eclipse.ui.window.showKeyAssist"> </action> </actionSet> </extension> to plugin.xml Launch the application. Press CTRL+SHIFT+L. Observe the NPE.
Actually you also have to change ApplicationWorkbenchAdvisor#getInitialWindowPerspectiveId to return null which is allowed by the spec.
Created attachment 20556 [details] fix Listeners should be informed of window activation even if no initial perspective (page) is supplied.
Created attachment 20557 [details] fix 2 This fix 2 modifies WorkbenchKeyboard#windowListener to also listen on windowOpened events. The first fix modifies Workbench#busyOpenWorkbenchWindow to fire a windowActivated event in case no initial perspective id is supplied. I'm not intimately familiar with the inner workings of both classes therefore I'm not able to decide which fix is the "better" one. Both resolve the NPE though.
Can you please attach the stack trace?
!SESSION 2005-05-02 17:44:13.530 ----------------------------------------------- eclipse.buildId=unknown java.version=1.5.0_01 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=de_DE Framework arguments: -application test.application -pdelaunch Command-line arguments: -application test.application -data C:\Dokumente und Einstellungen\Dawnfly\Desktop\eclipse-SDK-I20050426-1700-win32\runtime-EclipseApplication -dev file:C:/Dokumente und Einstellungen/Dawnfly/Desktop/eclipse-SDK-I20050426-1700-win32/workspace/.metadata/.plugins/org.eclipse.pde.core/Eclipse Application/dev.properties -pdelaunch -os win32 -ws win32 -arch x86 !ENTRY org.eclipse.ui 4 4 2005-05-02 17:44:36.613 !MESSAGE Unhandled event loop exception !ENTRY org.eclipse.ui 4 0 2005-05-02 17:44:36.623 !MESSAGE java.lang.NullPointerException !STACK 0 java.lang.NullPointerException at org.eclipse.ui.internal.keys.KeyAssistDialog.registerShellType(KeyAssistDialog.java:771) at org.eclipse.ui.internal.keys.KeyAssistDialog.createContents(KeyAssistDialog.java:475) at org.eclipse.jface.window.Window.create(Window.java:418) at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:996) at org.eclipse.ui.internal.keys.KeyAssistDialog.open(KeyAssistDialog.java:739) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.openMultiKeyAssistShell(WorkbenchKeyboard.java:682) at org.eclipse.ui.internal.keys.BindingService.openKeyAssistDialog(BindingService.java:158) at org.eclipse.ui.internal.handlers.ShowKeyAssistHandler.execute(ShowKeyAssistHandler.java:38) at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:151) at org.eclipse.core.commands.Command.execute(Command.java:312) at org.eclipse.core.commands.ParameterizedCommand.execute(ParameterizedCommand.java:396) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:452) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:741) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:785) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:543) at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:486) at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:110) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82) at org.eclipse.swt.widgets.Display.filterEvent(Display.java:780) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:841) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:866) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:851) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:879) at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:875) at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1182) at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:3125) at org.eclipse.swt.widgets.Control.windowProc(Control.java:3028) at org.eclipse.swt.widgets.Display.windowProc(Display.java:3492) at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method) at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:1647) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2531) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1569) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1533) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:306) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143) at test.Application.run(Application.java:12) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:228) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:345) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:158) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:319) at org.eclipse.core.launcher.Main.basicRun(Main.java:272) at org.eclipse.core.launcher.Main.run(Main.java:951) at org.eclipse.core.launcher.Main.main(Main.java:935) @@@@ keyBindingState.getAssociatedWindow() returns null.
Created attachment 20597 [details] test case project launch app press Ctrl+Shift+L
Actually you can leave the action set out. The only important thing is that ApplicationWorkbenchAdvisor#getInitialWindowPerspectiveId returns null (which is allowed by spec).
Moving Dougs bugs
Is this still a problem in 3.3? PW
Changes requested on bug 193523
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.