Search in sources :

Example 1 with ExtensionWizard

use of org.eclipse.wst.server.discovery.ExtensionWizard in project webtools.servertools by eclipse.

the class ExtensionWizardPage method handleSelection.

protected void handleSelection(Extension sel) {
    extension = sel;
    if (extension == null)
        licensePage.updateForPlan(new IInstallableUnit[0], null);
    else {
        try {
            getContainer().run(true, true, new IRunnableWithProgress() {

                public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
                    final IProvisioningPlan plan = extension.getProvisioningPlan(true, monitor);
                    if (plan != null && plan.getStatus().isOK()) {
                        getShell().getDisplay().asyncExec(new Runnable() {

                            public void run() {
                                licensePage.updateForPlan(extension.getIUs(), plan);
                                nextPage = licensePage;
                                ((ExtensionWizard) getWizard()).setSecondPage(nextPage);
                            }
                        });
                    } else {
                        getShell().getDisplay().asyncExec(new Runnable() {

                            public void run() {
                                errorPage.setStatus(plan.getStatus());
                            }
                        });
                        nextPage = errorPage;
                        ((ExtensionWizard) getWizard()).setSecondPage(nextPage);
                    }
                    monitor.done();
                }
            });
        } catch (Exception e) {
            Trace.trace(Trace.SEVERE, "Error verifying license", e);
        }
    }
    setPageComplete(extension != null);
}
Also used : IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) ExtensionWizard(org.eclipse.wst.server.discovery.ExtensionWizard) IInstallableUnit(org.eclipse.equinox.p2.metadata.IInstallableUnit) IProvisioningPlan(org.eclipse.equinox.p2.engine.IProvisioningPlan) InvocationTargetException(java.lang.reflect.InvocationTargetException) InvocationTargetException(java.lang.reflect.InvocationTargetException) IRunnableWithProgress(org.eclipse.jface.operation.IRunnableWithProgress)

Aggregations

InvocationTargetException (java.lang.reflect.InvocationTargetException)1 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)1 IProvisioningPlan (org.eclipse.equinox.p2.engine.IProvisioningPlan)1 IInstallableUnit (org.eclipse.equinox.p2.metadata.IInstallableUnit)1 IRunnableWithProgress (org.eclipse.jface.operation.IRunnableWithProgress)1 ExtensionWizard (org.eclipse.wst.server.discovery.ExtensionWizard)1