Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I easily query a running Eclipse for its installed Features?
    primarykey
    data
    text
    <p>I'm building an Eclipse Feature that has a requirement that amounts to this... The Feature must be able to be uninstalled automatically if the user has his license revoked.</p> <p>If you want more background information about that, Here is another <a href="https://stackoverflow.com/questions/9878017/how-do-i-stop-an-eclipse-feature-from-starting-after-its-been-installed">question that I've asked</a> on this topic.</p> <p>Thanks to the answers on that question, I've been trying to learn the Eclipse p2 director api. I've found some classes that look useful <a href="http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Freference%2Fapi%2Forg%2Feclipse%2Fequinox%2Fp2%2Foperations%2Fpackage-summary.html" rel="nofollow noreferrer">here</a> </p> <p>I've been trying to instantiate one of these classes in my code, but with no luck yet. I've been reading the help documentation, and I'm getting kind of lost in it all. </p> <p>I'm stuck because I have a need to supply the OperationFactory with a collection of IInstallableUnit objects.</p> <pre><code>private void scheduleUninstallOperationJob( Collection&lt;? extends IVersionedId&gt; toUninstall) { OperationFactory oFactory = new OperationFactory(); Collection&lt;URI&gt; repos = null; UninstallOperation op = null; try { op = oFactory.createUninstallOperation(toUninstall, repos, null); } catch (ProvisionException e) { e.printStackTrace(); } IStatus result = op.resolveModal(null); if (result.isOK()) { op.getProvisioningJob(null).schedule(); } } </code></pre> <p>I don't see any way to easily ask the running instance of Eclipse to give me the collection of currently installed InstallableUnits so that I can easily pass the one I want to uninstall to the <em>OperationFactory.createUninstallOperation()</em> method.</p> <p>I've tried using Eclipse source code as an example, but the code that I have found is the org.eclipse.equinox.p2.ui.ProvisioningUI, and it's tightly coupled to the UI that is used when manually uninstalling InstallableUnits. This code also uses code that is in the dreaded Eclipse <em>internal</em> packages which I would like to avoid using if possible.</p> <p>Thank you for your consideration, Trace</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload