1
/*******************************************************************************
2
* Copyright (c) 2000, 2007 QNX Software Systems and others.
3
* All rights reserved. This program and the accompanying materials
4
* are made available under the terms of the Eclipse Public License v1.0
5
* which accompanies this distribution, and is available at
6
* http://www.eclipse.org/legal/epl-v10.html
9
* QNX Software Systems - Initial API and implementation
10
* Markus Schorn (Wind River Systems)
11
*******************************************************************************/
12
package org.eclipse.cdt.make.internal.ui;
14
import org.eclipse.cdt.make.ui.actions.UpdateMakeProjectAction;
15
import org.eclipse.core.resources.IProject;
16
import org.eclipse.core.runtime.IProgressMonitor;
17
import org.eclipse.core.runtime.IStatus;
18
import org.eclipse.core.runtime.Status;
19
import org.eclipse.core.runtime.jobs.Job;
20
import org.eclipse.jface.dialogs.MessageDialog;
21
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
22
import org.eclipse.swt.widgets.Display;
23
import org.eclipse.swt.widgets.Shell;
25
public class MakeStartup extends Job {
27
public MakeStartup() {
28
super(MakeUIPlugin.getResourceString("MakeUIPlugin.update_project")); //$NON-NLS-1$
32
protected IStatus run(IProgressMonitor monitor) {
33
final IProject[] oldProject = UpdateMakeProjectAction.getOldProjects();
34
if (oldProject.length > 0) {
35
Display.getDefault().asyncExec(new Runnable() {
37
Shell shell = MakeUIPlugin.getDefault().getShell();
38
boolean shouldUpdate = MessageDialog.openQuestion(shell,
39
MakeUIPlugin.getResourceString("MakeUIPlugin.update_project"), //$NON-NLS-1$
40
MakeUIPlugin.getResourceString("MakeUIPlugin.update_project_message")); //$NON-NLS-1$
43
ProgressMonitorDialog pd = new ProgressMonitorDialog(shell);
44
UpdateMakeProjectAction.run(false, pd, oldProject);
49
return Status.OK_STATUS;