Dave,
I suspect the problem is because you already have a modal dialog open (the run configuration) and you can't have two modal dialogs at the same time.
Instead of a job, I think you'll need to use the ILaunchConfigurationDialog#run() method. Assuming you have the launch configuration dialog, you'd do something like this:
try { launchConfigurationDialog.run(true, true, new IRunnableWithProgress() { public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { … your code here ... } }); } catch (InvocationTargetException e1) { … } catch (InterruptedException e2) { … }; This will use a progress monitor that is displayed on the lower part of the launch configuration dialog. If the first argument is true, then a separate thread will be used. You may or may not need this, so I would try both to see which works best. If the second argument is true, then a cancel button will be displayed also.
Let me know if you have any other questions.
Regards, Greg Greg
I'm calling this method right after
creating the object. This is the code I have to create the job where LSFCommand
extends the Job class
queueQuery = new LSFCommand(Messages.QueueCommandDesc,
connection, queryCommand);
queueQuery.setUser(true);
queueQuery.addJobChangeListener(jobListener);
queueQuery.schedule();
Dave
From:
Greg Watson <g.watson@xxxxxxxxxxxx>
To:
Parallel Tools Platform
general developers <ptp-dev@xxxxxxxxxxx>
Date:
08/06/2013 08:48 AM
Subject:
Re: [ptp-dev]
Displaying progress monitor dialog for a job
Sent by:
ptp-dev-bounces@xxxxxxxxxxx
Dave,
Calling setUser(true) should work, but it has to be called
before the job is scheduled. Where are you setting this?
Regards,
Greg
On Aug 6, 2013, at 7:09 AM, Dave Wootton <dwootton@xxxxxxxxxx>
wrote:
I'm working on bug 413192 and have the
changes to run LSF commands as a job instead of on the UI thread mostly
working. The one thing I cannot get working is getting the progress monitor
to appear as a pop up dialog. Right now, I can click a list button in the
resources tab of a LSF target system configuration and get a progress monitor
appear in the progress view while the job is running. However, if I want
to cancel the job, for instance if LSF is down and the command hung, I
cannot cancel the job unless I close the run configuration dialog then
cancel the progress monitor, since the run configuration dialog is modal.
I'd like to have the progress monitor appear as a popup dialog with a cancel
button like I see elsewhere but I can't figure out how to make that work.
I saw a web page that suggested calling Job.setUser(true) would do this
but it is not working. I also tried setting the job priority to Job.Interactive
and that did not help.
Does anyone have suggestions how to make this work?
Dave
Dave_______________________________________________
ptp-dev mailing list
ptp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ptp-dev
_______________________________________________
ptp-dev mailing list
ptp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/ptp-dev
_______________________________________________ ptp-dev mailing list ptp-dev@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/ptp-dev
|