Skip to end of metadata
Go to start of metadata

 

Redirect: http://www.jetbrains.org/intellij/sdk/docs/basics/persisting_state_of_components.html

3 Comments

  1. Somebody correct me if I'm wrong but may be it'll be good to add here information about necessity to add implementation of PersistentStateComponent to plugin.xml in <extensions> like this:

    <applicationService serviceImplementation="com.MyService"/>

    And the way you can call it:

    ServiceManager.getService(MyService.class);

    Another issue I found is that loadState(MyService state) won't be called if you doesn't have getter and setter for stateValue if we talk about second example from section: "Implementing the PersistentStateComponent Interface".

  2. Note, that (if I understand correctly), each field of state class, that should be stored, should be public or have both public getter and setter

    UPD: Yeah, I'm not very careful reader:\

    1. Indeed, this is already noted above:

      The implementation of PersistentStateComponent works by serializing public fields and bean properties into an XML format