01: package testRename;
02:
03: import java.io.IOException;
04: import org.openide.filesystems.FileObject;
05: import org.openide.loaders.DataObjectExistsException;
06: import org.openide.loaders.MultiDataObject;
07: import org.openide.loaders.UniFileLoader;
08: import org.openide.util.NbBundle;
09:
10: public class MyDataLoader extends UniFileLoader {
11:
12: public static final String REQUIRED_MIME = "text/x-my";
13:
14: private static final long serialVersionUID = 1L;
15:
16: public MyDataLoader() {
17: super ("testRename.MyDataObject");
18: }
19:
20: protected String defaultDisplayName() {
21: return NbBundle.getMessage(MyDataLoader.class,
22: "LBL_My_loader_name");
23: }
24:
25: protected void initialize() {
26: super .initialize();
27: getExtensions().addMimeType(REQUIRED_MIME);
28: }
29:
30: protected MultiDataObject createMultiObject(FileObject primaryFile)
31: throws DataObjectExistsException, IOException {
32: return new MyDataObject(primaryFile, this );
33: }
34:
35: protected String actionsContext() {
36: return "Loaders/" + REQUIRED_MIME + "/Actions";
37: }
38:
39: }
|