Using the outliner for JSON custom property editing?

I have a question about how I might be able to re-use the Blender outliner code, please.

I am learning how to make Blender add-ons, to make tools for integrating Blender with Unity3D, and I would love to be able to edit custom JSON properties on Blender objects, which the exporter could pass through to Unity, whose importer could then create and configure Unity objects based on that JSON data.

Next I’ll make higher level visual tools that create the JSON data for you, so you don’t have to edit it by hand.

But a good first step is to have a general purpose JSON viewer and editor, to get started with.

So I have made a simple plug-in to start with, that looks for a custom property named “json_data”, and pretty prints it in the object properties tab.

And now I’d like to make a simple interactive outliner that lets you (initially) browse and (eventually) edit the json data.

Do you think it would be a good idea to re-use some of the Blender outliner code, or is that an overkill, and I should just roll my own with the lower level Blender user interface widgets?

It doesn’t need anything fancy like drag-and-drop at this point (though that would be a nice luxury), it can just be driven by pop-up menus on the items to start with.

And it would be nice to have type specific controls like checkboxes for booleans, sliders or numeric fields for numbers, single and multi line text editors for strings, etc.

Do you know if anybody else has done something like that which I could look at or help out with?

Also, could you please link me to the outliner source code where I can browse it online?

Even if I end up rolling my own simple outliner, I’d like to read the fancy one to learn how to do that kind of stuff.

I do love outliners! Here’s a weird but fun one I wrote a long time ago in PostScript, for browsing and editing PostScript data structures in the NeWS window system (which are much like JSON: polymorphic arrays and dictionaries of strings, numbers, and booleans values, etc.)

Here’s some more stuff about outliners and their sordid history that I wrote about on Hacker News:

You should check out David Winer’s demos of Frontier, and his talk about this history of outliners — it’s got a really wonderful user interface, that he put a lot of thought and trial and error and effort into it!