1 19 package org.netbeans.modules.java.jarloader; 20 21 import java.io.IOException ; 22 import org.openide.actions.CopyAction; 23 import org.openide.actions.CutAction; 24 import org.openide.actions.DeleteAction; 25 import org.openide.actions.FileSystemAction; 26 import org.openide.actions.PasteAction; 27 import org.openide.actions.PropertiesAction; 28 import org.openide.actions.RenameAction; 29 import org.openide.actions.ToolsAction; 30 import org.openide.filesystems.FileObject; 31 import org.openide.loaders.DataObjectExistsException; 32 import org.openide.loaders.ExtensionList; 33 import org.openide.loaders.MultiDataObject; 34 import org.openide.loaders.UniFileLoader; 35 import org.openide.util.NbBundle; 36 import org.openide.util.actions.SystemAction; 37 38 42 public final class JarDataLoader extends UniFileLoader { 43 44 private static final long serialVersionUID = 1L; 45 46 public JarDataLoader() { 47 super("org.netbeans.modules.java.jarloader.JarDataObject"); } 49 50 protected String defaultDisplayName() { 51 return NbBundle.getMessage(JarDataLoader.class, "LBL_loaderName"); 52 } 53 54 protected void initialize() { 55 super.initialize(); 56 ExtensionList extensions = new ExtensionList(); 57 extensions.addExtension("jar"); extensions.addExtension("zip"); extensions.addExtension("war"); extensions.addExtension("ear"); setExtensions(extensions); 64 } 65 66 protected SystemAction[] defaultActions() { 67 return new SystemAction[] { 68 SystemAction.get(FileSystemAction.class), 69 null, 70 SystemAction.get(CutAction.class), 71 SystemAction.get(CopyAction.class), 72 SystemAction.get(PasteAction.class), 73 null, 74 SystemAction.get(DeleteAction.class), 75 SystemAction.get(RenameAction.class), 76 null, 77 SystemAction.get(ToolsAction.class), 78 SystemAction.get(PropertiesAction.class), 79 }; 80 } 81 82 protected MultiDataObject createMultiObject(FileObject primaryFile) throws DataObjectExistsException, IOException { 83 return new JarDataObject(primaryFile, this); 84 } 85 86 } 87 | Popular Tags |