[collab] drop unused code

GitOrigin-RevId: 0dcceea5fb024fd7db183f4281282f0de7c524f8
This commit is contained in:
Ivan Semenov
2025-09-01 13:20:57 +00:00
committed by intellij-monorepo-bot
parent 677a7e8f60
commit 666ee00ac9
3 changed files with 0 additions and 143 deletions
@@ -522,13 +522,6 @@ f:com.intellij.collaboration.api.json.JsonHttpApiHelperKt
- sf:INSTANCE:com.intellij.collaboration.ui.codereview.changes.CodeReviewChangeListComponentFactory
- f:createIn(kotlinx.coroutines.CoroutineScope,com.intellij.collaboration.ui.codereview.details.model.CodeReviewChangeListViewModel,com.intellij.collaboration.ui.codereview.CodeReviewProgressTreeModel,java.lang.String):com.intellij.openapi.vcs.changes.ui.AsyncChangesTree
- f:getSELECTED_CHANGES():com.intellij.openapi.actionSystem.DataKey
*f:com.intellij.collaboration.ui.codereview.changes.CodeReviewChangesTreeFactory
- *sf:Companion:com.intellij.collaboration.ui.codereview.changes.CodeReviewChangesTreeFactory$Companion
- <init>(com.intellij.openapi.project.Project,com.intellij.collaboration.ui.SingleValueModel):V
- f:create(java.lang.String,Z):com.intellij.openapi.vcs.changes.ui.AsyncChangesTree
- bs:create$default(com.intellij.collaboration.ui.codereview.changes.CodeReviewChangesTreeFactory,java.lang.String,Z,I,java.lang.Object):com.intellij.openapi.vcs.changes.ui.AsyncChangesTree
*f:com.intellij.collaboration.ui.codereview.changes.CodeReviewChangesTreeFactory$Companion
- f:createTreeToolbar(com.intellij.openapi.actionSystem.ActionManager,java.lang.String,javax.swing.JComponent):javax.swing.JComponent
*f:com.intellij.collaboration.ui.codereview.comment.CodeReviewCommentTextFieldFactory
- sf:INSTANCE:com.intellij.collaboration.ui.codereview.comment.CodeReviewCommentTextFieldFactory
- f:createIn(kotlinx.coroutines.CoroutineScope,com.intellij.collaboration.ui.codereview.comment.CodeReviewSubmittableTextViewModel,com.intellij.collaboration.ui.codereview.comment.CommentInputActionsComponentFactory$Config,com.intellij.collaboration.ui.codereview.timeline.comment.CommentTextFieldFactory$IconConfig):javax.swing.JComponent
@@ -1,69 +0,0 @@
// Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.collaboration.ui.codereview.changes
import com.intellij.collaboration.ui.SingleValueModel
import com.intellij.openapi.actionSystem.ActionGroup
import com.intellij.openapi.actionSystem.ActionManager
import com.intellij.openapi.actionSystem.DataSink
import com.intellij.openapi.actionSystem.DefaultActionGroup
import com.intellij.openapi.actionSystem.IdeActions
import com.intellij.openapi.project.Project
import com.intellij.openapi.vcs.changes.Change
import com.intellij.openapi.vcs.changes.ui.*
import com.intellij.ui.ClientProperty
import com.intellij.ui.ExpandableItemsHandler
import com.intellij.ui.SelectionSaver
import com.intellij.util.ui.tree.TreeUtil
import org.jetbrains.annotations.ApiStatus.Obsolete
import org.jetbrains.annotations.Nls
import javax.swing.JComponent
import javax.swing.tree.DefaultTreeModel
@Obsolete
class CodeReviewChangesTreeFactory(private val project: Project,
private val changesModel: SingleValueModel<out Collection<Change>>) {
fun create(emptyTextText: @Nls String, preselectFirstChange: Boolean = true): AsyncChangesTree {
val tree = object : AsyncChangesTree(project, false, false) {
override val changesTreeModel: AsyncChangesTreeModel = SimpleAsyncChangesTreeModel.create { grouping ->
TreeModelBuilder.buildFromChanges(project, grouping, changesModel.value, null)
}
override fun updateTreeModel(model: DefaultTreeModel, treeStateStrategy: TreeStateStrategy<*>) {
super.updateTreeModel(model, treeStateStrategy)
if (preselectFirstChange && isSelectionEmpty && !isEmpty) {
TreeUtil.selectFirstNode(this)
}
}
override fun uiDataSnapshot(sink: DataSink) {
super.uiDataSnapshot(sink)
VcsTreeModelData.uiDataSnapshot(sink, project, this)
}
override fun getToggleClickCount(): Int {
return toggleClickCount
}
}.apply {
emptyText.text = emptyTextText
toggleClickCount = 2
}.also {
ClientProperty.put(it, ExpandableItemsHandler.IGNORE_ITEM_SELECTION, true)
SelectionSaver.installOn(it)
}
changesModel.addAndInvokeListener { tree.rebuildTree() }
return tree
}
companion object {
fun createTreeToolbar(actionManager: ActionManager, groupName: String, treeContainer: JComponent): JComponent {
val changesToolbarActionGroup = actionManager.getAction(groupName) as ActionGroup
val changesToolbar = actionManager.createActionToolbar("ChangesBrowser", changesToolbarActionGroup, true)
val treeActionsGroup = DefaultActionGroup(actionManager.getAction(IdeActions.ACTION_EXPAND_ALL),
actionManager.getAction(IdeActions.ACTION_COLLAPSE_ALL))
return TreeActionsToolbarPanel(changesToolbar, treeActionsGroup, treeContainer)
}
}
}
@@ -1,67 +0,0 @@
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.collaboration.ui.codereview.editor
import com.intellij.collaboration.async.collectScoped
import com.intellij.collaboration.async.launchNow
import com.intellij.collaboration.util.ExcludingApproximateChangedRangesShifter
import com.intellij.diff.util.Range
import com.intellij.openapi.application.EDT
import com.intellij.openapi.application.EdtImmediate
import com.intellij.openapi.editor.Document
import com.intellij.openapi.vcs.ex.DocumentTracker
import com.intellij.openapi.vcs.ex.LineStatusTrackerBase
import com.intellij.openapi.vcs.ex.LstRange
import com.intellij.platform.util.coroutines.childScope
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.*
import kotlinx.coroutines.isActive
import kotlinx.coroutines.withContext
import org.jetbrains.annotations.ApiStatus
/**
* Changes model which uses [DocumentTracker] to track and shift changes between review head and current document state
*/
@ApiStatus.Internal
@ApiStatus.ScheduledForRemoval
@Deprecated("Please use com.intellij.collaboration.ui.codereview.editor.ReviewInEditorUtil.trackDocumentDiffSync")
class DocumentTrackerCodeReviewEditorGutterChangesModel(
parentCs: CoroutineScope,
private val document: Document,
reviewHeadContent: Flow<CharSequence?>,
reviewChangesRanges: Flow<List<Range>?>
) : CodeReviewEditorGutterChangesModel {
private val cs = parentCs.childScope(javaClass.name, Dispatchers.EDT)
private val _reviewRanges = MutableStateFlow<List<LstRange>?>(null)
override val reviewRanges: StateFlow<List<LstRange>?> = _reviewRanges.asStateFlow()
private val _postReviewRanges = MutableStateFlow<List<Range>?>(null)
/**
* Ranges changed between review head and current document content
*/
val postReviewRanges: StateFlow<List<Range>?> = _postReviewRanges.asStateFlow()
override fun isValid(): Boolean = cs.isActive && _reviewRanges.value != null
init {
cs.launchNow {
combine(reviewHeadContent, reviewChangesRanges, ::Pair).collectScoped { (headContent, reviewRanges) ->
if (headContent != null && reviewRanges != null) {
trackChanges(headContent, reviewRanges)
}
}
}
}
private suspend fun trackChanges(originalContent: CharSequence, reviewRanges: List<Range>) {
withContext(Dispatchers.EdtImmediate) {
val reviewHeadDocument = LineStatusTrackerBase.createVcsDocument(originalContent)
ReviewInEditorUtil.trackDocumentDiffSync(reviewHeadDocument, document) { trackerRanges ->
_postReviewRanges.value = trackerRanges
_reviewRanges.value = ExcludingApproximateChangedRangesShifter.shift(reviewRanges, trackerRanges).map(Range::asLst)
}
}
}
}