Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » JFace » Questions about JFace Menus
Questions about JFace Menus [message #764824] Mon, 12 December 2011 22:54 Go to next message
Bill  is currently offline Bill Friend
Messages: 13
Registered: February 2011
Junior Member
Returning to SWT/JFace development after a few years away, I wondered why in the past I avoided some JFace features as being more trouble than they're worth.

After trying to get menus and actions working, I'm not so surprised.

I read somewhere that there is no way to disable (gray out) a menu when you are using the JFace MenuManager and Actions approach. So if you want to programmatically disable some menu but still have it appear (but grayed out), you are out of luck.

Can anyone confirm this?

Can anyone please paste in a example of a JFace menu that goes a few levels deep.

For example:
File
..ABC
....XYZ
....123

The problem I am having is that the MenuManager seems to like to make cascading menus. The right arrow always appears to the right of the menu text, even when there is no child menu there.

TIA,
BE
Re: Questions about JFace Menus [message #764834 is a reply to message #764824] Mon, 12 December 2011 23:23 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
Am 12.12.11 23:54, schrieb Bill:
> Returning to SWT/JFace development after a few years away, I wondered
> why in the past I avoided some JFace features as being more trouble than
> they're worth.
>
> After trying to get menus and actions working, I'm not so surprised.
>
> I read somewhere that there is no way to disable (gray out) a menu when
> you are using the JFace MenuManager and Actions approach. So if you
> want to programmatically disable some menu but still have it appear (but
> grayed out), you are out of luck.
> Can anyone confirm this?

Wrong - attach an IMenuListener and call Action#setEnabled(false)

> Can anyone please paste in a example of a JFace menu that goes a few
> levels deep.
>
> For example:
> File
> .ABC
> ...XYZ
> ...123
>
> The problem I am having is that the MenuManager seems to like to make
> cascading menus. The right arrow always appears to the right of the
> menu text, even when there is no child menu there.
> TIA,
> BE

I'm not sure what you expect to happen or not happen - shows us your
code, describe the expected behavior and we'll show you the solution.

Tom
Re: Questions about JFace Menus [message #765108 is a reply to message #764824] Tue, 13 December 2011 12:41 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

The common UI approach for a submenu is to have the submenu there and enabled, and when you arm it have a no-op menu item underneath. It usually says something like <none> or <not enable> or <no actions available>.

PW


Previous Topic:Default button in Message Dialog Issue
Next Topic:How to show accel keys in menus (JFace Action)?
Goto Forum:
  


Current Time: Tue Mar 19 11:36:31 GMT 2024

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

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

Back to the top