• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Menu update

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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??
 
Marshal
Posts: 79151
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic