PDA

View Full Version : Searching for a plugin mechanism



sma
2 Jul 2009, 10:03 AM
Hi,

I'm currently evaluating GWT (and ExtGWT) for possible use. We need to create a rich editor application that is extendable by others. Let's assume there is a tool bar and the usual project tree besides a content pane. Depending on the current selection, the content pane shall then show different editors in the content pane.

Now a customer might want to extend the editor and add another tool to the tool bar which, when pressed, will do something with the current selection, the content pane, or both. Assuming that the current selection is a wiki-like text document, the tool might create an HTMLified version and insert it into the project, opening it in a browser pane.

I see no problems in creating the editor itself, but I have not enough knowledge about GWT yet to judge the feasibility of how to create such an extension mechanism.

I think, we need to expose the editor's model with some kind of API and also allow others to listen for certain application events. This could be done by Java interfaces but can others use those interfaces (class files?) to compile their extension against? We do not want to provide the editor's source code to third parties. We however would trust them so there is no need to protect the editor's inner state against misuse.

Is there a way to load GWT compiled modules dynamically on runtime? We cannot recompile the editor for each extension. Can we provide meta data with the plugin so that the editor knows that it should add a tool button to the tool bar, then load and initialize the plugin and call a method if that button is pressed. On initialization, the plugin should register a new editor or viewer, then access the current selection and the editor's object model to get and create content objects. This idea is of course heavily inspired by the way Eclipse works.

Are there existing frameworks providing such a plugin mechanism?

What would be the development experience of others if they need to debug their code? We probably need to provide some kind of sandboxed editor, I guess.

Any ideas or pointers would be helpful.

Thanks
Stefan