Home » Eclipse Projects » Eclipse Platform » ProgressMonitorDialog question/feature request
ProgressMonitorDialog question/feature request [message #325048] |
Thu, 07 February 2008 00:50 |
Eclipse User |
|
|
|
Originally posted by: olegryaboy.myway.com
I use ProgressMonitorDialog for a task that requires waiting for response
from a remote server, so I want the progress bar to show "indeterminate"
progress (like ProgressBar(x, SWT.INDETERMINATE)).
Is there a way to do that?
I tried monitor.beginTask("xxxx", IProgressMonitor.UNKNOWN), but that just
shows a disabled, grayed out progress bar...
Thank you!
|
|
|
Re: ProgressMonitorDialog question/feature request [message #325072 is a reply to message #325048] |
Thu, 07 February 2008 15:35 |
Eclipse User |
|
|
|
Originally posted by: ad.powerflasher.de
For me "beginTask" with "IProgressMonitor.UNKNOWN" works. Maybe there is an
other problem?
"Oleg" <olegryaboy@myway.com> schrieb im Newsbeitrag
news:b8343570ed1de03192eacde511c197d9$1@www.eclipse.org...
>I use ProgressMonitorDialog for a task that requires waiting for response
>from a remote server, so I want the progress bar to show "indeterminate"
>progress (like ProgressBar(x, SWT.INDETERMINATE)).
> Is there a way to do that?
> I tried monitor.beginTask("xxxx", IProgressMonitor.UNKNOWN), but that just
> shows a disabled, grayed out progress bar...
>
> Thank you!
>
|
|
| |
Re: ProgressMonitorDialog question/feature request [message #325170 is a reply to message #325048] |
Mon, 11 February 2008 18:55 |
Eclipse User |
|
|
|
Originally posted by: olegryaboy.myway.com
Just to be clear, I expect the progress bar to show the "unknown progress"
animation, where it goes back and forth. Instead, I get a disabled, grayed
out bar, which looks like the program got "stuck".
Here's the code snippet:
// Get data from server
ProgressMonitorDialog pdm = new ProgressMonitorDialog(activeShell);
try {
pdm.run(true, false, new IRunnableWithProgress() {
public void run(IProgressMonitor monitor) throws
InvocationTargetException, InterruptedException {
monitor.beginTask("Getting data from server.",
IProgressMonitor.UNKNOWN);
monitor.subTask("Contacting server.");
monitor.worked(IProgressMonitor.UNKNOWN);
Thread.sleep(20000);
}
});
}
catch (InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
|
|
|
Re: ProgressMonitorDialog question/feature request [message #325238 is a reply to message #325170] |
Tue, 12 February 2008 23:53 |
Marcel Messages: 11 Registered: July 2009 |
Junior Member |
|
|
Not entirely sure it'll solve your problem, but there is probably no
need to call monitor.worked for an unknown task - just call monitor.done
when you are finished, and in the meantime the progress display should
indicate that work is being done.
Marcel
On Mon, 2008-02-11 at 18:55 +0000, Oleg wrote:
> Just to be clear, I expect the progress bar to show the "unknown progress"
> animation, where it goes back and forth. Instead, I get a disabled, grayed
> out bar, which looks like the program got "stuck".
>
>
> Here's the code snippet:
>
>
> // Get data from server
> ProgressMonitorDialog pdm = new ProgressMonitorDialog(activeShell);
>
> try {
> pdm.run(true, false, new IRunnableWithProgress() {
> public void run(IProgressMonitor monitor) throws
> InvocationTargetException, InterruptedException {
>
> monitor.beginTask("Getting data from server.",
> IProgressMonitor.UNKNOWN);
> monitor.subTask("Contacting server.");
> monitor.worked(IProgressMonitor.UNKNOWN);
> Thread.sleep(20000);
> }
> });
> }
> catch (InvocationTargetException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> }
> catch (InterruptedException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> }
>
>
|
|
|
Re: ProgressMonitorDialog question/feature request [message #325295 is a reply to message #325238] |
Wed, 13 February 2008 22:35 |
Eclipse User |
|
|
|
Originally posted by: olegryaboy.myway.com
Marcel,
Thank you so much for replying. I tried deleting the call to
monitor.worked, and other permutations (calling worked(10), etc.), to no
avail - no animation, just a grayed out bar.
Would you mind running the code below on your computer to see if you get a
different behavior?
Thank you,
Oleg
Marcel wrote:
> Not entirely sure it'll solve your problem, but there is probably no
> need to call monitor.worked for an unknown task - just call monitor.done
> when you are finished, and in the meantime the progress display should
> indicate that work is being done.
> Marcel
> On Mon, 2008-02-11 at 18:55 +0000, Oleg wrote:
>> Just to be clear, I expect the progress bar to show the "unknown progress"
>> animation, where it goes back and forth. Instead, I get a disabled, grayed
>> out bar, which looks like the program got "stuck".
>>
>>
>> Here's the code snippet:
>>
>>
>> // Get data from server
>> ProgressMonitorDialog pdm = new ProgressMonitorDialog(activeShell);
>>
>> try {
>> pdm.run(true, false, new IRunnableWithProgress() {
>> public void run(IProgressMonitor monitor) throws
>> InvocationTargetException, InterruptedException {
>>
>> monitor.beginTask("Getting data from server.",
>> IProgressMonitor.UNKNOWN);
>> monitor.subTask("Contacting server.");
>> monitor.worked(IProgressMonitor.UNKNOWN);
>> Thread.sleep(20000);
>> }
>> });
>> }
>> catch (InvocationTargetException e) {
>> // TODO Auto-generated catch block
>> e.printStackTrace();
>> }
>> catch (InterruptedException e) {
>> // TODO Auto-generated catch block
>> e.printStackTrace();
>> }
>>
>>
|
|
|
Re: ProgressMonitorDialog question/feature request [message #325317 is a reply to message #325295] |
Thu, 14 February 2008 14:45 |
Eclipse User |
|
|
|
Originally posted by: eclipse-news.rizzoweb.com
Have you seen this article?
http://www.eclipse.org/articles/Article-Progress-Monitors/ar ticle.html
Hope this helps,
Eric
Oleg wrote:
> Marcel,
>
> Thank you so much for replying. I tried deleting the call to
> monitor.worked, and other permutations (calling worked(10), etc.), to no
> avail - no animation, just a grayed out bar.
>
> Would you mind running the code below on your computer to see if you get
> a different behavior?
>
> Thank you,
> Oleg
>
> Marcel wrote:
>
>> Not entirely sure it'll solve your problem, but there is probably no
>> need to call monitor.worked for an unknown task - just call monitor.done
>> when you are finished, and in the meantime the progress display should
>> indicate that work is being done.
>
>> Marcel
>
>> On Mon, 2008-02-11 at 18:55 +0000, Oleg wrote:
>>> Just to be clear, I expect the progress bar to show the "unknown
>>> progress" animation, where it goes back and forth. Instead, I get a
>>> disabled, grayed out bar, which looks like the program got "stuck".
>>>
>>>
>>> Here's the code snippet:
>>>
>>>
>>> // Get data from server
>>> ProgressMonitorDialog pdm = new ProgressMonitorDialog(activeShell);
>>>
>>> try {
>>> pdm.run(true, false, new IRunnableWithProgress() {
>>> public void run(IProgressMonitor monitor) throws
>>> InvocationTargetException, InterruptedException {
>>>
>>> monitor.beginTask("Getting data from server.",
>>> IProgressMonitor.UNKNOWN);
>>> monitor.subTask("Contacting server.");
>>> monitor.worked(IProgressMonitor.UNKNOWN);
>>> Thread.sleep(20000);
>>> }
>>> });
>>> }
>>> catch (InvocationTargetException e) {
>>> // TODO Auto-generated catch block
>>> e.printStackTrace();
>>> }
>>> catch (InterruptedException e) {
>>> // TODO Auto-generated catch block
>>> e.printStackTrace();
>>> }
>>>
>>>
>
>
|
|
|
Goto Forum:
Current Time: Sat Apr 20 02:51:24 GMT 2024
Powered by FUDForum. Page generated in 0.03343 seconds
|