Search in sources :

Example 1 with LegacyWorkspaceConverter

use of org.springsource.ide.eclipse.commons.frameworks.core.legacyconversion.LegacyWorkspaceConverter in project eclipse-integration-commons by spring-projects.

the class LegacySTSChecker method earlyStartup.

/**
 * This entry to the checker comes at the startup of the workbench
 */
public void earlyStartup() {
    PREFERENCE_STORE.setDefault(AUTO_CHECK_FOR_LEGACY_STS_PROJECTS, true);
    if (shouldPerformProjectCheck()) {
        Job job = new LegacyProjectsJob(false);
        job.schedule();
        ResourcesPlugin.getWorkspace().addResourceChangeListener(LegacyProjectListener.LISTENER, IResourceChangeEvent.POST_CHANGE);
    }
    if (shouldPerformWorkspaceMigration()) {
        new // $NON-NLS-1$
        UIJob(// $NON-NLS-1$
        "Convert legacy STS 2.x preferences") {

            @Override
            public IStatus runInUIThread(IProgressMonitor monitor) {
                IStatus status = new LegacyWorkspaceConverter().convert(monitor);
                IStatus status2 = new PerspectiveMigrator().migratePerspective(GRAILS_OLD_PERSPECTIVE_ID, GRAILS_NEW_PERSPECTIVE_ID, monitor);
                MultiStatus statuses = new MultiStatus(FrameworkUIActivator.PLUGIN_ID, 0, new IStatus[] { status, status2 }, "Legacy workspace migration", null);
                return statuses;
            }
        }.schedule();
    }
}
Also used : IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) IStatus(org.eclipse.core.runtime.IStatus) LegacyWorkspaceConverter(org.springsource.ide.eclipse.commons.frameworks.core.legacyconversion.LegacyWorkspaceConverter) MultiStatus(org.eclipse.core.runtime.MultiStatus) Job(org.eclipse.core.runtime.jobs.Job) UIJob(org.eclipse.ui.progress.UIJob)

Aggregations

IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)1 IStatus (org.eclipse.core.runtime.IStatus)1 MultiStatus (org.eclipse.core.runtime.MultiStatus)1 Job (org.eclipse.core.runtime.jobs.Job)1 UIJob (org.eclipse.ui.progress.UIJob)1 LegacyWorkspaceConverter (org.springsource.ide.eclipse.commons.frameworks.core.legacyconversion.LegacyWorkspaceConverter)1