Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Propertytester vs Sourceprovider
Propertytester vs Sourceprovider [message #533830] Mon, 17 May 2010 08:54 Go to next message
T. Wilhelm is currently offline T. WilhelmFriend
Messages: 129
Registered: July 2009
Senior Member
Hi all,

i have a handler and want to check a variable of my class if the handler is active or not. I found two ways: Use the propertytester mechanism or implement a sourceprovider.

Now i´m wondering which mechanism i should use, the propertytester or the sourceprovider?

Thanks a lot
Thomas
Re: Propertytester vs Sourceprovider [message #533906 is a reply to message #533830] Mon, 17 May 2010 12:55 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

The source provider allows you to add event driven variables to the
IEvaluationService (enabledWhen, activeWhen, visibleWhen, etc). A
property tester allows you to 1) test a property of an object in a core
expression and 2) write more complex tests for an object, as it calls as
test(*) method.

I use property testers if I need to test a property (obvious) or I need
to write a complex expression against an object (test its name and
connection state and buffered data etc) or it's an object that changes
in a very narrow way. If a property changes
org.eclipse.ui.services.IEvaluationService.requestEvaluation (String) is
used to request the system re-calculate its state.

I use source providers if the object under test changes relatively
frequently (measured in minutes, not milliseconds :-) or is in response
to user action or need to be a target of a core expression. i.e. you
might want a Person to be a variable, so that you can test different
properties for that Person object.

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/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Re: Propertytester vs Sourceprovider [message #534106 is a reply to message #533906] Tue, 18 May 2010 05:52 Go to previous message
T. Wilhelm is currently offline T. WilhelmFriend
Messages: 129
Registered: July 2009
Senior Member
Paul, thanks alot!
You make me understand eclipse more and more Wink

Best regards,

Thomas
Previous Topic:direct process output to console view
Next Topic:Commands problem
Goto Forum:
  


Current Time: Thu Apr 25 14:18:08 GMT 2024

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

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

Back to the top