Skip to content

Commit

Permalink
remove unused imports and comments
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Herzig <[email protected]>
  • Loading branch information
timherzig committed Dec 12, 2023
1 parent b80aa08 commit 9483eb7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@

package com.amos.pitmutationmate.pitmutationmate.actions

import com.amos.pitmutationmate.pitmutationmate.reporting.XMLListener
import com.amos.pitmutationmate.pitmutationmate.reporting.XMLParser
import com.intellij.codeInsight.hint.HintManager
import com.intellij.codeInsight.hint.HintManagerImpl
import com.intellij.codeInsight.hint.HintUtil
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.editor.LogicalPosition
import com.intellij.openapi.editor.event.EditorMouseEvent
import com.intellij.openapi.editor.event.EditorMouseListener
import com.intellij.openapi.editor.event.EditorMouseMotionListener
Expand All @@ -20,25 +18,22 @@ import com.intellij.psi.util.PsiTreeUtil
import com.intellij.ui.LightweightHint
import com.intellij.util.ui.accessibility.AccessibleContextUtil
import java.awt.Point
import java.util.*
import javax.swing.JComponent


class HoverAction(private val editor: Editor, private val result: XMLParser.ResultData) {
fun addHoverAction() {
// this.editor.addEditorMouseMotionListener(MouseMotion())
this.editor.addEditorMouseListener(MouseClick())
}

inner class MouseMotion() : EditorMouseMotionListener {
override fun mouseMoved(event: EditorMouseEvent) {
println("Mouse moved")
showHoverMessage(event.mouseEvent.point)
}
}

inner class MouseClick() : EditorMouseListener {
override fun mouseClicked(event: EditorMouseEvent) {
println("Mouse clicked at point: ${event.mouseEvent.point}")
showHoverMessage(event.mouseEvent.point)
}
}
Expand Down Expand Up @@ -67,7 +62,6 @@ class HoverAction(private val editor: Editor, private val result: XMLParser.Resu
val label: JComponent = HintUtil.createInformationLabel(message, null, null, null)
AccessibleContextUtil.setName(label, "PiTest")
val hint: LightweightHint = LightweightHint(label)
// val p: Point = HintManagerImpl.getHintPosition(hint, this.editor, this.editor.caretModel.visualPosition, 1)
val p: Point = HintManagerImpl.getHintPosition(hint, this.editor, this.editor.xyToVisualPosition(point), 1)
val flags: Int = HintManager.HIDE_BY_ANY_KEY or HintManager.HIDE_BY_TEXT_CHANGE or HintManager.HIDE_BY_SCROLLING
hintManager.showEditorHint(hint, this.editor, p, flags, 0, true, 1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ import com.intellij.execution.ProgramRunnerUtil
import com.intellij.execution.RunManager
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.editor.Editor
import com.intellij.openapi.editor.markup.RangeHighlighter
import com.intellij.openapi.project.Project
import com.intellij.util.ui.JBUI.CurrentTheme.Tree.Hover
import java.nio.file.Paths

abstract class RunConfigurationAction : AnAction() {
Expand All @@ -36,7 +34,7 @@ abstract class RunConfigurationAction : AnAction() {
if (editor != null) {
// TODO: use actual XML report directories. This currently uses a placeholder test folder
val dir = Paths.get("build", "reports", "pitest", "test", "mutations.xml")
var xmlListener = XMLListener(dir, editor)
val xmlListener = XMLListener(dir, editor)
xmlListener.listen()
val ha: HoverAction = HoverAction(editor, xmlListener.getResult())
ha.addHoverAction()
Expand Down

0 comments on commit 9483eb7

Please sign in to comment.