~ubuntu-branches/debian/sid/eclipse-cdt/sid

« back to all changes in this revision

Viewing changes to results/plugins/org.eclipse.cdt.make.ui/src/org/eclipse/cdt/make/internal/ui/MakeStartup.java

  • Committer: Package Import Robot
  • Author(s): Jakub Adam
  • Date: 2011-10-06 21:15:04 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20111006211504-8dutmljjih0zikfv
Tags: 8.0.1-1
* New upstream release.
* Split the JNI packages into a separate architecture dependent
  package and made eclipse-cdt architecture independent.
* Install JNI libraries into multiarch aware location
* Bumped Standards-Version to 3.9.2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
7
 
 *
8
 
 * Contributors:
9
 
 *     QNX Software Systems - Initial API and implementation
10
 
 *     Markus Schorn (Wind River Systems)
11
 
 *******************************************************************************/
12
 
package org.eclipse.cdt.make.internal.ui;
13
 
 
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;
24
 
 
25
 
public class MakeStartup extends Job {
26
 
 
27
 
        public MakeStartup() {
28
 
                super(MakeUIPlugin.getResourceString("MakeUIPlugin.update_project")); //$NON-NLS-1$
29
 
                setSystem(true);
30
 
        }
31
 
 
32
 
        protected IStatus run(IProgressMonitor monitor) {
33
 
        final IProject[] oldProject = UpdateMakeProjectAction.getOldProjects();
34
 
        if (oldProject.length > 0) {
35
 
            Display.getDefault().asyncExec(new Runnable() {
36
 
                public void run() {
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$
41
 
 
42
 
                    if (shouldUpdate) {
43
 
                        ProgressMonitorDialog pd = new ProgressMonitorDialog(shell);
44
 
                        UpdateMakeProjectAction.run(false, pd, oldProject);
45
 
                    }
46
 
                }
47
 
            });
48
 
        }
49
 
        return Status.OK_STATUS;
50
 
    }
51
 
}