1 19 20 package org.netbeans.modules.j2ee.ddloaders.ejb; 21 22 import java.io.IOException ; 23 25 import org.openide.actions.*; 26 import org.openide.filesystems.FileObject; 27 import org.openide.loaders.UniFileLoader; 28 import org.openide.loaders.MultiDataObject; 29 import org.openide.loaders.DataObjectExistsException; 30 31 import org.openide.util.actions.SystemAction; 32 import org.openide.util.NbBundle; 33 import org.netbeans.modules.j2ee.ddloaders.multiview.*; 34 35 41 public class EjbJarDataLoader extends UniFileLoader { 42 43 private static final long serialVersionUID = 8616780278674213L; 44 private static final String REQUIRED_MIME_PREFIX_1 = "text/x-dd-ejbjar2.0"; private static final String REQUIRED_MIME_PREFIX_2 = "text/x-dd-ejbjar2.1"; 47 public EjbJarDataLoader () { 48 this("org.netbeans.modules.j2ee.ddloaders.multiview.EjbJarMultiViewDataObject"); } 50 51 public EjbJarDataLoader(String name){ 52 super(name); 53 } 54 55 protected String defaultDisplayName () { 56 return NbBundle.getMessage (EjbJarDataLoader.class, "LBL_loaderName"); 57 } 58 59 protected String actionsContext() { 60 return "Loaders/text/x-dd/Actions/"; } 62 63 protected void initialize () { 64 super.initialize (); 65 String [] supportedTypes = getSupportedMimeTypes(); 66 for (int i = 0; i < supportedTypes.length; i++) { 67 getExtensions().addMimeType(supportedTypes[i]); 68 } 69 } 70 71 protected MultiDataObject createMultiObject (FileObject primaryFile) 72 throws DataObjectExistsException, IOException { 73 return new EjbJarMultiViewDataObject(primaryFile, this); 74 } 75 76 79 protected String [] getSupportedMimeTypes(){ 80 return new String []{REQUIRED_MIME_PREFIX_1, REQUIRED_MIME_PREFIX_2}; 81 } 82 } 83 | Popular Tags |