Create New File Type resolver and associate the data type in Netbeans

1. make a new xml Document ( eg, PdbResolver)

2.choose DTD Constrained Documenton the second page of the new Xml Document wizard

3. On third page, in the DTD Public Id, choose, -//NetBeans//DTD MIME Resolver 1.0//EN,  from the drop down menu

4. save it

5. make a new java file , call it as DataObject ( eg: PdbDataObject), write ur code...

6. save it, and add

 @MIMEResolver.Registration(displayName = "PdbResolver", resource = "/alifea/gui/PdbResolver.xml")

for registering the mime tyoe to the data object file

7. In the layer file add
                <folder name="x-pdb">
 <folder name="Factories">
                    <file name="PdbDataLoader.instance">
                        <attr name="dataObjectClass" stringvalue="alifea.gui.filesystem.PdbDataObject"/>
                        <attr name="instanceCreate" methodvalue="org.openide.loaders.DataLoaderPool.factory"/>
                        <attr name="mimeType" stringvalue="text/x-pdb"/>
                    </file>
                </folder>
                </folder>

under the folder name :    <folder name="Loaders">

to register the data object as the loader of the file type

Comments

Popular posts from this blog

Printing of large double values in JAVA with or without scientific notation

To increase the size of heap memory for a Netbeans project

Adding/Updating Java projects from existing sources to Netbeans Project