Search in sources :

Example 1 with ValidationResult

use of org.springsource.ide.eclipse.commons.livexp.core.ValidationResult in project eclipse-integration-commons by spring-projects.

the class WizardPageWithSections method scheduleUpdateJob.

private synchronized void scheduleUpdateJob() {
    Shell shell = getShell();
    if (shell != null) {
        if (this.updateJob == null) {
            this.updateJob = new UIJob("Update Wizard message") {

                @Override
                public IStatus runInUIThread(IProgressMonitor monitor) {
                    ValidationResult status = validator.getValue();
                    setErrorMessage(null);
                    setMessage(null);
                    if (status.isOk()) {
                    } else if (status.status == IStatus.ERROR) {
                        setErrorMessage(status.msg);
                    } else if (status.status == IStatus.WARNING) {
                        setMessage(status.msg, IMessageProvider.WARNING);
                    } else if (status.status == IStatus.INFO) {
                        setMessage(status.msg, IMessageProvider.INFORMATION);
                    } else {
                        setMessage(status.msg, IMessageProvider.NONE);
                    }
                    setPageComplete(status.isOk());
                    return Status.OK_STATUS;
                }
            };
            updateJob.setSystem(true);
        }
        updateJob.schedule(MESSAGE_DELAY);
    }
}
Also used : Shell(org.eclipse.swt.widgets.Shell) IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) IStatus(org.eclipse.core.runtime.IStatus) UIJob(org.eclipse.ui.progress.UIJob) ValidationResult(org.springsource.ide.eclipse.commons.livexp.core.ValidationResult)

Aggregations

IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)1 IStatus (org.eclipse.core.runtime.IStatus)1 Shell (org.eclipse.swt.widgets.Shell)1 UIJob (org.eclipse.ui.progress.UIJob)1 ValidationResult (org.springsource.ide.eclipse.commons.livexp.core.ValidationResult)1