in intellij-plugin/features/ai-hints-core/src/com/jetbrains/edu/aiHints/core/ui/HintInlineBanner.kt [177:240]
override fun mouseClicked(e: MouseEvent?) {
updateIcons(this@setupToggleWith, otherLabel, selectedIcons, unselectedIcon)
likeness = newLikeness
val resultLikeness = action()
if (resultLikeness == likeness) return
when {
resultLikeness == FeedbackLikenessAnswer.LIKE && likeness == FeedbackLikenessAnswer.LIKE -> {
updateIcons(
currentLabel = this@setupToggleWith,
otherLabel = otherLabel,
currentIcon = AllIcons.Ide.LikeSelected,
otherIcon = AllIcons.Ide.DislikeDimmed
)
}
resultLikeness == FeedbackLikenessAnswer.LIKE && likeness == FeedbackLikenessAnswer.DISLIKE -> {
updateIcons(
currentLabel = otherLabel,
otherLabel = this@setupToggleWith,
currentIcon = AllIcons.Ide.LikeSelected,
otherIcon = AllIcons.Ide.DislikeDimmed
)
}
resultLikeness == FeedbackLikenessAnswer.DISLIKE && likeness == FeedbackLikenessAnswer.DISLIKE -> {
updateIcons(
currentLabel = this@setupToggleWith,
otherLabel = otherLabel,
currentIcon = AllIcons.Ide.DislikeSelected,
otherIcon = AllIcons.Ide.LikeDimmed
)
}
resultLikeness == FeedbackLikenessAnswer.DISLIKE && likeness == FeedbackLikenessAnswer.LIKE -> {
updateIcons(
currentLabel = otherLabel,
otherLabel = this@setupToggleWith,
currentIcon = AllIcons.Ide.DislikeSelected,
otherIcon = AllIcons.Ide.LikeDimmed
)
}
resultLikeness == FeedbackLikenessAnswer.NO_ANSWER && likeness == FeedbackLikenessAnswer.LIKE -> {
updateIcons(
currentLabel = otherLabel,
otherLabel = this@setupToggleWith,
currentIcon = AllIcons.Ide.DislikeDimmed,
otherIcon = AllIcons.Ide.LikeDimmed
)
}
resultLikeness == FeedbackLikenessAnswer.NO_ANSWER && likeness == FeedbackLikenessAnswer.DISLIKE -> {
updateIcons(
currentLabel = this@setupToggleWith,
otherLabel = otherLabel,
currentIcon = AllIcons.Ide.DislikeDimmed,
otherIcon = AllIcons.Ide.LikeDimmed
)
}
}
likeness = resultLikeness
}