Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » AddOn does not execute(Simple @PostConstruct AddOn not executed)
AddOn does not execute [message #1805860] Thu, 25 April 2019 16:28
Clément Hurlin is currently offline Clément HurlinFriend
Messages: 10
Registered: February 2014
Junior Member
I'm starting my first Eclipse 4 plugin (we've been doing xtext-based plugins at my companies for a few years now, but using Eclipse 3 API) and I'm struggling to configure the context's injector. Following vogella's tutorial I've tried using the following addon:

public class InjectionAddOn {

	@PostConstruct
	public void init(IEclipseContext context) {
		System.out.println("Addon runs");
                /* Bind IProjectHelper to ProjectHelper */
		final ProjectHelper helper = contextInjectionFactory.make(ProjectHelper.class, context);
		context.set(IProjectHelper.class, helper);
	}

}


with the following in fragments.e4xmi (generated from Application.e4xmi and extracted as a fragment):

  <fragments xsi:type="fragment:StringModelFragment" xmi:id="_z-S-YGd1EemrgfwG7sTuLQ" featurename="addons" parentElementId="com.provenrun.pncide.eclipse.ui.application">
    <elements xsi:type="application:Addon" xmi:id="_z-S-YWd1EemrgfwG7sTuLQ" elementId="com.provenrun.pncide.eclipse.ui.addon.0" contributionURI="bundleclass://com.provenrun.pncide.eclipse.ui/com.provenrun.pncide.eclipse.ui.InjectionAddOn"/>
  </fragments>


But the init method never gets called. What am I doing wrong ? I'm sure I'm missing something obvious, as the e4 environment is new to me.
Previous Topic:Eclipse 4 logging
Next Topic:Dark Theme and custom Table rows color
Goto Forum:
  


Current Time: Thu Dec 05 21:55:03 GMT 2019

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

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

Back to the top