mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-14 18:05:27 +07:00
[PyCharm] Jupyter/RemoteDev (fix): Removed obsolete OutputListener and OUTPUT_LISTENER: Topic<OutputListener>. #PY-76035 Fixed
GitOrigin-RevId: 19a4465762389b53c0fd53445eb73005e661d047
This commit is contained in:
committed by
intellij-monorepo-bot
parent
08102c3721
commit
a924f291c2
@@ -1,25 +1,14 @@
|
||||
package com.intellij.notebooks.visualization.outputs
|
||||
|
||||
import com.intellij.notebooks.visualization.outputs.impl.SurroundingComponent
|
||||
import com.intellij.openapi.Disposable
|
||||
import com.intellij.openapi.components.Service
|
||||
import com.intellij.openapi.components.service
|
||||
import com.intellij.openapi.diagnostic.thisLogger
|
||||
import com.intellij.openapi.editor.Editor
|
||||
import com.intellij.openapi.editor.EditorCustomElementRenderer
|
||||
import com.intellij.util.asSafely
|
||||
import com.intellij.util.messages.Topic
|
||||
import com.intellij.notebooks.visualization.outputs.impl.SurroundingComponent
|
||||
import javax.swing.JComponent
|
||||
|
||||
// ToDo: merge with NotebookOutputListener
|
||||
interface OutputListener {
|
||||
fun beforeOutputCreated(editor: Editor, line: Int) {}
|
||||
fun outputCreated(editor: Editor, line: Int) {}
|
||||
fun outputSizeUpdated(editor: Editor, line: Int?) {}
|
||||
}
|
||||
|
||||
val OUTPUT_LISTENER: Topic<OutputListener> = Topic.create("OutputAdded", OutputListener::class.java)
|
||||
|
||||
val EditorCustomElementRenderer.notebookInlayOutputComponent: JComponent?
|
||||
get() = asSafely<JComponent>()?.components?.firstOrNull()?.asSafely<SurroundingComponent>()
|
||||
|
||||
|
||||
@@ -8,7 +8,6 @@ import com.intellij.notebooks.visualization.outputs.NotebookOutputComponentFacto
|
||||
import com.intellij.notebooks.visualization.outputs.NotebookOutputComponentFactory.Companion.gutterPainter
|
||||
import com.intellij.notebooks.visualization.outputs.NotebookOutputComponentFactoryGetter
|
||||
import com.intellij.notebooks.visualization.outputs.NotebookOutputDataKey
|
||||
import com.intellij.notebooks.visualization.outputs.OUTPUT_LISTENER
|
||||
import com.intellij.notebooks.visualization.outputs.impl.CollapsingComponent
|
||||
import com.intellij.notebooks.visualization.outputs.impl.InnerComponent
|
||||
import com.intellij.notebooks.visualization.outputs.impl.SurroundingComponent
|
||||
@@ -65,7 +64,7 @@ class EditorCellOutputs(
|
||||
}
|
||||
|
||||
private val outerComponent = SurroundingComponent.create(editor, innerComponent).also {
|
||||
DataManager.registerDataProvider(it, NotebookCellDataProvider(editor, it, { cell.interval }))
|
||||
DataManager.registerDataProvider(it, NotebookCellDataProvider(editor, it) { cell.interval })
|
||||
}
|
||||
|
||||
internal var inlay: Inlay<*>? = null
|
||||
@@ -190,8 +189,6 @@ class EditorCellOutputs(
|
||||
factory: NotebookOutputComponentFactory<*, K>,
|
||||
outputDataKey: K,
|
||||
): NotebookOutputComponentFactory.CreatedComponent<*>? {
|
||||
val lines = cell.interval.lines
|
||||
ApplicationManager.getApplication().messageBus.syncPublisher(OUTPUT_LISTENER).beforeOutputCreated(editor, lines.last)
|
||||
val result = try {
|
||||
factory.createComponent(editor, outputDataKey)
|
||||
}
|
||||
@@ -210,7 +207,6 @@ class EditorCellOutputs(
|
||||
Disposer.register(editor.disposable, disposable)
|
||||
}
|
||||
}
|
||||
ApplicationManager.getApplication().messageBus.syncPublisher(OUTPUT_LISTENER).outputCreated(editor, lines.last)
|
||||
return result
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user