01: /*
02: * Project: AMODA - Abstract Modeled Application
03: * Class: de.gulden.framework.amoda.environment.gui.behaviour.CommandOpenRecentFileListEntry
04: * Version: snapshot-beautyj-1.1
05: *
06: * Date: 2004-09-29
07: *
08: * This is a snapshot version of the AMODA 0.2 development branch,
09: * it is not released as a seperate version.
10: * For AMODA, see http://amoda.berlios.de/.
11: *
12: * This is licensed under the GNU Lesser General Public License (LGPL)
13: * and comes with NO WARRANTY.
14: *
15: * Author: Jens Gulden
16: * Email: amoda@jensgulden.de
17: */
18:
19: package de.gulden.framework.amoda.environment.gui.behaviour;
20:
21: import de.gulden.framework.amoda.generic.behaviour.GenericCommand;
22: import java.io.*;
23: import java.net.*;
24: import java.util.*;
25:
26: /**
27: * Class CommandOpenRecentFileListEntry.
28: *
29: * @author Jens Gulden
30: * @version snapshot-beautyj-1.1
31: */
32: public class CommandOpenRecentFileListEntry extends GenericCommand {
33:
34: // ------------------------------------------------------------------------
35: // --- fields ---
36: // ------------------------------------------------------------------------
37:
38: protected File file;
39:
40: protected URL url;
41:
42: // ------------------------------------------------------------------------
43: // --- constructors ---
44: // ------------------------------------------------------------------------
45:
46: public CommandOpenRecentFileListEntry(File file) {
47: this .file = file;
48: }
49:
50: public CommandOpenRecentFileListEntry(URL url) {
51: this .url = url;
52: }
53:
54: // ------------------------------------------------------------------------
55: // --- method ---
56: // ------------------------------------------------------------------------
57:
58: public void perform() {
59: de.gulden.framework.amoda.model.document.Document doc = null;
60: if (file != null) {
61: ((de.gulden.framework.amoda.environment.gui.GUIApplication) getApplication())
62: .loadDocument(file);
63: } else if (url != null) {
64: ((de.gulden.framework.amoda.environment.gui.GUIApplication) getApplication())
65: .loadDocument(url);
66: }
67: }
68:
69: } // end CommandOpenRecentFileListEntry
|