[Java] [Command Patterns]
The simple editor application consists of two files:TestEditor.java and Document.java.
incomplete code:drive.google.com/drive/folders/1tH8H5xjlCUaGC7_cpw7lgyY0l5zSnxWf?usp=sharing
1. Modify this editor so you can undo/redo actions. You willprobably need an invoker.
2. Implement a parametrized multi-level undo / redo
myDocument.Write(“Hey I just metyou”);
myDocument.Write(“And this iscrazy”);
myDocument.Write(“But here’s mynumber”);
myDocument.Undo(0);
System.out.println(myDocument.Read());
Will give the following output:
—- Contents of: callmemaybe —-
0:And this is crazy
1:But here’s my number
and
myDocument.Write(“Hey I just metyou”);
myDocument.Write(“And this iscrazy”);
myDocument.Write(“But here’s mynumber”);
myDocument.Undo(2);
System.out.println(myDocument.Read());
The following output:
—- Contents of: callmemaybe —-
0:Hey I just met you
1:And this is crazy
Expert
OR
PayPal Gateway not configured
OR
PayPal Gateway not configured
PayPal Gateway not configured
PayPal Gateway not configured