This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 411326 - Menu entries contributed programmatically disabled in eclipse 4.3
Summary: Menu entries contributed programmatically disabled in eclipse 4.3
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.3   Edit
Hardware: PC Windows 7
: P3 major (vote)
Target Milestone: 4.4 M7   Edit
Assignee: Paul Webster CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-21 02:01 EDT by Megha Bassi CLA
Modified: 2014-04-29 03:03 EDT (History)
2 users (show)

See Also:


Attachments
Sample project (11.88 KB, application/x-zip-compressed)
2013-06-26 00:13 EDT, Megha Bassi CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Megha Bassi CLA 2013-06-21 02:01:24 EDT
Hi,

We have a project which is composed of numerous plug-ins.
We contributed menus to our object selections(from a Tree) in a view, programmatically by creating command-handler pairs and creating a menu 
using the AbstractContributionFactory.createContributionItems() and attaching it to a MenuSerive.

With Eclipse 4.3 these menus are disabled by default, even if the 
handler.setEnabled() returns a true.

I read that with Eclipse 4.3, we have an application model and we can contribute 
menus using the application model. And "If you are using Eclipse 4.3 ensure that your application model has an entry pointing to in the HandlerProcessingAddon class in the package org.eclipse.e4.ui.internal.workbench.addons. The bundle symbolic name is org.eclipse.e4.ui.workbench."

However, this wont work in our scenario as we cannot modify our plug-ins to accommodate the application model because the different plug-in contributions
form a complex framework.
I might be wrong, but any information will be helpful because our custom menu entries are disabled and we cannot proceed with our work.

Is there a work-around as to how we could enable these entries again?


Regards,
Megha
Comment 1 Megha Bassi CLA 2013-06-21 02:16:58 EDT
Additionally, in of the menus, not all commands are disabled. While in another all are.

Thanks and Regards,
Megha
Comment 2 Megha Bassi CLA 2013-06-24 07:05:49 EDT
I can see a LegacyIDE.e4xmi file in my workspace which has the HandlerProcessingAddon. Is it relevant, how can the application make use of it?

Please help with this as we need to migrate to 4.3 and this is a huge blocker 
as the menu items are not enabled.

Regards,
Megha
Comment 3 Paul Webster CLA 2013-06-24 12:49:24 EDT
I'm not sure what exactly you are doing.  Could you please attach a sample project that demonstrates the problem.

PW
Comment 4 Megha Bassi CLA 2013-06-26 00:13:37 EDT
Created attachment 232764 [details]
Sample project

Sample project tries to add a menu item to the project explorer of eclipse when being run as an eclipse application.
The menu item should be enabled by default. However it isn't in eclipse 4.3 Kepler
works perfectly in eclipse 4.2.1 Juno
Comment 5 Megha Bassi CLA 2013-06-26 00:15:57 EDT
Hi, 
I also checked the Manifest files, the core-expression plugin version is
3.4.401 in eclipse 4.2.1 and 3.4.500 in eclipse 4.3
When I run the same code in eclipse 4.2.1 I get the following error in the console:
!SESSION 2013-06-26 09:32:31.099 -----------------------------------------------
eclipse.buildId=M20120914-1800
java.version=1.7.0_5
java.vendor=SAP AG
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments:  -product org.eclipse.sdk.ide
Command-line arguments:  -product org.eclipse.sdk.ide -data C:\EclipseWorkspaces\SampleProjWS_42/../runtime-EclipseApplication -dev file:C:/EclipseWorkspaces/SampleProjWS_42/.metadata/.plugins/org.eclipse.pde.core/Eclipse Application/dev.properties -os win32 -ws win32 -arch x86_64 -consoleLog

!ENTRY org.eclipse.e4.ui.workbench 4 0 2013-06-26 09:32:37.895
!MESSAGE Unable to load class 'org.eclipse.e4.ui.internal.workbench.addons.HandlerProcessingAddon' from bundle '94'
!STACK 0
java.lang.ClassNotFoundException: org.eclipse.e4.ui.internal.workbench.addons.HandlerProcessingAddon
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:501)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
	at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:420)
	at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:340)
	at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:229)
	at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1212)
	at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:100)
	at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:71)
	at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:49)
	at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(E4Application.java:254)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:557)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:543)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1414)
Comment 6 Nobody - feel free to take it CLA 2013-07-10 08:58:53 EDT
This might be related to bug 411765 as the sample uses an AbstractContributionFactory.
Comment 7 Dani Megert CLA 2013-08-09 04:03:58 EDT
Moving to M2 as per bug 414630 comment 4.
Comment 8 Wojciech Sudol CLA 2014-04-28 10:30:59 EDT
Contrary to Eclipse 4.3, in 4.4 (I20140427-2030) the menu item becomes enabled after eclipse restart.
Comment 10 Wojciech Sudol CLA 2014-04-29 03:03:38 EDT
Verified in I20140428-2000.