• 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

Undo/Redo

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm trying to implement an undo/redo mechanism in my application, and I want to be able to handle actions which are more complex than text events. For example, I want undo/redo operations (e.g. update, delete, etc.) for custom objects used by my application.

Would it be possible to use the API provided by Swing (UndoManager, etc.) to handle these types of operations or would I need to write something myself? From what I've read so far, it seems like I'll need to do it myself since the API seems to only support text edits. Am I heading down the right track or do I need to use the API? Thanks for any input.
 
Ranch Hand
Posts: 203
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
update and delete of what?

If you taking about data swing does't provide you have to do it urself.
 
J. Ryan
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I mean I am modifiying the fields of custom objects, deleting objects, creating new ones, etc. So for anything other than simple text edits of text fields I should use my own history manager?
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, you need to do that in your own code. Swing has no way of keeping track of what the application is doing.
 
Get me the mayor's office! I need to tell him about this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic