Adding Configuration features at runtime to a plugin


Hi guys,


I just developed a plugin that added Java Method suggestion for the specific XML attribute value. I defined the target XML attribute values at file into my plugin open source project. Now, I am wondering if there is any way for users of this plugin that end user could define his own XML attribute and uses this plugin features for his desire XML attribute. Actually, I am looking for a way that target user after downloading my plugin be able to change the values. I just defined my key values at file like this:


#Seperate your xml attributes by ',' like this: operationId,returnObject

target-xml-attributes= operationId



I appreciate your time.




The "proper" way is to persist settings via and expose a corresponding UI in Settings. This will also allow per-project configuration.

Another idea might be to have a fixed/configurable location for user's (e.g. in user's home directory) that will be read in addition/replacing default config file by plugin.


You must expose Project-level configurable to be added to "Settings (Preferences)" dialog, see com.intellij.openapi.options.Configurable it has extensive Javadoc and you can find many existing usages in IntelliJ Community sources as reference.


Dear Yann,


Thank you so much for your response. The first way that you suggested is a better way. I read about PersistentStateComponent and it is perfect. But, I couldn't your point in the second part of your comment: "expose a corresponding UI in Settings". Do you mean I must provide action at my plugin and then end user could register her/his own XML attribute tag by providing a UI at IntelliJ for the end-user?




Yann Cebron sorry to resume this old thread, but I have one question, how can I access the Configurable at runtime?

should I just


and then access the public properties?
Or is there a better way?



Please sign in to leave a comment.