1 19 20 package org.netbeans.modules.url; 21 22 import java.io.IOException ; 23 import org.openide.filesystems.FileObject; 24 import org.openide.loaders.DataObjectExistsException; 25 import org.openide.loaders.ExtensionList; 26 import org.openide.loaders.MultiDataObject; 27 import org.openide.loaders.UniFileLoader; 28 import org.openide.util.NbBundle; 29 30 35 public class URLDataLoader extends UniFileLoader { 36 37 38 static final long serialVersionUID =-7407252842873642582L; 39 40 private static final String URL_MIME_TYPE = "text/url"; 42 43 44 public URLDataLoader() { 45 super("org.netbeans.modules.url.URLDataObject"); } 47 48 49 53 protected void initialize () { 54 super.initialize(); 55 56 ExtensionList ext = new ExtensionList(); 57 ext.addMimeType(URL_MIME_TYPE); 58 ext.addMimeType("text/x-url"); setExtensions(ext); 60 } 61 62 63 protected String defaultDisplayName() { 64 return NbBundle.getMessage(URLDataLoader.class, 65 "PROP_URLLoader_Name"); } 67 68 74 protected String actionsContext () { 75 return "Loaders/text/url/Actions/"; } 77 78 81 protected MultiDataObject createMultiObject(FileObject primaryFile) 82 throws DataObjectExistsException, IOException { 83 return new URLDataObject(primaryFile, this); 84 } 85 86 } 87 | Popular Tags |