Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How do I get a menu item to refresh?
How do I get a menu item to refresh? [message #777183] Mon, 09 January 2012 20:37 Go to next message
Missing name Mising name is currently offline Missing name Mising name
Messages: 94
Registered: December 2010
Member
I have an ArmListener on a menu item so I can update the menu item text (or it's enabled state) when it's about to be shown.
The problem is that it displays with it's "old" text/state - until the mouse rolls over it. THEN it updates to the state/text I set.

So, how do I get it to immediately update?
Re: How do I get a menu item to refresh? [message #777409 is a reply to message #777183] Tue, 10 January 2012 07:51 Go to previous messageGo to next message
Paul Webster is currently offline Paul Webster
Messages: 6813
Registered: July 2009
Location: Ottawa
Senior Member
SWT.Arm is fired on the menu item when the mouse rolls over it. Sounds like that it what it is doing, just not what you want?

The containing Menu will get an SWT.Show even just before it opens, and that's what code like the MenuManager uses to update its contained MenuItems just before a menu appears. Is that what you want?

PW


Re: How do I get a menu item to refresh? [message #777436 is a reply to message #777409] Tue, 10 January 2012 09:08 Go to previous messageGo to next message
Missing name Mising name is currently offline Missing name Mising name
Messages: 94
Registered: December 2010
Member
Very likely! Thanks.
None of the examples I found showed that, and the javadocs tend to be rather terse.
Re: How do I get a menu item to refresh? [message #777459 is a reply to message #777436] Tue, 10 January 2012 09:47 Go to previous message
Grant Gayed is currently offline Grant Gayed
Messages: 2128
Registered: July 2009
Senior Member
For a similar example see
http://git.eclipse.org/c/platform/eclipse.platform.swt.git/tree/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet73.java
..

Grant


On 1/10/2012 9:08 AM, Missing name Mising name wrote:
> Very likely! Thanks.
> None of the examples I found showed that, and the javadocs tend to be
> rather terse.
>
Previous Topic:[re-opened] Order of mixed 'action' and 'command' menu items in RCP
Next Topic:SSL through RCP application
Goto Forum:
  


Current Time: Thu May 23 09:57:23 EDT 2013

Powered by FUDForum. Page generated in 0.01546 seconds