Search in sources :

Example 6 with MarketplaceCatalog

use of org.eclipse.epp.internal.mpc.ui.catalog.MarketplaceCatalog in project epp.mpc by eclipse.

the class MarketplaceDiscoveryStrategyTest method setUp.

@Before
public void setUp() throws Exception {
    catalogUrl = new URL("http://marketplace.eclipse.org");
    catalogDescriptor = new CatalogDescriptor(catalogUrl, "Eclipse.org Marketplace");
    CatalogRegistry.getInstance().register(catalogDescriptor);
    catalog = new MarketplaceCatalog();
}
Also used : MarketplaceCatalog(org.eclipse.epp.internal.mpc.ui.catalog.MarketplaceCatalog) URL(java.net.URL) CatalogDescriptor(org.eclipse.epp.mpc.ui.CatalogDescriptor) Before(org.junit.Before)

Example 7 with MarketplaceCatalog

use of org.eclipse.epp.internal.mpc.ui.catalog.MarketplaceCatalog in project epp.mpc by eclipse.

the class MarketplaceWizard method initializeCatalog.

void initializeCatalog() {
    final MarketplaceCatalog catalog = getCatalog();
    synchronized (catalog) {
        List<AbstractDiscoveryStrategy> discoveryStrategies = catalog.getDiscoveryStrategies();
        for (AbstractDiscoveryStrategy strategy : discoveryStrategies) {
            strategy.dispose();
        }
        discoveryStrategies.clear();
        if (getConfiguration().getCatalogDescriptor() != null) {
            MarketplaceDiscoveryStrategy discoveryStrategy = new MarketplaceDiscoveryStrategy(getConfiguration().getCatalogDescriptor());
            discoveryStrategy.setShellProvider(this);
            discoveryStrategies.add(discoveryStrategy);
        }
    }
}
Also used : MarketplaceDiscoveryStrategy(org.eclipse.epp.internal.mpc.ui.catalog.MarketplaceDiscoveryStrategy) AbstractDiscoveryStrategy(org.eclipse.equinox.internal.p2.discovery.AbstractDiscoveryStrategy) MarketplaceCatalog(org.eclipse.epp.internal.mpc.ui.catalog.MarketplaceCatalog)

Example 8 with MarketplaceCatalog

use of org.eclipse.epp.internal.mpc.ui.catalog.MarketplaceCatalog in project epp.mpc by eclipse.

the class UserFavoritesSignInActionItem method buttonPressed.

@Override
protected void buttonPressed(int id) {
    MarketplaceViewer viewer = (MarketplaceViewer) getViewer();
    final MarketplaceCatalog catalog = viewer.getCatalog();
    try {
        viewer.getWizard().getContainer().run(true, true, new IRunnableWithProgress() {

            public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
                catalog.userFavorites(true, monitor);
            }
        });
    } catch (InvocationTargetException e) {
        MarketplaceClientUi.handle(e.getCause(), StatusManager.SHOW | StatusManager.BLOCK | StatusManager.LOG);
    } catch (InterruptedException e) {
    // ignore
    }
    viewer.updateContents();
}
Also used : IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) MarketplaceCatalog(org.eclipse.epp.internal.mpc.ui.catalog.MarketplaceCatalog) InvocationTargetException(java.lang.reflect.InvocationTargetException) IRunnableWithProgress(org.eclipse.jface.operation.IRunnableWithProgress)

Example 9 with MarketplaceCatalog

use of org.eclipse.epp.internal.mpc.ui.catalog.MarketplaceCatalog in project epp.mpc by eclipse.

the class AbstractMarketplaceWizardCommand method execute.

public Object execute(ExecutionEvent event) throws ExecutionException {
    final MarketplaceCatalog catalog = createCatalog();
    if (catalog == null) {
        // errors have already been logged, just return
        return null;
    }
    MarketplaceCatalogConfiguration configuration = createConfiguration(catalog, event);
    if (configuration == null) {
        // errors have already been logged, just return
        return null;
    }
    DiscoveryWizard wizard = createWizard(catalog, configuration, event);
    openWizardDialog(wizard, event);
    return null;
}
Also used : MarketplaceCatalogConfiguration(org.eclipse.epp.internal.mpc.ui.wizards.MarketplaceCatalogConfiguration) MarketplaceCatalog(org.eclipse.epp.internal.mpc.ui.catalog.MarketplaceCatalog) DiscoveryWizard(org.eclipse.equinox.internal.p2.ui.discovery.wizards.DiscoveryWizard)

Example 10 with MarketplaceCatalog

use of org.eclipse.epp.internal.mpc.ui.catalog.MarketplaceCatalog in project epp.mpc by eclipse.

the class AbstractMarketplaceWizardCommand method createCatalog.

protected MarketplaceCatalog createCatalog() {
    final MarketplaceCatalog catalog = new MarketplaceCatalog();
    catalog.setEnvironment(DiscoveryCore.createEnvironment());
    catalog.setVerifyUpdateSiteAvailability(false);
    return catalog;
}
Also used : MarketplaceCatalog(org.eclipse.epp.internal.mpc.ui.catalog.MarketplaceCatalog)

Aggregations

MarketplaceCatalog (org.eclipse.epp.internal.mpc.ui.catalog.MarketplaceCatalog)10 MarketplaceDiscoveryStrategy (org.eclipse.epp.internal.mpc.ui.catalog.MarketplaceDiscoveryStrategy)5 URL (java.net.URL)4 CatalogDescriptor (org.eclipse.epp.mpc.ui.CatalogDescriptor)4 ArrayList (java.util.ArrayList)2 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)2 IStatus (org.eclipse.core.runtime.IStatus)2 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)2 MarketplaceCategory (org.eclipse.epp.internal.mpc.ui.catalog.MarketplaceCategory)2 AbstractDiscoveryStrategy (org.eclipse.equinox.internal.p2.discovery.AbstractDiscoveryStrategy)2 Before (org.junit.Before)2 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 List (java.util.List)1 Map (java.util.Map)1 SearchResult (org.eclipse.epp.internal.mpc.core.model.SearchResult)1 DefaultMarketplaceService (org.eclipse.epp.internal.mpc.core.service.DefaultMarketplaceService)1 MarketplaceNodeCatalogItem (org.eclipse.epp.internal.mpc.ui.catalog.MarketplaceNodeCatalogItem)1 MarketplaceNodeInstallableUnitItem (org.eclipse.epp.internal.mpc.ui.catalog.MarketplaceNodeInstallableUnitItem)1