Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Avoid flooding the SWT UI Thread. alternative to jface.deferred
Avoid flooding the SWT UI Thread. alternative to jface.deferred [message #323799] Tue, 08 January 2008 23:13 Go to next message
Eclipse UserFriend
Originally posted by: k.nospam.bugmenot.com

Ok, I solved my problem of blank lines in a virtual jface table viewer
with lazy content provider.

I tried to use jface.deferred but I read it will be deprecated and I
needed to change my model to implement it. So here I describe my workaround:

I have wrappers for the viewers like
wrp = TableWrapper.get(tableViewerInstance)

Then I use wrp like: wrp.refresh(element) or wrp.setInput(input);

Those methods don't call the viewer methods they just store information
in the wrp instance. For example for the refresh(element) I keep a set
of elements to be refreshed.

Besides having this viewer methods the wrappers are Runnable. The run()
method of the wrappers update the viewers. Now what I need is to execute
the run method in the UI thread but I can control the frequency of
updates for each viewer, I can also implement periodic updates I can
avoid locking using java 5.0 concurrency advantages.

Why not using Display.asyncExec? because it just doesn't work with many
items in the model the UI starts to be useless. The SWT queue with the
Runnable that you submit sith .asyncExec() starts to grow and everything
is slow.

Then I have a scheduler using the concurrency package to run those
wrappers run() methods. I implemented this wrappers and now my code
looks better instead of ugly Display.asyncExec(new Runnable bla bla)
I have wrapper.action();

I implemented a delayed update, I wait X milliseconds (200ms now) before
updating a viewer again. This solved all my UI problems. But it seems to
be something so basic that a solution like this should be implemented in
jface, what do you think? I cna try to explain better and clearly if it
seems interesting

thank you.
Re: Avoid flooding the SWT UI Thread. alternative to jface.deferred [message #323803 is a reply to message #323799] Wed, 09 January 2008 02:44 Go to previous messageGo to next message
Eclipse UserFriend
Hi Kevin,

Would you mind filing an enhancement request against Platform/UI,
include your code and probably a snippet? We can discuss in Bugzilla how
to proceed and if this could get part of JFace. One of the problems I
see is your mention of Java 5 because all JFace code has to CDC 1.0
compatible.

Tom

--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: Avoid flooding the SWT UI Thread. alternative to jface.deferred [message #323806 is a reply to message #323803] Wed, 09 January 2008 03:04 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Tom,

It's seems that the Java's reduced libraries aren't keeping up well with
the language levels very well. I wouldn't imagine for example that
generics should have a big impact on footprint that such a thing would
prevent moving the reduced libraries up a language level. I would also
imagine that improved concurrency primitives might be especially useful
for small devices. But what do I know?! :-P


Tom Schindl wrote:
> Hi Kevin,
>
> Would you mind filing an enhancement request against Platform/UI,
> include your code and probably a snippet? We can discuss in Bugzilla
> how to proceed and if this could get part of JFace. One of the
> problems I see is your mention of Java 5 because all JFace code has to
> CDC 1.0 compatible.
>
> Tom
>
Re: Avoid flooding the SWT UI Thread. alternative to jface.deferred [message #323807 is a reply to message #323806] Wed, 09 January 2008 03:13 Go to previous messageGo to next message
Eclipse UserFriend
Hi Ed,

Well the problem is that SWT and JFace, Databinding, ... the low-level
modules in Eclipse world constraint themselves to this small set of
classlib and language environments so that they can be run on all kind
of JRE implementations (you know my GWT port, do you :-).

I think we won't see a move towards Java 5 in JFace and SWT but what I
would encourage is an incubator project that is constrainted on Java 5
(or even Java 6 => problem for OS-X users) and provides an Java 5 API
ontop of the original JFace module and can make use of all available
language features.

I will talk to the other platform/ui members what they think about this
but I think this.

Tom

Ed Merks schrieb:
> Tom,
>
> It's seems that the Java's reduced libraries aren't keeping up well with
> the language levels very well. I wouldn't imagine for example that
> generics should have a big impact on footprint that such a thing would
> prevent moving the reduced libraries up a language level. I would also
> imagine that improved concurrency primitives might be especially useful
> for small devices. But what do I know?! :-P
>
>
> Tom Schindl wrote:
>> Hi Kevin,
>>
>> Would you mind filing an enhancement request against Platform/UI,
>> include your code and probably a snippet? We can discuss in Bugzilla
>> how to proceed and if this could get part of JFace. One of the
>> problems I see is your mention of Java 5 because all JFace code has to
>> CDC 1.0 compatible.
>>
>> Tom
>>


--
B e s t S o l u t i o n . at
------------------------------------------------------------ --------
Tom Schindl JFace-Committer
------------------------------------------------------------ --------
Re: Avoid flooding the SWT UI Thread. alternative to jface.deferred [message #323853 is a reply to message #323803] Thu, 10 January 2008 09:53 Go to previous message
Eclipse UserFriend
Originally posted by: k.nospam.bugmenot.com

Tom, thank you for your reply. I will post here again after filing the
enhancement request.
Previous Topic:How to make dynamic object contributions at runtime
Next Topic:Setting the editor invisible dynamically
Goto Forum:
  


Current Time: Sun Jul 06 10:57:34 EDT 2025

Powered by FUDForum. Page generated in 0.09898 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top