Skip to main content


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] Tue, 10 January 2012 01:37 Go to next message
Missing name Mising name is currently offline Missing name Mising nameFriend
Messages: 105
Registered: December 2010
Senior 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 12:51 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
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 14:08 Go to previous messageGo to next message
Missing name Mising name is currently offline Missing name Mising nameFriend
Messages: 105
Registered: December 2010
Senior 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 14:47 Go to previous message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
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 Apr 25 12:41:50 GMT 2024

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

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

Back to the top