Hello,
I am new to Eclipse and need some help. I’m trying to embed the CatalogViewer into a form and am having no luck. Instead of having the updater in a separate wizard dialog, we’d like to have it accessible from a tabbed dashboard form.
I’ve tried the example in the following location:
http://wiki.eclipse.org/Equinox/p2/Discovery
I am not able to locate the libraries for RepositoryDiscoveryStrategy, so it is unresolved. Therefore, I tried replacing it with RemoteBundleDiscoveryStrategy which was found and resolved from the editor. From anther Discovery example I was referencing, it used www.eclipse.org/equinox/p2/testing/updateSite for the URL. Is this still accessible for testing?
Here is a small code snippet:
public void createPartControl(Composite parent)
{
Catalog catalog = new Catalog();
catalog.setEnvironment(DiscoveryCore.createEnvironment());
catalog.setVerifyUpdateSiteAvailability(false);
// add strategy for retrieving remote catalog
RemoteBundleDiscoveryStrategy remoteDiscoveryStrategy = new RemoteBundleDiscoveryStrategy();
remoteDiscoveryStrategy.setDirectoryUrl("www.eclipse.org/equinox/p2/testing/updateSite");
catalog.getDiscoveryStrategies().add(remoteDiscoveryStrategy);
// RepositoryDiscoveryStrategy strategy = new RepositoryDiscoveryStrategy();
// strategy.addLocation(new URI("www.eclipse.org/equinox/p2/testing/updateSite"));
// catalog.getDiscoveryStrategies().add(strategy);
CatalogConfiguration configuration = new CatalogConfiguration();
configuration.setShowTagFilter(false);
DiscoveryWizard wizard = new DiscoveryWizard(catalog, configuration);
WizardDialog dialog = new WizardDialog(WorkbenchUtil.getShell(), wizard);
dialog.open();
I’ve also tried creating my own CatalogViewer. Here is another code snippet:
catalog = new Catalog();
// look for descriptors from installed bundles
catalog.getDiscoveryStrategies().add(new BundleDiscoveryStrategy());
// look for remote descriptor
String directoryUrl = "www.eclipse.org/equinox/p2/testing/updateSite";
if (directoryUrl != null && directoryUrl.length() > 0)
{
RemoteBundleDiscoveryStrategy remoteDiscoveryStrategy = new RemoteBundleDiscoveryStrategy();
remoteDiscoveryStrategy.setDirectoryUrl(directoryUrl);
catalog.getDiscoveryStrategies().add(remoteDiscoveryStrategy);
}
catalog.setEnvironment(DiscoveryCore.createEnvironment());
catalog.setVerifyUpdateSiteAvailability(true);
configuration = new CatalogConfiguration();
configuration.setShowTagFilter(tags.size() > 0);
configuration.setSelectedTags(tags);
container = new Composite(parent, SWT.NONE);
GridLayoutFactory.fillDefaults().margins(0, 0).applyTo(container);
catalogViewer = new CatalogViewer(catalog, getEditorSite(), (IRunnableContext) container, configuration);
catalogViewer.setMinimumHeight(/*MINIMUM_HEIGHT*/480);
catalogViewer.createControl(parent);
There is very little documentation regarding this technology, so any information you can send me would be greatly appreciated.
Thanks so much,
Stephanie