Project component not being saved in IWS
Hi,
I'm trying to write a project component, unfortuneatly the configuration values of my project aren't being stored in the IWS file.
I took the SampleProject plugin and implemented the interfaces ProjectComponent, Configurable
My configuration xml file is:
com.intellij.openapi.samples.SampleProjectPlugin
com.intellij.openapi.samples.SampleProjectPlugin
]]>
I've looked in the IWS and haven't found the configuration ... snif ...
Furthermore the following returns a none configured element
SampleProjectPlugin plugin = (SampleProjectPlugin) project.getComponent(SampleProjectPlugin.class);
TIA,
Cedric
Please sign in to leave a comment.
I forgot to mention that it also implements the JDOMExtern interface and that i can sucessfully view the configuration panel in the project configuration of IDEA.
However, i don't know if this is related but if i change a value and select another plugin, IDEA doesn't ask me to apply changes or not ....
Thanks,
Cedric
Hi,
There is a method boolean isModified() in Configurable interface. It must return true if
I'm sorry, my previous post was almost complete, but not fully. I couldn't finish the sentence, because the page posted to the server, when I pressed "Code" button above :)
Anyway, there is a method boolean isModified() in Configurable interface. It must return true if the configuration was changed. Then the configuration should be saved. The rest of the requirements was met by your code, I think.
Hope that helps,
Regards,
Pavlin
Pavlin,
Thanks for tip, i changed my method isModified so that is always returns true.
I haven't found out why yet (i haven't found an easy way to debug a plugin yet within IDEA) but always returning true seams to make IDEA ask you if you wish to apply changes, regretfully though the configuration isn't persisted within the workspace.
I'll try again by writing from scratch a very simple plugin that does nothing other than persist it's configuration in the workspace and see how that goes.
Regards,
Cedric
Hi Cedric,
It isn't very difficult to debug plugins. You need to start another instance of IDEA. The whole process was described somewhere here in the forums. In short it involves creating a copy IDEA installation and a copy of .IntelliJIdea folder (on Win2K can be found in your Home folder called "/Documents and Settings/@YourName@.
In my setup this looks like:
c:\java\IDEA3.0-1
c:\java\IDEA3.0-2
c:\Documents and Settings\pavlin\.IntelliJIdea-1
c:\Documents and Settings\pavlin\.IntelliJIdea-2
Then make following changes in c:\java\IDEA3.0-2\bin\idea.lax:
lax.dir=c:
java
IDEA3.0-2
bin
lax.root.install.dir=c:
java
IDEA3.0-2
Append to lax.nl.java.option.additional=.....
the string which IDEA3.0-1 generates from remote debugger config tab in menu File/Project Properties. Something like:
-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=7777
You may also want to see exceptions thrown from plugin in console window, so set:
lax.stdout.redirect=console
Start your first IDEA instance and open your plugin project in it. Then start second instance from the other installation folder and attach to it with remote debugger from first instance.
I hope thats all.
Regards,
Pavlin
Hi Pavlin,
Thanks for tip about the remote debuging, it's working just great!
Now i just have to find my bug :o(
a++ Cedric