• 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 ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

GUI Action Strategy

Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi. I have an application where almost anything can be invoked by an Action. For actions that can be invoked from multiple places (i.e a toolbar and a menu), I use the same Action object to allow for enabling/disabling the actions.

My question is really about how to develop a strategy for which actions to enable and disable when. Every one of my actions has an update() method that sets it enabled or disabled based on the current state of the application, but I don't want to call update on all my actions every time I do anything. I'd only like to update the ones I need to, but I'm not really sure how to separate them properly. Any thoughts would be appreciated.

Always! Wait. Never. Shut up. Look at this tiny ad.
Garden Master Course kickstarter
    Bookmark Topic Watch Topic
  • New Topic