1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
package org.argouml.model.euml; |
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
|
20 | |
public class CommandStackImpl { |
21 | |
|
22 | |
private EUMLModelImplementation modelImplementation; |
23 | |
|
24 | 0 | public CommandStackImpl(EUMLModelImplementation implementation) { |
25 | 0 | modelImplementation = implementation; |
26 | 0 | implementation.getEditingDomain().getCommandStack().flush(); |
27 | 0 | } |
28 | |
|
29 | |
public boolean canRedo() { |
30 | 0 | return modelImplementation.getEditingDomain().getCommandStack() |
31 | |
.canRedo(); |
32 | |
} |
33 | |
|
34 | |
public boolean canUndo() { |
35 | 0 | return modelImplementation.getEditingDomain().getCommandStack() |
36 | |
.canUndo(); |
37 | |
} |
38 | |
|
39 | |
public String getRedoLabel() { |
40 | 0 | return canRedo() ? modelImplementation.getEditingDomain() |
41 | |
.getCommandStack().getRedoCommand().getLabel() |
42 | |
: null; |
43 | |
} |
44 | |
|
45 | |
public String getUndoLabel() { |
46 | 0 | return canUndo() ? modelImplementation.getEditingDomain() |
47 | |
.getCommandStack().getUndoCommand().getLabel() |
48 | |
: null; |
49 | |
} |
50 | |
|
51 | |
public boolean isCommandStackCapabilityAvailable() { |
52 | 0 | return true; |
53 | |
} |
54 | |
|
55 | |
public void redo() { |
56 | 0 | modelImplementation.getEditingDomain().getCommandStack().redo(); |
57 | 0 | } |
58 | |
|
59 | |
public void undo() { |
60 | 0 | modelImplementation.getEditingDomain().getCommandStack().undo(); |
61 | 0 | } |
62 | |
|
63 | |
} |