So, thinking about what we could share, some weeks ago I took some spare time to start working on an add-in authoring add-in for MonoDevelop, that is, an extension that will help developing add-ins for any Mono.Addins based application. This extension still needs a lot of work to be useful, but I thought that it would be good to show what I have in mind with some screenshots. Nothing of all this is yet in SVN, and won't be for some time since there are still many things to be finished.
Everything starts when creating a project. The new project dialog is now a two-step wizard. Well, this is not new in this extension. If you update MD from SVN you'll already get this new dialog. Hmm, I planned to talk about it in another post, but I guess it's ok to talk about it now. The first step of the wizard is the same we always had: it allows choosing the kind of project to create and its location and name:

The second step is new, and allows selecting a set of features we want to enable in the project. Some of the features may be already enabled depending on the kind of project. Other features can be enabled by the user. This list of features is of course extensible, so add-ins can define new features. It looks like this:

The previous screenshot shows the new Add-in Support feature. That's the only one not yet in SVN, the other ones are already available if you update from SVN. What I like about this feature list is that it helps the user in discovering what MonoDevelop can do. There are many features hidden in contextual menus and in options dialogs. The Project Feature List helps in making those features easier to select and configure.
OK, so lets go back to the add-in authoring extension. What does the Add-in Support project feature provide? It allows defining a project as being an add-in or an add-in host. In case of choosing the 'add-in' option (the only one I have partially implemented), it allows selecting the add-in registry (needed to find the add-in host or other add-ins to be extended), and allows entering basic information about the add-in.
The new project will have a new element in the solution tree: "Add-in description". Clicking on it will show a window which will allow describing the contents of the add-in:

This window will have several tabs. The first one (shown in the previous screenshot) will allow entering basic header information about the add-in. But the most interesting one is the Extensions tab:

OK, it doesn't look so interesting, but that's because the project is new and we still don't have nothing there. This tab will show the list of extension points being extended by the add-in. So, the next thing to do would be to select the extension points we want to extend. This can be done by clicking on the Add button, which will show a dialog like this:

This dialog shows a tree with "everything" that can be extended. All information is taken from the add-in registry selected when creating the project. At root level there are add-in namespaces (namespaces are usually mapped to applications), then there is a hierarchy of add-in hosts and add-ins grouped in categories ("Deployment" is a category, "MonoDevelop Runtime" is an add-in host). Expanding an add-in host will show the extension points that it provides. We can then choose which extension points we want to extend.
If an extension point already has some extension nodes registered on it, those will also be shown, to make it possible to extend a specific node of an extension point. For example:

The previous screenshot shows the extension points offered by the IDE. One of them is the Main Menu extension point, which already contains some nodes on it. Those nodes are the main submenus, so we can choose to extend a specific submenu of the main menu. After choosing all extension points we want to extend, the Extensions tab would be filled with them like this:

Well, not exactly like this because in the screenshot some nodes have already been added to some of the extension points. That's because I copied the add-in definition file from MonoDevelop's version control add-in to show the example. But the idea is that it will show the list of selected extension points and you would be able to add new nodes. So, in the screenshot you can see the Main Menu extension point, and that the submenu File is being extended with a CommandItem node which defines a new Checkout command.
When double-clicking on a node, a node editing dialog will be shown. It might look like this:

This dialogs allows entering the value for all attributes of the node. Notice that all that information shown in the screenshots is taken from the selected add-in registry using the Add-in Description API that Mono.Addins provides. That includes the list of available extension points, the name and description of those, the types of extension nodes that each extension point accepts, the attributes supported by every node type, the type and description of every attribute (shown in the tooltip above). That's a very rich set of information that is used to fill and drive all those windows, and that will also be used to automatically generate documentation.
I also plan to automatically generate classes referenced from nodes. For example, the defaultHandler attribute shown in the screenshot is the name of a class that implements the handler to be run when clicking on the command. The IDE will detect it, and will automatically generate a class implementing the required base class or interface.
That's what I have so far. There is still a lot to do, but I thought it would be good to show a glimpse of the kind of development tools that Mono.Addins will allow creating, and which will be shared with all Mono.Addins based applications.
View comments