diff options
Diffstat (limited to 'tutorial/examples/mixin/Undo.oj')
-rw-r--r-- | tutorial/examples/mixin/Undo.oj | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tutorial/examples/mixin/Undo.oj b/tutorial/examples/mixin/Undo.oj new file mode 100644 index 0000000..66ad9a9 --- /dev/null +++ b/tutorial/examples/mixin/Undo.oj @@ -0,0 +1,19 @@ +package examples.mixin;
+
+
+public class Undo
+{
+ inherited String getText();
+ inherited void setText(String s);
+
+ String lastText;
+
+ public void setText(String s) {
+ lastText = getText();
+ super.setText(s);
+ }
+
+ public void undo() {
+ super.setText(lastText);
+ }
+}
|