use of org.eclipse.epp.mpc.ui.IMarketplaceClientService in project epp.mpc by eclipse.
the class ShowInstalledSolutionsCommand method execute.
public Object execute(ExecutionEvent event) throws ExecutionException {
IMarketplaceClientService marketplaceClientService = MarketplaceClient.getMarketplaceClientService();
IMarketplaceClientConfiguration config = marketplaceClientService.newConfiguration();
marketplaceClientService.openInstalled(config);
return null;
}
use of org.eclipse.epp.mpc.ui.IMarketplaceClientService in project epp.mpc by eclipse.
the class ShowFavoritesCommand method execute.
public Object execute(ExecutionEvent event) throws ExecutionException {
IMarketplaceClientService marketplaceClientService = MarketplaceClient.getMarketplaceClientService();
IMarketplaceClientConfiguration config = marketplaceClientService.newConfiguration();
marketplaceClientService.openFavorites(config);
return null;
}
use of org.eclipse.epp.mpc.ui.IMarketplaceClientService in project epp.mpc by eclipse.
the class ShowFileSupportProposalsJob method runInUIThread.
@Override
public IStatus runInUIThread(IProgressMonitor monitor) {
final Shell shell = WorkbenchUtil.getShell();
String fileExtensionLabel = DiscoverFileSupportJob.getFileExtensionLabel(fileName);
final ShowFileSupportProposalsDialog dialog = new ShowFileSupportProposalsDialog(shell, fileExtensionLabel, defaultDescriptor);
if (dialog.open() == IDialogConstants.OK_ID) {
if (dialog.isShowProposals()) {
IMarketplaceClientService marketplaceClientService = MarketplaceClient.getMarketplaceClientService();
IMarketplaceClientConfiguration config = marketplaceClientService.newConfiguration();
marketplaceClientService.open(config, new LinkedHashSet<INode>(nodes));
} else if (dialog.isAssociateToExtension()) {
List<String> fileExtensions = DiscoverFileSupportJob.getFileExtensions(fileName);
IFileEditorMapping newMapping = createDefaultDescriptorMapping(fileExtensions.get(fileExtensions.size() - 1));
addEditorMapping(newMapping);
}
return Status.OK_STATUS;
} else {
return Status.CANCEL_STATUS;
}
}
use of org.eclipse.epp.mpc.ui.IMarketplaceClientService in project epp.mpc by eclipse.
the class ShowNatureProposalsJob method runInUIThread.
@Override
public IStatus runInUIThread(IProgressMonitor monitor) {
ShowNatureProposalsDialog dialog = new ShowNatureProposalsDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), candidates);
if (dialog.open() == IDialogConstants.CANCEL_ID) {
return Status.CANCEL_STATUS;
}
Set<String> natureIds = dialog.getSelectedNatures();
IMarketplaceClientService marketplaceClientService = MarketplaceClient.getMarketplaceClientService();
IMarketplaceClientConfiguration config = marketplaceClientService.newConfiguration();
Set<INode> allNodes = new HashSet<INode>();
for (String natureId : natureIds) {
allNodes.addAll(candidates.get(natureId));
}
if (!allNodes.isEmpty()) {
marketplaceClientService.open(config, allNodes);
}
return Status.OK_STATUS;
}
use of org.eclipse.epp.mpc.ui.IMarketplaceClientService in project epp.mpc by eclipse.
the class ImportFavoritesWizard method openFavoritesInMarketplace.
private void openFavoritesInMarketplace(List<MarketplaceNodeCatalogItem> selection) {
final IMarketplaceClientService clientService = MarketplaceClient.getMarketplaceClientService();
final IMarketplaceClientConfiguration config = clientService.newConfiguration();
MarketplaceCatalogConfiguration catalogConfiguration = getConfiguration();
config.setCatalogDescriptors(catalogConfiguration.getCatalogDescriptors());
config.setCatalogDescriptor(catalogConfiguration.getCatalogDescriptor());
Map<String, Operation> initialOperations = new HashMap<String, Operation>();
for (MarketplaceNodeCatalogItem item : selection) {
initialOperations.put(item.getData().getId(), Operation.INSTALL);
}
config.setInitialOperations(initialOperations);
Display.getCurrent().asyncExec(new Runnable() {
public void run() {
clientService.openFavorites(config);
}
});
}
Aggregations