jjzjj

PersistentStateComponent

全部标签

java - IDEA 插件 : PersistentStateComponent not persisting xml

我无法让我的插件保持其状态。文件configProvider.xml永远不会被创建,@State注释也没有任何效果(显然)。这是plugin.xml中的相关部分这是提供应该持久化的对象的类:importcom.intellij.openapi.components.PersistentStateComponent;importcom.intellij.openapi.components.ServiceManager;importcom.intellij.openapi.components.State;importcom.intellij.openapi.components.Sto

java - Intellij IDEA 插件 - 未调用 PersistentStateComponent loadState

我正在尝试为IntellijIDEA开发一个插件,我正在使用SDK129.451。我遇到的问题是我无法像他可以在插件中输入的某些列表项那样保留用户数据,并在IDE重新启动后恢复数据。我正在使用PersistentStateComponent来持久化数据,似乎调用了getState()方法,但没有调用loadState()方法。这是一个扩展PersistentStateComponent的示例类:@State(name="Test",storages={@Storage(file=StoragePathMacros.APP_CONFIG+"/other.xml")})publicclas