blob: d63b6f7c46003537b2fce82dbccde45c381b6194 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
package me.kyren223.harpoonforjb
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
class HarpoonSelectAction : AnAction() {
override fun actionPerformed(e: AnActionEvent) {
val actionId = e.actionManager.getId(this)
if (actionId == NEXT) {
println("Next")
} else if (actionId.equals(PREV)) {
println("Previous")
} else {
val index = getIndex(actionId)
println("Goto $index")
}
}
private fun getIndex(actionId: String): Int {
return actionId.substring("HarpoonGoto".length).toInt()
}
companion object {
const val NEXT = "HarpoonSelectNext"
const val PREV = "HarpoonSelectPrev"
const val SELECT = "HarpoonSelect"
}
}
|