/** * Create the wizard dialog as a container of the vpm analysis wizard. * * @param shell * The UI shell to access the ui. * @param vpmAnalysisWizard * The wizard to display in the dialog. * @return The prepared wizard dialog. */ private WizardDialog createWizardDialog(Shell shell, VPMAnalysisWizard vpmAnalysisWizard) { WizardDialog wizardDialog = new WizardDialog(shell, vpmAnalysisWizard) { @Override protected Control createDialogArea(Composite parent) { Control ctrl = super.createDialogArea(parent); getProgressMonitor(); return ctrl; } @Override protected IProgressMonitor getProgressMonitor() { ProgressMonitorPart monitor = (ProgressMonitorPart) super.getProgressMonitor(); GridData gridData = new GridData(GridData.FILL_HORIZONTAL); gridData.heightHint = 0; monitor.setLayoutData(gridData); monitor.setVisible(false); return monitor; } }; return wizardDialog; }
@Override public void run(boolean fork, boolean cancelable, final IRunnableWithProgress runnable) throws InvocationTargetException, InterruptedException { ProgressMonitorPart mpart = (ProgressMonitorPart) getProgressMonitor(); mpart.setVisible(true); try { ModalContext.run(runnable, fork, getProgressMonitor(), getShell() .getDisplay()); } finally { mpart.done(); mpart.setVisible(false); } }
@Override protected IProgressMonitor getProgressMonitor() { ProgressMonitorPart monitor = (ProgressMonitorPart) super.getProgressMonitor(); GridData gridData = new GridData(GridData.FILL_HORIZONTAL); gridData.heightHint = 0; monitor.setLayoutData(gridData); monitor.setVisible(false); return monitor; }
protected ProgressMonitorPart getProgressMonitorPart() { return progressMonitorPart; }
public void setProgressMonitorPart(ProgressMonitorPart progressMonitorPart) { this.progressMonitorPart = progressMonitorPart; }
/** * Mentor Graphics: Called to get the page progress * control. * @return Page progress control or <code>null</code>. */ protected ProgressMonitorPart getPageProgressMonitor() { return null; }
/** * Returns the page progress monitor part to * use for long operations. * * @return Progress monitor part */ protected ProgressMonitorPart getPageProgressMonitor() { ProgressPage installPage = getInstallWizard().getProgressPage(); return installPage.getProgressMonitorPart(); }
/** * Returns the progress monitor part. * * @return Progress monitor part */ public ProgressMonitorPart getProgressMonitorPart() { return progressMonitorPart; }