undo

Design Pattern for Undo Engine

I'm writing a structural modeling tool for a civil enginering application. I have one huge model class representing the entire building, which include collections of nodes, line elements, loads, etc. which are also custom classes. I have already coded an undo engine which saves a deep-copy of the model class after each modification to ...

Undo with GTK TextView

I'm trying to keep dependencies to a minimum for a program I contribute to, it's a small text editor. GTK Textview doesn't seem to come with a built-in undo function. Is there any reference implementation I've been missing on so far? Is everyone writing their own undo function for their TextView widgets? I'll be happy about any sample ...

Undoing a git rebase

Does anybody know how to easily undo a git rebase? The only way that comes to mind is to go at it manually: git checkout the commit parent to both of the branches then create a temp branch from there cherry-pick all commits by hand replace the branch in which I rebased by the manually-created branch In my current situation this is ...

ASP.net Web App undo support

Hello, I have a simple web form that has a several fields and a gridview on it. I also have a save and cancel button. I would like a way to undo what was done to the data on the form when the user presses cancel. This is simple enough with the fields however since changes to the gridview happen in real time against the database I do n...

What's the best way to implement gmail style "undo" in Rails?

I think it important to have an "undo" method ala gmail when destroying records instead of displaying an annoying popup that says, "Are you sure?". The way that I've implemented this is to have a "deleted_at" timestamp column in the model which gets timestamped when destroy method is called def destroy @foo = Foo.find(params[:id]) ...

Undoing a commit in TortoiseSVN

I commited a bunch of files (dozens of files in different folders) by accident. What is the easiest, cleanest (and safest!) way to 'undo' that commit w/o having to delete the files from my working directory? ...

.NET RichTextBox undo

I'm using a RichTextBox in WinForms 3.5 and I found that when I programmatically edit the contained text, those changes are no longer available to the built in undo functionality. Is there a way to make it so these changes are available for undo/redo? ...

I need some help in Undo function in Java

I write a Text Editor with Java , and I want to add Undo function to it but without UndoManager Class , I need to use a Data Structure like Stack or LinkedList but the Stack class in Java use Object parameters e.g : push(Object o) , Not Push(String s) I need some hints or links . Thanks ...

Building undo into an Excel VBA macro

Excel macros don't seem to allow the use of "undo" after running them. Is there any way to bake undo functionality into a VBA macro in Excel? ...

Undo "git add"?

Git newbie here, quick question. I mistakenly added files using the command "git add file". I have not yet run "git commit". Is there a way to remove these files from the commit? ...

How to undo changes on JSpinner?

I need to validate the user input of a JSpinner, and if invalid, I need to undo (rollback) the value change. What is the best way to do it? ...

How to implement undo/redo of files mapped in a treeview

Can anyone give an idea of how should I implement undo/redo of files (dirs, subdirs) mapped in a treeview - C#? Would be great some code samples ...

Hide certain actions from Swing's undo manager

I am trying to write a JTextPane which supports some sort of coloring: as the user is typing the text, I am running some code that colors the text according to a certain algorithm. This works well. The problem is that the coloring operations is registered with the undo manager (a DefaultDocumentEvent with EventType.CHANGE). So when the ...

how do I undo a checkin in bitkeeper that isn't part of a changeset?

I have a file in a project that is in a bitkeeper repository. I checked in a file but I haven't committed the change to create a changeset. How can I undo the checkin? If I had a changeset I could undo the commit with: bk undo -r<rev> But in this case I can't commit and undo the changeset because I have other checked-in files that ...

undo/redo with cascading deletions

I'm trying to implement an undo/redo feature into my application, using the Command Pattern. I'm facing a problem. To illustrate it, let's imagine you can create with my application 2D profiles (as many as you want). From these 2D profiles, you can then create a 3D part with different attributes (name, colour, scale, etc.). +---------...

Undo in a transactional database

I do not know how to implement undo property of user-friendly interfaces using a transactional database. On one hand it is advisable that the user has multilevel (infinite) undoing possibility as it is stated here in the answer. Patterns that may help in this problem are Memento or Command. However, using a complex database including ...

How to allow my control to detect the Escape key before the DataGridView close my control?

I have a control with an undo feature, when the user press Escape the control will revert the original value. The problem is when I integrated my control to DataGridView. The DataGridView "eats" the Escape key, hence my control cannot detect the Escape key. When I put "return true" on EditingControlWantsInputKey, my control was able t...

How to undo the last checked checkbox?

Hi I created a javascript function to check if the number of modules selected is greater than a given value. So each time a checkbox is called the function is called, and the function goes through all the checkboxes and calculates the total to see if it's greater. But the problem is when the user checks the checkbox and if the total cred...

git how to undo changes of one file?

I have a git repository, After the last commit, I modified a bunch of file. but I want to undo the changes to one of these file, as in reset it to the same version of itself that's in the repository, but I want to undo the change to that file alone! nothing else with it. How do I do that? assuming it's possible of course .. ...

How to utilize sqlite for undo/redo features?

I'm writing a desktop application to do vector drawing in C++, and considering using sqlite to back my undo/redo feature. Has anybody used sqlite for undo/redo features? How does it work out for you? Clarification: I was aware of the stack approach, I have even implemented one application with that approach. The problem I encountered...