1 19 20 25 26 package org.netbeans.modules.css.loader; 27 28 import org.openide.filesystems.FileObject; 29 import org.openide.loaders.DataObjectExistsException; 30 import org.openide.loaders.MultiDataObject; 31 import org.openide.loaders.UniFileLoader; 32 import org.openide.util.NbBundle; 33 34 39 public class CssFileLoader extends UniFileLoader{ 40 41 public static final String CSS_MIME_TYPE = "text/x-css"; 43 44 public CssFileLoader() { 45 super(org.netbeans.modules.css.loader.CssDataObject.class.getName()); 46 } 47 48 51 protected String defaultDisplayName() { 52 return NbBundle.getMessage(CssFileLoader.class, "CssLoaderName"); } 54 55 58 protected void initialize() { 59 super.initialize(); 60 getExtensions().addMimeType(CSS_MIME_TYPE); 61 } 62 63 protected FileObject findPrimaryFile(FileObject fo) { 64 if (fo.isFolder()) { 65 return null; 66 } 67 68 FileObject primaryFile = super.findPrimaryFile(fo); 69 if (primaryFile == null) { 70 return null; 71 } 72 return primaryFile; 73 } 74 75 79 protected MultiDataObject createMultiObject(FileObject primaryFile) throws DataObjectExistsException, java.io.IOException { 80 return new CssDataObject(primaryFile, this); 81 } 82 83 protected String actionsContext() { 84 return "Loaders/" + CSS_MIME_TYPE + "/Actions"; 85 } 86 } 87 | Popular Tags |