Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Oomph » Install feature on demand?
Install feature on demand? [message #1768419] Tue, 18 July 2017 13:32 Go to next message
Lutz Wrage is currently offline Lutz WrageFriend
Messages: 181
Registered: July 2009
Senior Member
I noticed that the oomph setup editor triggers installation of features on demand, for example, the first time I wanted to add a project build task I got an Oomph Extension Installation dialog that asked me to install org.eclipse.oomph.setup.projects.

This is the first time I've seen such a on demand installation in eclipse. Is this something oomph specific? How would I do that in my own eclipse plugin?
Re: Install feature on demand? [message #1768421 is a reply to message #1768419] Tue, 18 July 2017 13:50 Go to previous messageGo to next message
Abel Hegedus is currently offline Abel HegedusFriend
Messages: 197
Registered: September 2015
Senior Member
Using Plug-in Menu Spy, I can see that the EnablementAction is called, which then uses the EnablementDialog to install the requirement into your host Eclipse through P2 and also add the P2 director task to your Installation.setup to ensure that it is included later as well.

You can replicate this behaviour using the P2 API (though it is not pretty), you can find that part of the code in
the EnablementComposite.install method.
Re: Install feature on demand? [message #1768426 is a reply to message #1768421] Tue, 18 July 2017 14:11 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33258
Registered: July 2009
Senior Member
Note that such triggering of features to install are controlled by the Ecore model of that task implementation. E.g., in this case, Project.ecore's EPakcage has this annotation:
<?xml version="1.0" encoding="UTF-8"?>
<ecore:EAnnotation
    xmi:version="2.0"
    xmlns:xmi="http://www.omg.org/XMI"
    xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
    source="http://www.eclipse.org/oomph/setup/Enablement">
  <details key="variableName"
      value="setup.projects.p2"/>
  <details key="repository"
      value="${oomph.update.url}"/>
  <details key="installableUnits"
      value="org.eclipse.oomph.setup.projects.feature.group"/>
</ecore:EAnnotation>
So when the task implementation is needed because you're really going to use that task in your setup model, what needs to be installed is automatically known. The wizard for creating an Oomph task extension model will allow you to specify this information.

Unless you're implementing your own specialized tasks, you should use a p2 task to specify what you want automatically installed.


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Getting started with Oomph
Next Topic:Help me, plz~ eclipse installtion error
Goto Forum:
  


Current Time: Sun Dec 08 07:10:25 GMT 2024

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

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

Back to the top