Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Technology Project and PMC » Problem about User Feedback for Finished Jobs
Problem about User Feedback for Finished Jobs [message #601016] Wed, 16 August 2006 13:47
Cagatay is currently offline CagatayFriend
Messages: 17
Registered: July 2009
Junior Member
I have used the code given in an Eclipse article to give feedback to the
user for finished jobs. But I have a problem. .html

When the build job finishes, MessageDialog is shown to give "Your build
process completed" message to the user but it disappears quickly. So,user
can not notice that window. It is shown using asynchExec method but it can
not appear until user presses OK button. I want to show it until the user
presses OK button. So, user will understand from that window that build
When the window is shown to the user (within milisecs), the thread goes
out from run() method and that window is disposed I think.

Do you have any suggestion to fix this error?

Thank you,
Best wishes

public class BuildJob extends Job {

public BuildJob(String aName) {

public IStatus run(IProgressMonitor monitor)
try {
String as[] = new String[3];
as[0] = "make";
as[1] = "-f";
as[2] = "Makefile";

ProcessBuilder pb = new ProcessBuilder(as);
Map<String,String> env = pb.environment();

long start = new Date().getTime();
monitor.beginTask("Building projectnow...",350000);

long current;
int workedTotal = 0;
final Process p = pb.start();
boolean isExited = false;

//update the progess bar
current = new Date().getTime();
int workQuant = (int) (current-start-workedTotal);
workedTotal += workQuant;
monitor.subTask("Total: "+workedTotal+" seconds");

isExited = true;
catch( IllegalThreadStateException IE){
return Status.CANCEL_STATUS;


System.out.println("Build finished!!!");
catch (Exception e) {
IsyaPlugin.logError("Error ");

//inform user about the finish of Project
if (isModal(this)) {
// if it is modal, it was not run in background.
// The progress dialog is still open so just open the message
else {

setProperty(IProgressConstants.ACTION_PROPERTY,getBuildCompl etedAction());
return Status.OK_STATUS;

public boolean isModal(BuildJob job) {
Boolean isModal =
(Boolean)job.getProperty(IProgressConstants.PROPERTY_IN_DIAL OG);
if(isModal == null)
return false;
return isModal.booleanValue();

protected static void showResults() {
int i=0;
Display.getDefault().asyncExec(new Runnable() {
public void run() {

protected static Action getBuildCompletedAction() {
return new Action("View build status") {
public void run() {
MessageDialog.openInformation(Display.getDefault().getActive Shell(),
"Build Complete",
"Your build process completed!");

Previous Topic:CVS merge problem
Next Topic:Problem about User Feedback for Finished Jobs
Goto Forum:

Current Time: Fri Oct 30 03:00:55 GMT 2020

Powered by FUDForum. Page generated in 0.02020 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top