use of org.eclipse.epp.internal.mpc.ui.commands.MarketplaceWizardCommand in project epp.mpc by eclipse.
the class MarketplaceClientService method openProvisioning.
public void openProvisioning(IMarketplaceClientConfiguration configuration) {
checkInitialState(configuration);
MarketplaceWizardCommand command = new MarketplaceWizardCommand();
command.setConfiguration(configuration);
WizardState wizardState = new WizardState();
wizardState.setProceedWithInstallation(true);
command.setWizardDialogState(wizardState);
execute(command);
}
use of org.eclipse.epp.internal.mpc.ui.commands.MarketplaceWizardCommand in project epp.mpc by eclipse.
the class MarketplaceClientService method openInstalled.
public void openInstalled(IMarketplaceClientConfiguration configuration) {
MarketplaceWizardCommand command = new MarketplaceWizardCommand();
command.setConfiguration(configuration);
WizardState wizardState = new WizardState();
wizardState.setContentType(ContentType.INSTALLED);
wizardState.setProceedWithInstallation(false);
command.setWizardDialogState(wizardState);
execute(command);
}
use of org.eclipse.epp.internal.mpc.ui.commands.MarketplaceWizardCommand in project epp.mpc by eclipse.
the class AbstractMarketplaceWizardBotTest method launchMarketplaceWizard.
protected void launchMarketplaceWizard() {
final MarketplaceWizardCommand marketplaceWizardCommand = new MarketplaceWizardCommand();
WizardState wizardState = new WizardState();
wizardState.setContent(new LinkedHashSet<INode>(Arrays.asList(TEST_NODES)));
wizardState.setProceedWithInstallation(false);
marketplaceWizardCommand.setWizardDialogState(wizardState);
UIThreadRunnable.asyncExec(new VoidResult() {
public void run() {
try {
marketplaceWizardCommand.execute(new ExecutionEvent());
} catch (ExecutionException e) {
fail("ExecutionException: " + e.getMessage());
// otherwise ignore, we'll notice in the test thread when we don't get the wizard dialog in time
}
}
});
}
use of org.eclipse.epp.internal.mpc.ui.commands.MarketplaceWizardCommand in project epp.mpc by eclipse.
the class MarketplaceWizard method resumeWizard.
public static void resumeWizard(Display display, Object state, boolean proceedWithInstall) {
String catalogUrl = (String) state;
if (proceedWithInstall) {
org.eclipse.epp.mpc.ui.MarketplaceUrlHandler.SolutionInstallationInfo installInfo = MarketplaceUrlHandler.createSolutionInstallInfo(catalogUrl);
if (installInfo != null) {
MarketplaceUrlHandler.triggerInstall(installInfo);
return;
}
}
CatalogDescriptor descriptor = catalogUrl == null ? null : CatalogRegistry.getInstance().findCatalogDescriptor(catalogUrl);
final MarketplaceWizardCommand command = new MarketplaceWizardCommand();
if (descriptor != null) {
descriptor = new CatalogDescriptor(descriptor);
descriptor.setLabel(MarketplaceUrlHandler.DESCRIPTOR_HINT);
command.setSelectedCatalogDescriptor(descriptor);
}
String mpcState = MarketplaceUrlHandler.getMPCState(catalogUrl);
if (mpcState != null && mpcState.length() > 0) {
try {
// $NON-NLS-1$
command.setWizardState(URLDecoder.decode(mpcState, "UTF-8"));
} catch (UnsupportedEncodingException e) {
// should never happen
throw new IllegalStateException(e);
}
if (!proceedWithInstall) {
WizardState wizardState = new WizardState();
wizardState.setProceedWithInstallation(false);
command.setWizardDialogState(wizardState);
}
}
display.asyncExec(new Runnable() {
public void run() {
try {
command.execute(new ExecutionEvent());
} catch (ExecutionException e) {
IStatus status = MarketplaceClientCore.computeStatus(e, Messages.MarketplaceBrowserIntegration_cannotOpenMarketplaceWizard);
MarketplaceClientUi.handle(status, StatusManager.SHOW | StatusManager.BLOCK | StatusManager.LOG);
}
}
});
}
use of org.eclipse.epp.internal.mpc.ui.commands.MarketplaceWizardCommand in project epp.mpc by eclipse.
the class MarketplaceUrlHandler method triggerInstall.
public static void triggerInstall(SolutionInstallationInfo info) {
if (info.getRequestUrl() != null) {
MarketplaceClientUi.getLog().log(new Status(IStatus.INFO, MarketplaceClientUi.BUNDLE_ID, NLS.bind(Messages.MarketplaceUrlHandler_performInstallRequest, info.getRequestUrl())));
}
String installId = info.getInstallId();
String mpcState = info.getState();
CatalogDescriptor catalogDescriptor = info.getCatalogDescriptor();
MarketplaceWizardCommand command = new MarketplaceWizardCommand();
command.setSelectedCatalogDescriptor(catalogDescriptor);
try {
if (mpcState != null) {
command.setWizardState(URLDecoder.decode(mpcState, UTF_8));
}
Map<String, Operation> nodeToOperation = new HashMap<String, Operation>();
nodeToOperation.put(URLDecoder.decode(installId, UTF_8), Operation.INSTALL);
command.setOperations(nodeToOperation);
} catch (UnsupportedEncodingException e1) {
throw new IllegalStateException(e1);
}
try {
command.execute(new ExecutionEvent());
} catch (ExecutionException e) {
IStatus status = MarketplaceClientCore.computeStatus(e, Messages.MarketplaceUrlHandler_cannotOpenMarketplaceWizard);
MarketplaceClientUi.handle(status, StatusManager.SHOW | StatusManager.BLOCK | StatusManager.LOG);
}
}
Aggregations