1 | public class ReturnResultTabAction extends SquirrelAction↵ | | 1 | public class UndoAction extends SquirrelAction
↵
|
2 | {↵ | | 2 | {↵
|
3 | /** Frame to be returned. */↵ | | |
|
4 | private ResultFrame _resultFrame;↵ | | |
|
|
5 | /**↵ | | |
|
6 | * Ctor.↵ | | |
|
7 | *↵ | | |
|
8 | * @param app Application API.↵ | | |
|
9 | * @param resultFrame Results frame to be returned.↵ | | |
|
10 | */↵ | | |
|
11 | public ReturnResultTabAction(IApplication app, ResultFrame resultFrame)↵ | | |
|
12 | throws IllegalArgumentException↵ | | |
|
| | | 3 | private UndoManager _undo;↵
|
|
| | | 4 | public UndoAction(IApplication app, UndoManager undo)
↵
|
13 | {↵ | | 5 | {
↵
|
14 | super(app);↵ | | 6 | super(app);
↵
|
15 | if (resultFrame == null)↵ | | 7 | if (undo == null)
↵
|
16 | {↵ | | 8 | {
↵
|
17 | throw new IllegalArgumentException("Null ResultFrame passed");↵ | | 9 | throw new IllegalArgumentException("UndoManager == null");
↵
|
18 | }↵ | | 10 | }↵
|
| | | 11 |
↵
|
19 | _resultFrame = resultFrame;↵ | | 12 | _↵
|
20 | }↵ | | |
|
| | | 13 | undo = undo;↵
|
| | | 14 | }↵
|
| | | 15 | /*↵
|
| | | 16 | * @see ActionListener#actionPerformed(ActionEvent)↵
|
| | | 17 | */
↵
|
21 | public void actionPerformed(ActionEvent evt)↵ | | 18 | public void actionPerformed(ActionEvent e)
↵
|
22 | {↵ | | 19 | {
↵
|
23 | new ReturnResultTabCommand(_resultFrame).execute↵ | | 20 | if (_undo.canUndo())↵
|
| | | 21 | {↵
|
24 | () | | 22 | _undo.undo()
|