Skip to main content



      Home
Home » Eclipse Projects » JFace » Questions about JFace Menus
Questions about JFace Menus [message #764824] Mon, 12 December 2011 17:54 Go to next message
Eclipse UserFriend
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 18:23 Go to previous messageGo to next message
Eclipse UserFriend
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 07:41 Go to previous message
Eclipse UserFriend
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 Jul 08 18:40:02 EDT 2025

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

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

Back to the top