/** * This will refresh the list of contributions to the registry by either installing the given * plugins in the current running Eclipse or refresh their packages. Keep this synchronized as it * will be called by each of the utilities and these calls can come from multiple threads. * * @noreference This method is not intended to be referenced by clients. */ public synchronized void refreshContributions() { if (changedContributions.size() == 0) { return; } for (IPluginModelBase candidate : changedContributions) { installBundle(candidate); } changedContributions.clear(); }
/** * This will check through the dependencies of <code>model</code> and install the necessary * workspace plugins if they are required. * * @param model The model of which we wish the dependencies checked. */ private void checkRequireBundleDependencies(IPluginModelBase model) { final BundleDescription desc = model.getBundleDescription(); if (desc == null) { return; } for (BundleSpecification requiredBundle : desc.getRequiredBundles()) { for (IPluginModelBase workspaceModel : PluginRegistry.getWorkspaceModels()) { if (requiredBundle.isSatisfiedBy(workspaceModel.getBundleDescription())) { installBundle(workspaceModel); break; } } } }
/** * This will check the indirect dependencies of <code>model</code> and install the necessary * workspace plugins if we need to import some of their packages. * * @param model The model of which we wish the dependencies checked. */ private void checkImportPackagesDependencies(IPluginModelBase model) { final BundleDescription desc = model.getBundleDescription(); if (desc == null) { return; } for (ImportPackageSpecification importPackage : desc.getImportPackages()) { for (IPluginModelBase workspaceModel : PluginRegistry.getWorkspaceModels()) { if (workspaceModel != null && workspaceModel.getBundleDescription() != null) { for (ExportPackageDescription export : workspaceModel.getBundleDescription().getExportPackages()) { if (importPackage.isSatisfiedBy(export)) { installBundle(workspaceModel); break; } } } } } }