|
Re: Showing a Dialog Whilst Running a Job [message #452928 is a reply to message #452851] |
Tue, 18 July 2006 23:20 |
Nick Veys Messages: 52 Registered: July 2009 |
Member |
|
|
Is the job blocking? If not, and you have time in the run method, you
can show it, or fire off an event to a listener who could show it.
Otherwise it'd be a bit odd to have a property on the job of a method to
call "some time" during the job.
On Tue, 2006-07-18 at 10:19 +0000, Dave wrote:
> Hi,
>
> I have a requirement to conditionally show a Dialog part way through
> running a job (org.eclipse.core.runtime.jobs.Job), so the job may be
> running in the background.
>
> I have worked out how to show a popup when the job has finished, and
> there's also a facility to show a popup as the job is about to start (and
> at several other points in the lifecycle), but how can I get a dialog or
> popup part way through ?
>
> Anyone got any ideas?
>
> Thanks
>
> Dave.
>
|
|
|
|
|
|
Re: Showing a Dialog Whilst Running a Job [message #452985 is a reply to message #452944] |
Wed, 19 July 2006 13:00 |
Dave Hewitson Messages: 56 Registered: July 2009 |
Member |
|
|
Hi Stefan,
in my example, what you suggest fails because getActiveWorkbenchWindow()
returns null.
I'm beginning to think that the only way round this is to use a view
instead of Dialog (ie something that stays active in the workbench), but
that's not bulletproof either, as it's unlikely, but not impossible that
the user closes the view, unless I can find a way to prevent that.
What's the normal thing to do when you just want to get a shell in order
to show a dialog or something?
Stefan Langer wrote:
> Use PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShel l()
> this will give you the shell of the active workbench window.
> I assume the dialog you are showing is modal so there shouldn't be an
> issue with this.
> Regards
> Stefan
> Dave wrote:
>> Hi Nick,
>>
>> thanks for your reply.
>>
>> The requirement is to warn the user before the Job does something, and
>> allow the user to quit.
>>
>> The problem is that the dialog that launched the Job has now closed and
>> been disposed, and to show a dialog asking the question I need a shell
>> handle.
>>
>> What should one normally do in this situation?
>>
>> Regards
>>
>> Dave.
>>
|
|
|
Re: Showing a Dialog Whilst Running a Job [message #453007 is a reply to message #452985] |
Thu, 20 July 2006 07:17 |
Stefan Langer Messages: 236 Registered: July 2009 |
Senior Member |
|
|
Create a dialog without a shell. As far as I know when you pass in null
the dialog simply creates its own shell. This has the drawback that when
the dialog is modal it might dissapear behind other windows in certain
cases and the user won'T see it anymore but the UI is still unresponsive.
Another solution is to simply create your own shell and pass that in.
Regards
Stefan
Dave wrote:
> Hi Stefan,
>
> in my example, what you suggest fails because getActiveWorkbenchWindow()
> returns null.
>
> I'm beginning to think that the only way round this is to use a view
> instead of Dialog (ie something that stays active in the workbench), but
> that's not bulletproof either, as it's unlikely, but not impossible that
> the user closes the view, unless I can find a way to prevent that.
>
> What's the normal thing to do when you just want to get a shell in order
> to show a dialog or something?
>
>
> Stefan Langer wrote:
>
>> Use PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShel l()
>> this will give you the shell of the active workbench window.
>> I assume the dialog you are showing is modal so there shouldn't be an
>> issue with this.
>
>> Regards
>> Stefan
>
>> Dave wrote:
>>> Hi Nick,
>>>
>>> thanks for your reply.
>>>
>>> The requirement is to warn the user before the Job does something,
>>> and allow the user to quit.
>>>
>>> The problem is that the dialog that launched the Job has now closed
>>> and been disposed, and to show a dialog asking the question I need a
>>> shell handle.
>>>
>>> What should one normally do in this situation?
>>>
>>> Regards
>>>
>>> Dave.
>>>
>
|
|
|
Powered by
FUDForum. Page generated in 0.04640 seconds