KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > de > gulden > framework > amoda > environment > gui > behaviour > CommandOpenRecentFileListEntry


1 /*
2  * Project: AMODA - Abstract Modeled Application
3  * Class: de.gulden.framework.amoda.environment.gui.behaviour.CommandOpenRecentFileListEntry
4  * Version: snapshot-beautyj-1.1
5  *
6  * Date: 2004-09-29
7  *
8  * This is a snapshot version of the AMODA 0.2 development branch,
9  * 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     // ------------------------------------------------------------------------
44
// --- constructors ---
45
// ------------------------------------------------------------------------
46

47     public CommandOpenRecentFileListEntry(File file) {
48         this.file=file;
49     }
50
51     public CommandOpenRecentFileListEntry(URL url) {
52         this.url=url;
53     }
54
55
56     // ------------------------------------------------------------------------
57
// --- method ---
58
// ------------------------------------------------------------------------
59

60     public void perform() {
61         de.gulden.framework.amoda.model.document.Document doc=null;
62         if (file!=null) {
63             ((de.gulden.framework.amoda.environment.gui.GUIApplication)getApplication()).loadDocument(file);
64         } else if (url!=null) {
65             ((de.gulden.framework.amoda.environment.gui.GUIApplication)getApplication()).loadDocument(url);
66         }
67     }
68
69 } // end CommandOpenRecentFileListEntry
70
Popular Tags