mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
convert ShowUsagesSettings to kotlin
This commit is contained in:
@@ -1,40 +1,29 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
package com.intellij.usages;
|
||||
package com.intellij.usages
|
||||
|
||||
import com.intellij.openapi.components.PersistentStateComponent;
|
||||
import com.intellij.openapi.components.ServiceManager;
|
||||
import com.intellij.openapi.components.State;
|
||||
import com.intellij.openapi.components.Storage;
|
||||
import com.intellij.util.xmlb.XmlSerializerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import com.intellij.openapi.components.PersistentStateComponent
|
||||
import com.intellij.openapi.components.ServiceManager
|
||||
import com.intellij.openapi.components.State
|
||||
import com.intellij.openapi.components.Storage
|
||||
import com.intellij.util.xmlb.XmlSerializerUtil
|
||||
|
||||
@State(name = "ShowUsagesSettings", storages = @Storage("usageView.xml"))
|
||||
public class ShowUsagesSettings implements PersistentStateComponent<UsageViewSettings> {
|
||||
private final UsageViewSettings myState = new UsageViewSettings();
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public UsageViewSettings getState() {
|
||||
return myState;
|
||||
@State(name = "ShowUsagesSettings", storages = arrayOf(Storage("usageView.xml")))
|
||||
class ShowUsagesSettings : PersistentStateComponent<UsageViewSettings> {
|
||||
private val myState = UsageViewSettings(false, false, false, false, false)
|
||||
|
||||
override fun getState(): UsageViewSettings? {
|
||||
return myState
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadState(@NotNull UsageViewSettings state) {
|
||||
XmlSerializerUtil.copyBean(state, myState);
|
||||
override fun loadState(state: UsageViewSettings) {
|
||||
XmlSerializerUtil.copyBean(state, myState)
|
||||
}
|
||||
|
||||
public static ShowUsagesSettings getInstance() {
|
||||
return ServiceManager.getService(ShowUsagesSettings.class);
|
||||
}
|
||||
companion object {
|
||||
|
||||
public ShowUsagesSettings() {
|
||||
myState.setGroupByFileStructure(false);
|
||||
myState.setGroupByModule(false);
|
||||
myState.setGroupByPackage(false);
|
||||
myState.setGroupByUsageType(false);
|
||||
myState.setGroupByScope(false);
|
||||
val instance: ShowUsagesSettings
|
||||
get() = ServiceManager.getService(ShowUsagesSettings::class.java)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user