1 | public class EditCommand implements Command {↵ | | 1 | public class ReportEditCommand implements Command {↵
|
2 | private static final Set commands = new HashSet();↵ | | 2 | private static final Set commands = new HashSet();↵
|
|
3 | static {↵ | | 3 | static {↵
|
4 | commands.add(ActionNames.EDIT);↵ | | 4 | commands.add("edit");↵
|
5 | }↵ | | 5 | }↵
|
|
6 | public EditCommand() {↵ | | 6 | public ReportEditCommand() {↵
|
7 | }↵ | | 7 | }↵
|
|
8 | public void doAction(ActionEvent e) {↵ | | 8 | public void doAction(ActionEvent e) {↵
|
9 | GuiPackage guiPackage = GuiPackage.getInstance();↵ | | 9 | ReportGuiPackage guiPackage = ReportGuiPackage.getInstance();↵
|
10 | guiPackage.getMainFrame().setMainPanel((javax.swing.JComponent) guiPackage.getCurrentGui());↵ | | 10 | guiPackage.getMainFrame().setMainPanel((javax.swing.JComponent) guiPackage.getCurrentGui());↵
|
11 | guiPackage.getMainFrame().setEditMenu(guiPackage.getTreeListener().getCurrentNode().createPopupMenu());↵ | | 11 | guiPackage.getMainFrame().setEditMenu(guiPackage.getTreeListener().getCurrentNode().createPopupMenu());↵
|
12 | // TODO: I believe the following code (to the end of the method) is↵ | | 12 | // TODO: I believe the following code (to the end of the method) is↵
|
13 | // obsolete,↵ | | 13 | // obsolete,↵
|
14 | // since NamePanel no longer seems to be the GUI for any component:↵ | | 14 | // since NamePanel no longer seems to be the GUI for any component:↵
|
15 | if (!(guiPackage.getCurrentGui() instanceof NamePanel)) {↵ | | 15 | if (!(guiPackage.getCurrentGui() instanceof NamePanel)) {↵
|
16 | guiPackage.getMainFrame().setFileLoadEnabled(true);↵ | | 16 | guiPackage.getMainFrame().setFileLoadEnabled(true);↵
|
17 | guiPackage.getMainFrame().setFileSaveEnabled(true);↵ | | 17 | guiPackage.getMainFrame().setFileSaveEnabled(true);↵
|
18 | } else {↵ | | 18 | } else {↵
|
19 | guiPackage.getMainFrame().setFileLoadEnabled(false);↵ | | 19 | guiPackage.getMainFrame().setFileLoadEnabled(false);↵
|
20 | guiPackage.getMainFrame().setFileSaveEnabled(false);↵ | | 20 | guiPackage.getMainFrame().setFileSaveEnabled(false);↵
|
21 | }↵ | | 21 | }↵
|
22 | }↵ | | 22 | }↵
|
|
23 | public Set getActionNames() {↵ | | 23 | public Set getActionNames() {↵
|
24 | return commands;↵ | | 24 | return commands;↵
|
25 | | | 25 |
|