-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ToolWindow settings to turn on/off validation
- Loading branch information
1 parent
9ffe669
commit f6c82ba
Showing
5 changed files
with
49 additions
and
6 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
src/main/kotlin/com/madrapps/dagger/actions/ValidationSwitchAction.kt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.madrapps.dagger.actions | ||
|
||
import com.intellij.openapi.actionSystem.AnActionEvent | ||
import com.intellij.openapi.actionSystem.ToggleAction | ||
import com.madrapps.dagger.services.service | ||
|
||
class ValidationSwitchAction : ToggleAction() { | ||
|
||
companion object { | ||
const val ID = "com.madrapps.dagger.actions.ValidationSwitchAction" | ||
} | ||
|
||
override fun isSelected(e: AnActionEvent): Boolean { | ||
val project = e.project ?: return false | ||
return project.service.settings.isValidationsEnabled | ||
} | ||
|
||
override fun setSelected(e: AnActionEvent, state: Boolean) { | ||
val project = e.project | ||
if (project != null) { | ||
project.service.settings.isValidationsEnabled = state | ||
} | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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