01: /*
02: * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
03: * PROPRIETARY/CONFIDENTIAL. Use of this product is subject to license terms.
04: */
05:
06: package com.sun.portal.ffj.loaders;
07:
08: import org.openide.actions.EditAction;
09: import org.openide.actions.OpenAction;
10: import org.openide.actions.ViewAction;
11: import org.openide.actions.FileSystemAction;
12: import org.openide.actions.CutAction;
13: import org.openide.actions.CopyAction;
14: import org.openide.actions.PasteAction;
15: import org.openide.actions.DeleteAction;
16: import org.openide.actions.RenameAction;
17: import org.openide.actions.ToolsAction;
18: import org.openide.actions.PropertiesAction;
19:
20: import org.openide.filesystems.FileObject;
21: import org.openide.filesystems.FileUtil;
22:
23: import org.openide.util.NbBundle;
24: import org.openide.util.actions.SystemAction;
25:
26: import org.openide.loaders.DataObjectExistsException;
27: import org.openide.loaders.DataNode;
28: import org.openide.loaders.FileEntry;
29: import org.openide.loaders.MultiDataObject;
30: import org.openide.loaders.MultiDataObject.Entry;
31: import org.openide.loaders.UniFileLoader;
32:
33: import com.sun.portal.ffj.actions.PSGroupAction;
34: import com.sun.portal.ffj.util.PSConstants;
35: import com.sun.portal.ffj.util.PSFormat;
36:
37: public class PSXmlLoader extends UniFileLoader implements PSConstants {
38:
39: public PSXmlLoader() {
40: super (PortletAppDataObject.class);
41: }
42:
43: protected void initialize() {
44: super .initialize();
45:
46: String displayName = NbBundle.getMessage(PSXmlLoader.class,
47: "LBL_PSXmlLoader");
48: setDisplayName(displayName);
49: }
50:
51: protected SystemAction[] defaultActions() {
52: return new SystemAction[] { SystemAction.get(OpenAction.class),
53: SystemAction.get(FileSystemAction.class), null,
54: SystemAction.get(CutAction.class),
55: SystemAction.get(CopyAction.class),
56: SystemAction.get(PasteAction.class), null,
57: SystemAction.get(DeleteAction.class), null,
58: SystemAction.get(ToolsAction.class),
59: SystemAction.get(PropertiesAction.class), null,
60: SystemAction.get(PSGroupAction.class) };
61: }
62:
63: protected MultiDataObject createMultiObject(FileObject primaryFile)
64: throws DataObjectExistsException {
65: return new PSXmlDataObject(primaryFile, this );
66: }
67:
68: protected FileObject findPrimaryFile(FileObject fo) {
69:
70: if (fo.hasExt(PS_XML_EXT)) {
71: return fo;
72: }
73:
74: return null;
75: }
76:
77: protected MultiDataObject.Entry createPrimaryEntry(
78: MultiDataObject obj, FileObject primaryFile) {
79: return new PSFormat(obj, primaryFile);
80: }
81: }
|