File tree Expand file tree Collapse file tree 2 files changed +67
-0
lines changed
examples/demo/src/main/java/com/abstractundo Expand file tree Collapse file tree 2 files changed +67
-0
lines changed Original file line number Diff line number Diff line change 1+ package com .abstractundo ;
2+
3+ import liquidjava .specification .ExternalRefinementsFor ;
4+ import liquidjava .specification .StateRefinement ;
5+ import liquidjava .specification .StateSet ;
6+
7+
8+
9+ @ StateSet ({"aliveDone" , "aliveNotDone" , "notAlive" })
10+ @ ExternalRefinementsFor ("javax.swing.undo.AbstractUndoableEdit" )
11+ public interface AbstractUndoRefinements {
12+
13+ @ StateRefinement (to ="aliveDone(this)" )
14+ void AbstractUndoableEdit ();
15+
16+ @ StateRefinement (from ="aliveNotDone(this)" , to ="aliveDone(this)" )
17+ void redo ();
18+
19+ @ StateRefinement (from ="aliveDone(this)" , to ="aliveNotDone(this)" )
20+ void undo ();
21+
22+ @ StateRefinement (from ="!notAlive(this)" , to ="notAlive(this)" )
23+ void die ();
24+
25+
26+ // anything
27+ // boolean canRedo();
28+ // boolean canUndo();
29+
30+ // boolean addEdit(UndoableEdit anEdit);
31+ // String getPresentationName();
32+ // String getRedoPresentationName();
33+ // String getUndoPresentationName();
34+ // boolean isSignificant();
35+ // boolean replaceEdit(UndoableEdit anEdit);
36+ // String toString();
37+
38+
39+ }
Original file line number Diff line number Diff line change 1+ package com .abstractundo ;
2+
3+ import javax .swing .undo .AbstractUndoableEdit ;
4+
5+ public class TestAbstractUndo {
6+
7+ void test1 (){
8+ AbstractUndoableEdit a = new AbstractUndoableEdit ();
9+ a .redo ();
10+ }
11+
12+ void test2 (){
13+ AbstractUndoableEdit a = new AbstractUndoableEdit ();
14+ a .undo ();
15+ a .redo ();
16+ a .undo ();
17+ a .undo ();
18+ }
19+
20+ void test3 (){
21+ AbstractUndoableEdit a = new AbstractUndoableEdit ();
22+ a .undo ();
23+ a .redo ();
24+ a .undo ();
25+ a .die ();
26+ a .redo ();
27+ }
28+ }
You can’t perform that action at this time.
0 commit comments