Search in sources :

Example 1 with IMarketplaceClientConfiguration

use of org.eclipse.epp.mpc.ui.IMarketplaceClientConfiguration 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;
}
Also used : IMarketplaceClientConfiguration(org.eclipse.epp.mpc.ui.IMarketplaceClientConfiguration) IMarketplaceClientService(org.eclipse.epp.mpc.ui.IMarketplaceClientService)

Example 2 with IMarketplaceClientConfiguration

use of org.eclipse.epp.mpc.ui.IMarketplaceClientConfiguration 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;
}
Also used : IMarketplaceClientConfiguration(org.eclipse.epp.mpc.ui.IMarketplaceClientConfiguration) IMarketplaceClientService(org.eclipse.epp.mpc.ui.IMarketplaceClientService)

Example 3 with IMarketplaceClientConfiguration

use of org.eclipse.epp.mpc.ui.IMarketplaceClientConfiguration 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;
    }
}
Also used : Shell(org.eclipse.swt.widgets.Shell) INode(org.eclipse.epp.mpc.core.model.INode) IMarketplaceClientConfiguration(org.eclipse.epp.mpc.ui.IMarketplaceClientConfiguration) IMarketplaceClientService(org.eclipse.epp.mpc.ui.IMarketplaceClientService) List(java.util.List) IFileEditorMapping(org.eclipse.ui.IFileEditorMapping)

Example 4 with IMarketplaceClientConfiguration

use of org.eclipse.epp.mpc.ui.IMarketplaceClientConfiguration 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;
}
Also used : INode(org.eclipse.epp.mpc.core.model.INode) IMarketplaceClientConfiguration(org.eclipse.epp.mpc.ui.IMarketplaceClientConfiguration) IMarketplaceClientService(org.eclipse.epp.mpc.ui.IMarketplaceClientService) HashSet(java.util.HashSet)

Example 5 with IMarketplaceClientConfiguration

use of org.eclipse.epp.mpc.ui.IMarketplaceClientConfiguration 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);
        }
    });
}
Also used : IMarketplaceClientConfiguration(org.eclipse.epp.mpc.ui.IMarketplaceClientConfiguration) HashMap(java.util.HashMap) IMarketplaceClientService(org.eclipse.epp.mpc.ui.IMarketplaceClientService) Operation(org.eclipse.epp.mpc.ui.Operation) MarketplaceNodeCatalogItem(org.eclipse.epp.internal.mpc.ui.catalog.MarketplaceNodeCatalogItem)

Aggregations

IMarketplaceClientConfiguration (org.eclipse.epp.mpc.ui.IMarketplaceClientConfiguration)5 IMarketplaceClientService (org.eclipse.epp.mpc.ui.IMarketplaceClientService)5 INode (org.eclipse.epp.mpc.core.model.INode)2 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 List (java.util.List)1 MarketplaceNodeCatalogItem (org.eclipse.epp.internal.mpc.ui.catalog.MarketplaceNodeCatalogItem)1 Operation (org.eclipse.epp.mpc.ui.Operation)1 Shell (org.eclipse.swt.widgets.Shell)1 IFileEditorMapping (org.eclipse.ui.IFileEditorMapping)1