Skip to content

Instantly share code, notes, and snippets.

@rubenquadros
Last active July 21, 2022 20:19
Show Gist options
  • Save rubenquadros/4681aae58e0e289f3c4ca4952f752430 to your computer and use it in GitHub Desktop.
Save rubenquadros/4681aae58e0e289f3c4ca4952f752430 to your computer and use it in GitHub Desktop.
Inspection setting configurable
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