1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
public class LongRuningAction {
public static void start(){
Display.getCurrent().asyncExec(new Runnable() {
public void run(){
Job job = new Job("Long job ...") {
protected org.eclipse.core.runtime.IStatus run(
IProgressMonitor monitor) {
monitor.beginTask("run", IProgressMonitor.UNKNOWN);
monitor.subTask("Run ...");
// creation de 5 étudiants
for (int i=0; i<5; i++){
Student newStudent= new Student();
// Notification de la création d'un étudiant
StudentControler.setCurrentNewStudent(newStudent);
}
monitor.subTask("Finish ...");
monitor.done();
return Status.OK_STATUS;
}
};
job.setUser(true);
job.schedule();
}
});
}
}
} |