KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > lexer > editorbridge > calc > CalcDataLoader


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.lexer.editorbridge.calc;
21
22 import java.io.IOException JavaDoc;
23 import org.openide.loaders.DataObjectExistsException;
24 import org.openide.loaders.MultiDataObject;
25 import org.openide.loaders.UniFileLoader;
26 import org.openide.filesystems.FileObject;
27 import org.openide.util.actions.SystemAction;
28 import org.openide.actions.OpenAction;
29 import org.openide.actions.FileSystemAction;
30 import org.openide.actions.CutAction;
31 import org.openide.actions.CopyAction;
32 import org.openide.actions.PasteAction;
33 import org.openide.actions.DeleteAction;
34 import org.openide.actions.RenameAction;
35 import org.openide.actions.ToolsAction;
36 import org.openide.actions.PropertiesAction;
37
38
39 /**
40  * Loader for calc data objects.
41  *
42  * @author Miloslav Metelka
43  * @version 1.00
44  */

45
46 public class CalcDataLoader extends UniFileLoader {
47
48     /** Mime type assigned to calc files */
49     public static final String JavaDoc CALC_MIME_TYPE = "text/x-calc"; // NOI18N
50

51     static final long serialVersionUID = 1L;
52     
53     public CalcDataLoader() {
54         super("org.netbeans.modules.lexer.editorbridge.calc.CalcDataObject"); // NOI18N
55
}
56
57     protected void initialize() {
58         super.initialize();
59         getExtensions().addMimeType(CALC_MIME_TYPE);
60     }
61
62     protected MultiDataObject createMultiObject(FileObject primaryFile)
63     throws DataObjectExistsException, IOException JavaDoc {
64         return new CalcDataObject(primaryFile, this);
65     }
66     
67     protected SystemAction[] defaultActions() {
68         return new SystemAction[] {
69             SystemAction.get(OpenAction.class),
70             SystemAction.get(FileSystemAction.class),
71             null,
72             SystemAction.get(CutAction.class),
73             SystemAction.get(CopyAction.class),
74             SystemAction.get(PasteAction.class),
75             null,
76             SystemAction.get(DeleteAction.class),
77             SystemAction.get(RenameAction.class),
78             null,
79             SystemAction.get(ToolsAction.class),
80             SystemAction.get(PropertiesAction.class),
81         };
82     }
83
84 }
85
Popular Tags