[IDEA, RIDER] remove unused API

GitOrigin-RevId: 6b213e3d34df085dd44056e5f125cda021514093
This commit is contained in:
Nikita.Lyubimov
2023-10-19 15:18:57 +02:00
committed by intellij-monorepo-bot
parent 29c742bf6d
commit 4cb7999924
2 changed files with 0 additions and 62 deletions

View File

@@ -1,21 +0,0 @@
package com.intellij.codeInsight.hints.presentation
import com.intellij.codeInsight.hints.InlayPresentationFactory
import org.jetbrains.annotations.ApiStatus
import java.awt.Point
import java.awt.event.MouseEvent
@ApiStatus.Internal
class OnPressedPresentation(
presentation: InlayPresentation,
private val pressedListener: InlayPresentationFactory.ClickListener
) : StaticDelegatePresentation(presentation) {
constructor(presentation: InlayPresentation, listener: (MouseEvent, Point) -> Unit) : this(
presentation,
InlayPresentationFactory.ClickListener { event, translated -> listener(event, translated) })
override fun mousePressed(event: MouseEvent, translated: Point) {
super.mousePressed(event, translated)
pressedListener.onClick(event, translated)
}
}

View File

@@ -238,19 +238,6 @@ class PresentationFactory(private val editor: Editor) : InlayPresentationFactory
}
}
/**
* @see OnPressedPresentation
*/
@Contract(pure = true)
fun onPressed(base: InlayPresentation, buttons: EnumSet<MouseButton>, onPressed: (MouseEvent, Point) -> Unit): InlayPresentation {
return OnPressedPresentation(base) { e, p ->
if (e.mouseButton in buttons) {
onPressed(e, p)
}
}
}
/**
* @see ChangeOnHoverPresentation
*/
@@ -266,16 +253,6 @@ class PresentationFactory(private val editor: Editor) : InlayPresentationFactory
return referenceInternal(base, onClickAction)
}
@ApiStatus.Internal
@Contract(pure = true)
fun referenceOnPressed(base: InlayPresentation, onPressedAction: (MouseEvent?) -> Unit): InlayPresentation {
return referenceOnPressedInternal(
base,
onPressedAction,
clickButtonsWithoutHover = EnumSet.of(MouseButton.Middle),
clickButtonsWithHover = EnumSet.of(MouseButton.Left, MouseButton.Middle),
hoverPredicate = { isControlDown(it) })
}
@Contract(pure = true)
fun referenceOnHover(base: InlayPresentation, clickListener: ClickListener): InlayPresentation {
@@ -327,24 +304,6 @@ class PresentationFactory(private val editor: Editor) : InlayPresentationFactory
}
}
@Contract(pure = true)
private fun referenceOnPressedInternal(
base: InlayPresentation,
onPressedAction: (MouseEvent?) -> Unit,
clickButtonsWithoutHover: EnumSet<MouseButton>,
clickButtonsWithHover: EnumSet<MouseButton>,
hoverPredicate: (MouseEvent) -> Boolean
): InlayPresentation{
val noHighlightReference = onPressed(base, clickButtonsWithoutHover) { event, _ ->
onPressedAction(event)
}
return ChangeOnHoverPresentation(noHighlightReference, hover@{
return@hover onPressed(withReferenceAttributes(noHighlightReference), clickButtonsWithHover) { event, _ ->
onPressedAction(event)
}
}, hoverPredicate)
}
@Contract(pure = true)
fun withCursorOnHover(base: InlayPresentation, cursor: Cursor): InlayPresentation {
return WithCursorOnHoverPresentation(base, cursor, editor)