Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How to refresh the enabledwhen status? A question about "IEvaluationService"?
How to refresh the enabledwhen status? A question about "IEvaluationService"? [message #526836] Tue, 13 April 2010 08:19 Go to next message
WangYing  is currently offline WangYing Friend
Messages: 2
Registered: March 2010
Junior Member
I have two commands "Power on" and "Power off" in a toolbar.
They should be like a switch. When poweron is enabled ,poweroff is disabled, and when poweroff is enabled poweron is disabled.

There are several objects (machines) in a treeviewer. The enabledwhen clause of the handler uses a property tester to test whether the object is "poweron" or "poweroff".

Now When I press the "Power on ", I did change the machine state to "poweron" but I couldn't refresh the enabledwhen status. I have to select another object in the treeviewer and reselect the machine object ,then the enabledwhen status is refreshed.

I tried to google and found the following code:
IEvaluationService service = (IEvaluationService)getSite.getService(IEvaluationService.class);

service.requestEvaluation("your.property.name");


I want to call these codes after a handler.execute is complete.
The getSite method seem could only be write in a viewer class.
Where should I write these codes?
I'm grateful for any help you can offer

WangYing

[Updated on: Tue, 13 April 2010 08:42]

Report message to a moderator

Re: How to refresh the enabledwhen status? A question about "IEvaluationService"? [message #526844 is a reply to message #526836] Tue, 13 April 2010 09:29 Go to previous message
Prakash G.R. is currently offline Prakash G.R.Friend
Messages: 621
Registered: July 2009
Senior Member
On 13/04/10 1:49 PM, WangYing wrote:
> I want to call these codes after a handler.execute is complete.

Try IExecutionListener.postExecuteSuccess(). You need to register the
listener in the ICommandservice

- Prakash
Platform UI Team, IBM

www.eclipse-tips.com
Previous Topic:Problem making section content scrollable
Next Topic:Tabs INSIDE a view??
Goto Forum:
  


Current Time: Thu Apr 25 05:58:53 GMT 2024

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

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

Back to the top