|
|
Re: Invalid thread access from SWT [message #90607 is a reply to message #90117] |
Wed, 28 May 2008 22:46 |
Eclipse User |
|
|
|
Originally posted by: rherrmann.innoopract.com
Markus,
I couldn't reproduce what you describe. I changed the WorkbenchDemo
by adding a UIJob that refreshes a viewer.
Could you provide a standalone snippet that reproduces the behavior?
Cheers
Rüdiger
Markus Krüger wrote:
> I might need to add, that this only happens in IE (i use IE7), not in
> FireFox!?
>
>
> "Markus Krüger" <krueger@ion.ag> schrieb im Newsbeitrag
> news:g1eti7$tnt$1@build.eclipse.org...
>> Hi,
>> I get an invalid thread access exepction from SWT as I call refresh on my
>> table viewer. I use the following code that is inside a listener that
>> listens for changes of my model:
>>
>> DUMMY.addSaveListener(new ISaveListener(){
>> public void saved() {
>> Job refreshJob = new UIJob(""){
>> public IStatus runInUIThread(IProgressMonitor monitor) {
>> monitor.beginTask("Refreshing...", 1);
>> refresh();
>> monitor.done();
>> return Status.OK_STATUS;
>> }
>>
>> };
>> refreshJob.setUser(true);
>> refreshJob.schedule();
>> }
>> public void savedApplKindPauschData() {
>> }
>> });
>>
>> public void refresh() {
>> if(!viewer.getTable().isDisposed())
>> viewer.refresh();
>> }
>>
>> Regards,
>> Markus
>>
>
>
|
|
|
|
Re: Invalid thread access from SWT [message #90975 is a reply to message #90789] |
Fri, 30 May 2008 07:46 |
Eclipse User |
|
|
|
Originally posted by: rherrmann.innoopract.com
Hi Markus,
I can reproduce the invalid thread access. It occurs regardless
which browser is used.
To work around the issue you could wrap the UI code like this:
UICallBack.runNonUIThreadWithFakeContext( display, new Runnable()
{
public void run() {
refresh();
}
});
Currently I think this shouldn't be necessary. The fake-context
should be provided under the hood. But we need to investigate this
more thoroughly.
I filed bug 234779 to track and discuss this issue.
Cheers,
Rüdiger
Markus Krüger wrote:
> Hi Rüdiger,
>
> to reproduce apply the attached path to your demo. This patch adds and
> activator with my simple save listener and a dummy save method that fires
> the listeners when called. The FooEditor calls this save method on save. The
> DemoTableViewPart registers a save listener and wants to refresh on save.
>
> Now start the demo and call it with IE7 (may be IE6 will raise the bug, too,
> but I hove not tested). Open the FooEditor and add some changes and save it.
> You will see an error and the console states an invalid thread access
> exception from SWT.
>
> The patch also shows bug
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=234103. When you start the
> workbench nothing seems to be selected in DemoTableViewPart, but if you
> scroll up bit, then you see the selection. Pushing the extra button alwas
> reveals the selection.
>
> Regards,
> Markus
>
>
>
>
>
> "Rüdiger Herrmann" <rherrmann@innoopract.com> schrieb im Newsbeitrag
> news:g1knc6$dnn$1@build.eclipse.org...
>> Markus,
>>
>> I couldn't reproduce what you describe. I changed the WorkbenchDemo
>> by adding a UIJob that refreshes a viewer.
>> Could you provide a standalone snippet that reproduces the behavior?
>>
>> Cheers
>> Rüdiger
>>
>>
>> Markus Krüger wrote:
>>> I might need to add, that this only happens in IE (i use IE7), not in
>>> FireFox!?
>>>
>>>
>>> "Markus Krüger" <krueger@ion.ag> schrieb im Newsbeitrag
>>> news:g1eti7$tnt$1@build.eclipse.org...
>>>> Hi,
>>>> I get an invalid thread access exepction from SWT as I call refresh on
>>>> my
>>>> table viewer. I use the following code that is inside a listener that
>>>> listens for changes of my model:
>>>>
>>>> DUMMY.addSaveListener(new ISaveListener(){
>>>> public void saved() {
>>>> Job refreshJob = new UIJob(""){
>>>> public IStatus runInUIThread(IProgressMonitor monitor) {
>>>> monitor.beginTask("Refreshing...", 1);
>>>> refresh();
>>>> monitor.done();
>>>> return Status.OK_STATUS;
>>>> }
>>>>
>>>> };
>>>> refreshJob.setUser(true);
>>>> refreshJob.schedule();
>>>> }
>>>> public void savedApplKindPauschData() {
>>>> }
>>>> });
>>>>
>>>> public void refresh() {
>>>> if(!viewer.getTable().isDisposed())
>>>> viewer.refresh();
>>>> }
>>>>
>>>> Regards,
>>>> Markus
>>>>
>>>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.07549 seconds