Last active
July 21, 2022 20:19
-
-
Save rubenquadros/4681aae58e0e289f3c4ca4952f752430 to your computer and use it in GitHub Desktop.
Inspection setting configurable
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class InspectionSettings(project: Project) : Configurable { | |
private var component: InspectionComponent? = null | |
private val inspectionSettingState = project.service<InspectionSettingState>() | |
override fun createComponent(): JComponent? { | |
component = InspectionComponent(inspectionSettingState) | |
return component?.getPanel() | |
} | |
override fun isModified(): Boolean { | |
return inspectionSettingState.parser != component?.getCurrentState() | |
} | |
override fun apply() { | |
component?.getCurrentState()?.let { inspectionSettingState.parser = it } | |
} | |
override fun reset() { | |
super.reset() | |
// reset the state | |
} | |
override fun getDisplayName(): String = "Codespector Settings" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment