Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-ui-dev] Easier non-blocking progress report in dialogs: need API



On Mon, Oct 17, 2016 at 1:06 AM, Mickael Istria <mistria@xxxxxxxxxx> wrote:
On 10/16/2016 07:49 PM, Sergey Prigogin wrote:
I'm thinking of a simpler API:

myJob.join(0, wizardProgressMonitor)

Job.join(long, IProgressMonitor) method already exists but the Javadoc for the second parameter says: "No progress is reported on this monitor." There are other scenarios when progress reporting on the joining monitor is desired, e.g. when a user job is joining on a system job. Currently the user job is not reporting any progress during the join call, but it would be nice if it did.
Ok, sounds even better.

I've realized that myJob.join(0, wizardProgressMonitor) is not sufficient since it is not suitable for being called on the UI thread. A nonblocking method for adding a progress listener is still required.
 
Do you already track this in a bug? Or should I open one.

There is no existing bug. Please create one to track this.
 
An issue I noticed with the JobMonitor is that it seems tricky to hook the cancel state of a given progress monitor to the JobMonitor. For example, if I click on the stop/abord button of the wizard progress monitor, its setCanceled operation is not propagated to the JobMonitor. At the moment, unless I'm missing an interesting API, "compositing" the cancel would require to have the ProgressMonitor regularly checking for the cancel state of all its children.

Connecting the cancel state between the listeners and the job monitor should not be necessary. The most efficient way to cancel a job is to call Job.cancel(). This method should be called by the UI element providing the red x button.
 
Another (smaller) issue is that most ProgressMonitors that perform UI operations should then use Display.(a)syncExec or an UIJob.
--
Mickael Istria
Eclipse developer for Red Hat Developers
My blog - My Tweets

-sergey 

_______________________________________________
platform-ui-dev mailing list
platform-ui-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-ui-dev


Back to the top