• Post Reply Bookmark Topic Watch Topic
  • New Topic

Menu update

 
Diarmuid McDonald
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am currently working on an eclipse RCP client. My apologies if this the wrong forum.

I have 2 actions, which are associated with 2 Menu items. When one action is enabled the other is disabled.

The problem I am having is that when a user selects a menu item, the other action is never notified, and there is never enabled. Both actions implement org.eclipse.ui.IWorkbenchWindowActionDelegate. Is there a way to involke the selectionChanged() on other actions??
 
Campbell Ritchie
Marshal
Posts: 52580
119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not quite sure what you are trying to do. You could try a disable method in each button:-

Just be careful that there is no possibility of your setting up an endless loop, or your buttons will be going on and off like Christmas tree lights for the rest of the runtime of your application.

Have you tried putting buttons in ButtonGroups (javax.swing.ButtonGroup)? I have never tried it for ordinary buttons, but it works for radio buttons. If you activate one radio button, all the other buttons are automatically inactivated.

Any other suggestions, anybody else??

[edit]There are menu items in Java which look like radio buttons. Look through the javax.swing API. I have never used them myself, but they might be what you are looking for.[/edit]
[ August 16, 2006: Message edited by: Campbell Ritchie ]
 
Diarmuid McDonald
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This doesnt use swing, eclipse uses SWT/JFace.

You add actions to a Menu (equivilant to a JMenu in Swing)

When a Menu item is selected an action is called. However each action has no reference to other actions
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!