mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
private getters are not supported by serializer and visible tree state not stored correctly as result
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
*/
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.codeInspection.ex
|
||||
|
||||
import com.intellij.openapi.components.BaseState
|
||||
@@ -17,10 +15,10 @@ import javax.swing.tree.TreePath
|
||||
@Tag("profile-state")
|
||||
internal class VisibleTreeState : BaseState() {
|
||||
@get:XCollection(elementName = "expanded", valueAttributeName = "path", propertyElementName = "expanded-state")
|
||||
private var expandedNodes by property(TreeSet<State>())
|
||||
var expandedNodes by property(TreeSet<State>())
|
||||
|
||||
@get:XCollection(elementName = "selected", valueAttributeName = "path", propertyElementName = "selected-state")
|
||||
private var selectedNodes by property(TreeSet<State>())
|
||||
var selectedNodes by property(TreeSet<State>())
|
||||
|
||||
fun expandNode(node: InspectionConfigTreeNode) {
|
||||
expandedNodes.add(getState(node))
|
||||
@@ -99,7 +97,11 @@ internal class VisibleTreeState : BaseState() {
|
||||
|
||||
internal class State @JvmOverloads constructor(key: String? = null): Comparable<State>, BaseState() {
|
||||
@get:Tag("id")
|
||||
var key by string(key)
|
||||
var key by string()
|
||||
|
||||
init {
|
||||
this.key = key
|
||||
}
|
||||
|
||||
override fun compareTo(other: State) = StringUtil.compare(key, other.key, false)
|
||||
}
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
/*
|
||||
* Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
*/
|
||||
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package com.intellij.codeInspection.ex
|
||||
|
||||
import com.intellij.codeInspection.InspectionProfile
|
||||
@@ -11,7 +9,7 @@ import com.intellij.util.xmlb.annotations.Property
|
||||
internal class VisibleTreeStateComponent : BaseState() {
|
||||
@get:Property(surroundWithTag = false)
|
||||
@get:MapAnnotation(surroundWithTag = false, surroundKeyWithTag = false, surroundValueWithTag = false)
|
||||
private var profileNameToState by map<String, VisibleTreeState>()
|
||||
var profileNameToState by map<String, VisibleTreeState>()
|
||||
|
||||
fun getVisibleTreeState(profile: InspectionProfile) = profileNameToState.getOrPut(profile.name) {
|
||||
incrementModificationCount()
|
||||
|
||||
Reference in New Issue
Block a user