Search in sources :

Example 1 with DiscoveryWizard

use of org.eclipse.gemoc.gemoc_studio.branding.discovery.wizards.DiscoveryWizard in project gemoc-studio by eclipse.

the class GemocPackageDiscovery method openModelingDiscoveryWizard.

public static void openModelingDiscoveryWizard(IWorkbenchWindow window) {
    final DiscoveryContentProvider provider = new GemocPackageDiscovery();
    IWorkbench wb = PlatformUI.getWorkbench();
    IProgressService ps = wb.getProgressService();
    try {
        ps.busyCursorWhile(new IRunnableWithProgress() {

            public void run(IProgressMonitor pm) {
                try {
                    provider.load(pm);
                } catch (InterruptedException e) {
                /*
						 * End user cancelled
						 */
                }
            }
        });
        if (provider.getDiscovery() != null) {
            DiscoveryWizard wizard = new DiscoveryWizard(provider);
            WizardDialog dialog = new WizardDialog(window.getShell(), wizard);
            dialog.setMinimumPageSize(600, 400);
            dialog.open();
        }
    } catch (InvocationTargetException e1) {
        if (!(e1.getCause() instanceof OperationCanceledException)) {
            Activator.getDefault().getLog().log(new Status(IStatus.ERROR, Activator.PLUGIN_ID, e1.getMessage(), e1));
        }
    } catch (InterruptedException e1) {
    /*
			 * End user cancelled
			 */
    }
}
Also used : IWorkbench(org.eclipse.ui.IWorkbench) Status(org.eclipse.core.runtime.Status) IStatus(org.eclipse.core.runtime.IStatus) IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) IProgressService(org.eclipse.ui.progress.IProgressService) OperationCanceledException(org.eclipse.core.runtime.OperationCanceledException) DiscoveryContentProvider(org.eclipse.amalgam.discovery.ui.viewer.DiscoveryContentProvider) DiscoveryWizard(org.eclipse.gemoc.gemoc_studio.branding.discovery.wizards.DiscoveryWizard) WizardDialog(org.eclipse.jface.wizard.WizardDialog) InvocationTargetException(java.lang.reflect.InvocationTargetException) IRunnableWithProgress(org.eclipse.jface.operation.IRunnableWithProgress)

Aggregations

InvocationTargetException (java.lang.reflect.InvocationTargetException)1 DiscoveryContentProvider (org.eclipse.amalgam.discovery.ui.viewer.DiscoveryContentProvider)1 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)1 IStatus (org.eclipse.core.runtime.IStatus)1 OperationCanceledException (org.eclipse.core.runtime.OperationCanceledException)1 Status (org.eclipse.core.runtime.Status)1 DiscoveryWizard (org.eclipse.gemoc.gemoc_studio.branding.discovery.wizards.DiscoveryWizard)1 IRunnableWithProgress (org.eclipse.jface.operation.IRunnableWithProgress)1 WizardDialog (org.eclipse.jface.wizard.WizardDialog)1 IWorkbench (org.eclipse.ui.IWorkbench)1 IProgressService (org.eclipse.ui.progress.IProgressService)1