1 19 package org.netbeans.modules.mdr; 20 21 import org.openide.loaders.*; 22 import org.openide.filesystems.FileObject; 23 import java.io.IOException ; 24 25 29 public class MDRLoader extends UniFileLoader { 30 private static final String MDR_EXTENSION = "mdr"; 32 33 public MDRLoader() { 34 super("org.netbeans.modules.mdr.MDRDataObject"); ExtensionList mdrExt = new ExtensionList(); 36 mdrExt.addExtension(MDR_EXTENSION); 37 this.setExtensions(mdrExt); 38 } 39 40 public MultiDataObject createMultiObject(FileObject primaryFile) throws DataObjectExistsException, IOException { 41 return new MDRDataObject(primaryFile, this); 42 } 43 44 protected FileObject findPrimaryFile (FileObject fo) { 45 FileObject result = super.findPrimaryFile(fo); 46 if (result == null) 47 return null; 48 String fileName = result.getName(); 49 if (fileName.indexOf('[')==-1 || fileName.indexOf(']')==-1) 50 return null; 51 return result; 52 } 53 54 } 55 | Popular Tags |