01: package com.sun.portal.ffj.loaders;
02:
03: import org.openide.actions.EditAction;
04: import org.openide.actions.OpenAction;
05: import org.openide.actions.ViewAction;
06: import org.openide.actions.FileSystemAction;
07: import org.openide.actions.CutAction;
08: import org.openide.actions.CopyAction;
09: import org.openide.actions.PasteAction;
10: import org.openide.actions.DeleteAction;
11: import org.openide.actions.RenameAction;
12: import org.openide.actions.ToolsAction;
13: import org.openide.actions.PropertiesAction;
14:
15: import org.openide.loaders.MultiDataObject;
16: import org.openide.loaders.DataObjectExistsException;
17: import org.openide.loaders.FileEntry;
18: import org.openide.loaders.UniFileLoader;
19:
20: import org.openide.filesystems.FileObject;
21: import org.openide.filesystems.FileUtil;
22:
23: import org.openide.util.actions.SystemAction;
24:
25: import com.sun.portal.ffj.util.PSConstants;
26: import com.sun.portal.ffj.util.PSFormat;
27:
28: public class PortletLoader extends UniFileLoader implements PSConstants {
29:
30: public PortletLoader() {
31: super (PortletDataObject.class);
32: }
33:
34: protected FileObject findPrimaryFile(FileObject fo) {
35: String ext = fo.getExt();
36: if (ext.equals(PORTLET_EXT)) {
37: return fo;
38: }
39:
40: return null;
41: }
42:
43: protected SystemAction[] defaultActions() {
44: return new SystemAction[] { SystemAction.get(OpenAction.class),
45: SystemAction.get(FileSystemAction.class), null,
46: SystemAction.get(CutAction.class),
47: SystemAction.get(CopyAction.class),
48: SystemAction.get(PasteAction.class), null,
49: SystemAction.get(DeleteAction.class), null,
50: SystemAction.get(ToolsAction.class),
51: SystemAction.get(PropertiesAction.class) };
52: }
53:
54: protected MultiDataObject createMultiObject(FileObject primaryFile)
55: throws DataObjectExistsException {
56: return new PortletDataObject(primaryFile, this );
57: }
58:
59: protected MultiDataObject.Entry createPrimaryEntry(
60: MultiDataObject obj, FileObject primaryFile) {
61: return new PSFormat(obj, primaryFile);
62: }
63: }
|