1 19 package org.netbeans.modules.xml.tools.generator; 20 21 import org.openide.nodes.Node; 22 import org.openide.loaders.DataObject; 23 24 import org.netbeans.modules.xml.core.XMLDataObject; 25 import org.netbeans.modules.xml.core.cookies.CookieFactory; 26 27 32 public class XMLGenerateSupportFactory extends CookieFactory { 33 34 private final XMLDataObject dataObject; 35 36 private static final Class [] SUPPORTED_COOKIES = new Class [] { 37 GenerateDTDSupport.class, 38 }; 39 40 41 42 public XMLGenerateSupportFactory (XMLDataObject dataObject) { 43 this.dataObject = dataObject; 44 } 45 46 47 49 protected Class [] supportedCookies () { 50 return SUPPORTED_COOKIES; 51 } 52 53 55 public Node.Cookie createCookie (Class clazz) { 56 if ( clazz.isAssignableFrom (GenerateDTDSupport.class) ) { 57 return new GenerateDTDSupport (this.dataObject); 58 } 59 60 return null; 61 } 62 63 64 68 public static final class Creator implements XMLDataObject.XMLCookieFactoryCreator { 69 70 72 public CookieFactory createCookieFactory (DataObject obj) { 73 return new XMLGenerateSupportFactory ((XMLDataObject) obj); 74 } 75 76 } 78 } 79 | Popular Tags |