Community
Participate
Working Groups
Build Identifier: I20110620-1631 Created e4-RCP. Tried to open an dialog. Because of errors replaced it by JFace MessageDialog. Results in null-pointer-exceptions. traces by debugger to: ShellActivationListener (package org.eclipse.e4.ui.internal.workbench.swt) (org.eclipse.e4.ui.workbench.swt.source._0.10.0.v20110613-2030.jar) >> EContextService contextService = context.get(EContextService.class); contextService.activateContext(EBindingService.DIALOG_CONTEXT_ID); >> contextService is null. With an older Version (I20100922-0843) (jar file version 0.9.1.v20100909-1100) it works fine. Reproducible: Always Steps to Reproduce: 1. New Eclipse-download + E4 Tools + E4 UI from e4/updates/0.11 2. New OSGI-Project, product and aplication-model 3. Handler for dialog @Execute public void execute(@Named(IServiceConstants.ACTIVE_SHELL) Shell shell, IEclipseContext context) { MessageDialog.openQuestion(shell,"Dialog","Question?"); } 4. DirectMenuItem 5. MainWindow and menu shows; error, when selecting entry
Could you please zip up your project and attach it to this bug?
Created attachment 206946 [details] Simple RCP-App raising error in actual release, none in older one Steps of creation: File > New > Project … and select Plug-in Development > Plug-in Project Target Platform: OSGI framework Equinox No activator --------------------------------------- Add a dependency on “org.eclipse.equinox.app“ --------------------------------------- Overview > Extensions > Add > "org.eclipse.core.runtime.products" New product New property appName value ... New property applicationXMI value ... Application.e4xmi --------------------------------------- File > New > Other” and select “e4 > Model > New Application Model” --------------------------------------- (Application.e4xmi) Windows > new Trimmed Window > MainMenu true --------------------------------------- New Product Configuration Application: org.eclipse.e4.ui.workbench.swt.E4Application --------------------------------------- Add Dependencies -created Plug-In -org.eclipse.equinox.ds -org.eclipse.equinox.event -org.eclipse.e4.ui.workbench.renderers.swt >Add Required Plug-ins --------------------------------------- (Application.e4xmi) Main Menu > new Menu --------------------------------------- (Application.e4xmi) Menu > DirectMenuItem --------------------------------------- CreateClass with handler --------------------------------------- >Some Dependencies ... --------------------------------------- Error on 4.2, not with older version
You need these addons in 4.2 for the application to run. <addons xmi:id="_XGB3wPZlEd-XstlTZ6nTXg" elementId="org.eclipse.e4.core.commands.service" contributionURI="platform:/plugin/org.eclipse.e4.core.commands/org.eclipse.e4.core.commands.CommandServiceAddon"/> <addons xmi:id="_XGB3wPZlEd-XstlTZ6nTXh" elementId="org.eclipse.e4.ui.contexts.service" contributionURI="platform:/plugin/org.eclipse.e4.ui.services/org.eclipse.e4.ui.services.ContextServiceAddon"/> <addons xmi:id="_XGB3wPZlEd-XstlTZ6nTXi" elementId="org.eclipse.e4.ui.bindings.service" contributionURI="platform:/plugin/org.eclipse.e4.ui.bindings/org.eclipse.e4.ui.bindings.BindingServiceAddon"/> <addons xmi:id="_LK0NgPZmEd-XstlTZ6nTXj" elementId="org.eclipse.e4.ui.workbench.commands.model" contributionURI="platform:/plugin/org.eclipse.e4.ui.workbench/org.eclipse.e4.ui.internal.workbench.addons.CommandProcessingAddon"/> <addons xmi:id="_LK0NgPZmEd-XstlTZ6nTXk" elementId="org.eclipse.e4.ui.workbench.contexts.model" contributionURI="platform:/plugin/org.eclipse.e4.ui.workbench/org.eclipse.e4.ui.internal.workbench.addons.ContextProcessingAddon"/> <addons xmi:id="_LK0NgPZmEd-XstlTZ6nTXl" elementId="org.eclipse.e4.ui.workbench.bindings.model" contributionURI="platform:/plugin/org.eclipse.e4.ui.workbench.swt/org.eclipse.e4.ui.workbench.swt.util.BindingProcessingAddon"/>
*** This bug has been marked as a duplicate of bug 361877 ***
Didn't understand the problem of bug 361877 completely but the problem with the dialogs I've reported has been solved with Remy Suens answer. Current Eclipse adds them by default if you don't deactivate the corresponding checkbox while creating a new application model -e4xmi- by wizard.