Storing and retrieving user preferences

I am writing a custom plugin and having difficulty using the Plugin API to store/retrieve user preferences.  I need to store a couple of basic fields like username, password, serverUrl.  I've looked through the javadocs, API source, and online discussions.  What is the correct way to do this?  Do I have to deal with XML, JDomExternalizer, IPersistentStateComponent, and the like?  Or is there a first class API that doesn't involve having to convert java to XML and worry about the underlying storage implementation.  If the answer is "no", can someone please point me to a clear example of how this is done?  Thanks in advance!

2 comments
Comment actions Permalink

Hello Nik,

I've just published an article describing the use of the PersistentStateComponent
API:
http://www.jetbrains.net/confluence/x/_QEqAQ

I think this qualifies as the first class API. :) Feel free to ask if you
have any additional questions.

I am writing a custom plugin and having difficulty using the Plugin
API to store/retrieve user preferences.  I need to store a couple of
basic fields like username, password, serverUrl.  I've looked through
the javadocs, API source, and online discussions.  What is the correct
way to do this?  Do I have to deal with XML, JDomExternalizer,
IPersistentStateComponent, and the like?  Or is there a first class
API that doesn't involve having to convert java to XML and worry about
the underlying storage implementation.  If the answer is "no", can
someone please point me to a clear example of how this is done?
Thanks in advance!

---
Original message URL:
http://www.jetbrains.net/devnet/message/5250244#5250244

--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

This is perfect.  Thanks very much for your quick response!

0

Please sign in to leave a comment.