Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Property Tester threading question
Property Tester threading question [message #330139] Wed, 16 July 2008 17:03 Go to next message
Eclipse UserFriend
Originally posted by: x_raajes.ugs.com

In our RCP app, we have property testers that determine the enable/disable
conditions for menu items (in the menu bar as well as in context menus),
using the Eclipse 3.3 menus/commands/handlers mechanism. Many times, the
conditions are based on some property on the domain object that was
right-clicked on, and to determine the property value, we have to make a
server call (to the DB).

We are making a conscious effort to avoid making server calls from within
the UI thread, to avoid locking up the UI. However, the property tester is
sometimes activated from the UI thread, and since it makes a call to the
server to determine the properties, we have a server call on the UI thread.
If I try to start the server call in another background thread, then I
wouldn't be able to return the right value from the test() method of the
property tester (because the thread wouldn't have completed yet). I am
wondering if anyone has come across such an issue, and if they have a
reasonable solution for this.
Re: Property Tester threading question [message #330220 is a reply to message #330139] Mon, 21 July 2008 16:42 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

You're right, many of the property tester methods are queried on the UI
thread.

Most (although not all) queries from the framework in 3.4 are coming
from the IEvaluationService. This now provides a method to request a
property be updated (and all expressions related to it re-evaluated).
That would allow you to update the property in the background in the
client app and then request that eclipse re-evaluate any expressions
that use that property.

The other solution is you create your own Manager that receives
notifications from your DB when changes occur and can update local
information and fire events. This pattern can also be used to provide
input as an ISourceProvider that can be hooked up to the
IEvaluationService (using org.eclipse.ui.services in 3.4). But this
depends on the nature of your DB updates and if your architecture allows it.

PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/workbench.htm


Previous Topic:XML Editor doesn't save to disk if opened from zipeditor
Next Topic:Adding a template to a custom extension point
Goto Forum:
  


Current Time: Fri Jul 12 09:00:55 GMT 2024

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

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

Back to the top