I am trying to persist the run/debug configurations created by my plugin. I have mainly looked at the JUnit and TestNG plugins as examples.
My configuration object extends ModuleBasedConfiguration, which if I go up the inheritance tree implements JDOMExternalizable. The plugins I looked as examples implement public void readExternal(Element element) and public void writeExternal(Element element) from this interface, where they seem to read/write their data. So I created some basic implementation for this that I copied from these plugins. I put in some prints to trace it, and these methods do get called and it does not crash (whee!). I have idea though if the data is written/read properly back in or not as I see nothing about it.
So, when I create a new run/debug configuration of my type, it gets listed in the run configurations. It also persists if I close the IDE and restart it. But all the data in it seems to be lost, or at least it never gets back into the configuration UI for that entry. For example, my type is called OSMO. I create an instance of type OSMO, give it a name "hello", and fill in a bunch of stuff. Click OK. close it and reopen. "hello" is still listed, but all fields are empty. My SettingsEditor implements resetEditorFrom and applyEditorTo, which fills in the data from given configuration object.
The configuration objects (for JUNit and TestNG plugins these are JUnitConfiguration.java and TestNGConfiguration.java) also have a method called protected ModuleBasedConfiguration createInstance(), which seems to be called with the name of the configuration. But what I don't see is how they map the name to some instance of loaded data? I could create a map of names to instances and try to persist through that, but I don't see the example plugins doing this so I guess there is some other way this is handled.
So, the question is just, how do I persist data for my custom run/debug configurations and read it back?