Hi,

following 

https://platform.netbeans.org/tutorials/nbm-filetype.html

maybe the missing peace is that you can extend DataObject and you add an object 
to its 
lookup which provides support for your specific data.

public class ABCDataObject extends MultiDataObject {

    public ABCObject(FileObject pf, MultiFileLoader loader) throws 
DataObjectExistsException, 
IOException {
        super(pf, loader);
        CookieSet cookieSet = getCookieSet();
        
        ABCSpecificFunctionality impl = new ABCSpecificFunctionality();
        cookieSet.assign(iABCSpecificFunctionality.class, impl);
       
        registerEditor("yourmimetype", true);
    }
...
}

Maybe this CookieSet stuff is the old style. Better use the new Lookup classes

Hope this helps a bit.

best regards
Oliver

> Hello - and apologies for what is probably a dumb question.
> 
> I am trying to create a Netbeans plugin that allows editing of a binary
> file type (with is basically a two dimensional array) via a Visual Editor
> containing a JTable.
> 
> I have a model class that extends AbstractTableModel, and I have followed
> the New File tutorial but I am unsure of where to parse the binary file,
> and of which class the model class be a property of?
> 
> Q. Should the model be a property of DataObject or of the VisualElement?
> 
> Q. When to parse the binary file?  When DataObject is created, or in one of
> the methods of VisualElement e.g. ComponentOpened ?
> 
> 
> Can anybody recommend some similar plugin(s) I could look it to try and
> help me fit these last pieces together?
> 
> Many thanks!


Reply via email to