Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » How to act on presentation out of non-Display Thread
How to act on presentation out of non-Display Thread [message #37274] Fri, 12 December 2008 11:57 Go to next message
Christoph Höger is currently offline Christoph HögerFriend
Messages: 40
Registered: July 2009
Member
Hello,

I am still working on
http://www.eclipse.org/newsportal/article.php?id=770&gro up=eclipse.platform.pde#770

I've found that jdt uses SourceViewer.changePresentation() on every
(AST-)reconcile event. I tried that, but it of course does not work
because the reconciling occurs in a non-display thread.
I'm aware of Display.getCurrent().asyncExec() which solves the problem
from the other side (being in a Display Thread and wanting to compute
something in the background), Is there a way like
Display.getSomeDisplay().asyncExec()? Or do I have to save the Display on
my own somewhere and reuse it? Or should I setup a Display thread to
handle the redraw event from reconciling (and sleep the rest of the time)?

Any advice welcome

Christoph
Re: How to act on presentation out of non-Display Thread [message #37342 is a reply to message #37274] Fri, 12 December 2008 14:31 Go to previous message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

On 12/12/2008 6:57 AM, Christoph Höger wrote:
> Hello,
>
> I am still working on
> http://www.eclipse.org/newsportal/article.php?id=770&gro up=eclipse.platform.pde#770
>
>
> I've found that jdt uses SourceViewer.changePresentation() on every
> (AST-)reconcile event. I tried that, but it of course does not work
> because the reconciling occurs in a non-display thread.
> I'm aware of Display.getCurrent().asyncExec() which solves the problem
> from the other side (being in a Display Thread and wanting to compute
> something in the background), Is there a way like
> Display.getSomeDisplay().asyncExec()? Or do I have to save the Display
> on my own somewhere and reuse it?

You can get the Display from any widget that you have a reference to by
calling getDisplay().

You can also call PlatformUI.getWorkbench().getDisplay().

Hope this helps,
Eric
Re: How to act on presentation out of non-Display Thread [message #587056 is a reply to message #37274] Fri, 12 December 2008 14:31 Go to previous message
Eric Rizzo is currently offline Eric RizzoFriend
Messages: 3070
Registered: July 2009
Senior Member
On 12/12/2008 6:57 AM, Christoph Höger wrote:
> Hello,
>
> I am still working on
> http://www.eclipse.org/newsportal/article.php?id=770&gro up=eclipse.platform.pde#770
>
>
> I've found that jdt uses SourceViewer.changePresentation() on every
> (AST-)reconcile event. I tried that, but it of course does not work
> because the reconciling occurs in a non-display thread.
> I'm aware of Display.getCurrent().asyncExec() which solves the problem
> from the other side (being in a Display Thread and wanting to compute
> something in the background), Is there a way like
> Display.getSomeDisplay().asyncExec()? Or do I have to save the Display
> on my own somewhere and reuse it?

You can get the Display from any widget that you have a reference to by
calling getDisplay().

You can also call PlatformUI.getWorkbench().getDisplay().

Hope this helps,
Eric
Previous Topic:Forcing TextHover window to stay.
Next Topic:Headless build of features with a different folder name
Goto Forum:
  


Current Time: Thu Apr 25 12:15:22 GMT 2024

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

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

Back to the top