You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@pivot.apache.org by Olivier Dutrieux <ol...@pasteur.fr> on 2011/05/10 10:49:03 UTC

last revision (1101269) problem.

Hello,

Since last revision 1101269, when I try setActive(false) to 
ActivityIndicator after I activated (setActive(true)) I get this error 
message :

java.lang.NullPointerException
     at 
org.apache.pivot.wtk.skin.terra.TerraActivityIndicatorSkin.activeChanged(TerraActivityIndicatorSkin.java:161)
     at 
org.apache.pivot.wtk.ActivityIndicator$ActivityIndicatorListenerList.activeChanged(ActivityIndicator.java:30)
     at 
org.apache.pivot.wtk.ActivityIndicator.setActive(ActivityIndicator.java:50)


Best regards

Duto

Re: last revision (1101269) problem.

Posted by Greg Brown <gk...@verizon.net>.
> No I am wrapping the Tasklistener with TaskAdapter but I activate the ActivityIndicator on the execute method of the Task : it's not that the problem ?

Ah, yeah. execute() is called on the background thread. You can only call into the UI on the UI thread.


Re: last revision (1101269) problem.

Posted by Olivier Dutrieux <ol...@pasteur.fr>.
Le 10/05/2011 22:10, Greg Brown a écrit :
> Sounds like you are not wrapping your TaskListener in a TaskAdapter. You need to do this to ensure that the handler is called on the UI thread.
>
No I am wrapping the Tasklistener with TaskAdapter but I activate the 
ActivityIndicator on the execute method of the Task : it's not that the 
problem ?

Duto

Re: last revision (1101269) problem.

Posted by Greg Brown <gk...@verizon.net>.
Sounds like you are not wrapping your TaskListener in a TaskAdapter. You need to do this to ensure that the handler is called on the UI thread.

On May 10, 2011, at 4:02 PM, Olivier Dutrieux wrote:

> Le 10/05/2011 13:20, Noel Grandin a écrit :
>> Hi
>> 
>> Do you have a test-case (ie. some sample code) for this?
>> 
>> Thanks, Noel.
>> 
>> 
> 
> In fact the real exception is :
> 
> java.lang.IllegalStateException: this method can only be called from the AWT event dispatch thread
>    at org.apache.pivot.wtk.Container.assertEventDispatchThread(Container.java:853)
>    at org.apache.pivot.wtk.WTKListenerList.iterator(WTKListenerList.java:79)
>    at org.apache.pivot.wtk.ActivityIndicator$ActivityIndicatorListenerList.activeChanged(ActivityIndicator.java:29)
>    at org.apache.pivot.wtk.ActivityIndicator.setActive(ActivityIndicator.java:50)
> 
> I think is due to the new verification (Container.assertEventDispatchThread()) on all wtk components. I active the ActivityIndicator on the execute method of my task.
> 
> What is the best pratice ?
> 
> see my attach sample.
> 
> Duto
> <src.rar>


Re: last revision (1101269) problem.

Posted by Olivier Dutrieux <ol...@pasteur.fr>.
Le 10/05/2011 13:20, Noel Grandin a écrit :
> Hi
>
> Do you have a test-case (ie. some sample code) for this?
>
> Thanks, Noel.
>
>

In fact the real exception is :

java.lang.IllegalStateException: this method can only be called from the 
AWT event dispatch thread
     at 
org.apache.pivot.wtk.Container.assertEventDispatchThread(Container.java:853)
     at 
org.apache.pivot.wtk.WTKListenerList.iterator(WTKListenerList.java:79)
     at 
org.apache.pivot.wtk.ActivityIndicator$ActivityIndicatorListenerList.activeChanged(ActivityIndicator.java:29)
     at 
org.apache.pivot.wtk.ActivityIndicator.setActive(ActivityIndicator.java:50)

I think is due to the new verification 
(Container.assertEventDispatchThread()) on all wtk components. I active 
the ActivityIndicator on the execute method of my task.

What is the best pratice ?

see my attach sample.

Duto

Re: last revision (1101269) problem.

Posted by Noel Grandin <no...@gmail.com>.
Hi

Do you have a test-case (ie. some sample code) for this?

Thanks, Noel.

Olivier Dutrieux wrote:
> Hello,
>
> Since last revision 1101269, when I try setActive(false) to ActivityIndicator after I activated (setActive(true)) I
> get this error message :
>
> java.lang.NullPointerException
>     at org.apache.pivot.wtk.skin.terra.TerraActivityIndicatorSkin.activeChanged(TerraActivityIndicatorSkin.java:161)
>     at org.apache.pivot.wtk.ActivityIndicator$ActivityIndicatorListenerList.activeChanged(ActivityIndicator.java:30)
>     at org.apache.pivot.wtk.ActivityIndicator.setActive(ActivityIndicator.java:50)
>
>
> Best regards
>
> Duto