mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-02-05 08:06:56 +07:00
[collab/git] make an API for current git branch status presenter
GitOrigin-RevId: c494d5daac991cb4fc8486c5662a98edad81eb90
This commit is contained in:
committed by
intellij-monorepo-bot
parent
1e89d12557
commit
cb480552af
@@ -25,7 +25,6 @@ import javax.swing.Icon
|
||||
/**
|
||||
* Supplies a branch presentation to [git4idea.ui.toolbar.GitToolbarWidgetAction]
|
||||
*/
|
||||
@ApiStatus.Internal
|
||||
interface GitCurrentBranchPresenter {
|
||||
companion object {
|
||||
private val EP_NAME = ExtensionPointName<GitCurrentBranchPresenter>("Git4Idea.gitCurrentBranchPresenter")
|
||||
@@ -37,16 +36,24 @@ interface GitCurrentBranchPresenter {
|
||||
|
||||
fun getPresentation(repository: GitRepository): Presentation?
|
||||
|
||||
data class Presentation(
|
||||
val icon: Icon?,
|
||||
val text: @Nls String,
|
||||
val description: @Nls String?,
|
||||
val syncStatus: GitBranchSyncStatus = GitBranchSyncStatus.SYNCED
|
||||
)
|
||||
interface Presentation {
|
||||
val icon: Icon?
|
||||
val text: @Nls String
|
||||
val description: @Nls String?
|
||||
val syncStatus: GitBranchSyncStatus
|
||||
}
|
||||
|
||||
@ApiStatus.Internal
|
||||
data class PresentationData(
|
||||
override val icon: Icon?,
|
||||
override val text: @Nls String,
|
||||
override val description: @Nls String?,
|
||||
override val syncStatus: GitBranchSyncStatus = GitBranchSyncStatus.SYNCED,
|
||||
) : Presentation
|
||||
}
|
||||
|
||||
private fun getDefaultPresentation(repository: GitRepository): GitCurrentBranchPresenter.Presentation {
|
||||
return GitCurrentBranchPresenter.Presentation(
|
||||
return GitCurrentBranchPresenter.PresentationData(
|
||||
repository.calcIcon(),
|
||||
calcText(repository),
|
||||
repository.calcTooltip(),
|
||||
|
||||
Reference in New Issue
Block a user