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();
}
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);
}
}
}
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();
}
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;
}
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;
}
Aggregations