From a6337bdc13809eb32bb0823d8fbc6e01c93e5995 Mon Sep 17 00:00:00 2001 From: Pavel Porvatov Date: Wed, 19 Nov 2025 14:22:07 +0100 Subject: [PATCH] cleanup [Kotlin UI DSL]: Removed deprecated API for dsl 2 GitOrigin-RevId: f864167eccdaf58973d6c07ede0078cd6ea0cbdc --- platform/platform-api/api-dump-unreviewed.txt | 6 ------ .../com/intellij/ui/dsl/gridLayout/Gaps.kt | 13 ------------ platform/platform-impl/api-dump.txt | 1 - .../src/com/intellij/ui/dsl/builder/Cell.kt | 6 +++--- .../com/intellij/ui/dsl/builder/CellBase.kt | 21 +++---------------- .../ui/dsl/builder/impl/CellBaseImpl.kt | 6 +++--- 6 files changed, 9 insertions(+), 44 deletions(-) diff --git a/platform/platform-api/api-dump-unreviewed.txt b/platform/platform-api/api-dump-unreviewed.txt index 7fb5e64ca561..76501bc243f7 100644 --- a/platform/platform-api/api-dump-unreviewed.txt +++ b/platform/platform-api/api-dump-unreviewed.txt @@ -7458,8 +7458,6 @@ f:com.intellij.ui.dsl.builder.VerticalComponentGap - hashCode():I f:com.intellij.ui.dsl.builder.VerticalComponentGap$Companion f:com.intellij.ui.dsl.gridLayout.Gaps -- sf:Companion:com.intellij.ui.dsl.gridLayout.Gaps$Companion -- sf:EMPTY:com.intellij.ui.dsl.gridLayout.Gaps - ():V - (I,I,I,I):V - b:(I,I,I,I,I,kotlin.jvm.internal.DefaultConstructorMarker):V @@ -7475,10 +7473,6 @@ f:com.intellij.ui.dsl.gridLayout.Gaps - f:getRight():I - f:getTop():I - hashCode():I -f:com.intellij.ui.dsl.gridLayout.Gaps$Companion -f:com.intellij.ui.dsl.gridLayout.GapsKt -- bsf:JBGaps(I,I,I,I):com.intellij.ui.dsl.gridLayout.Gaps -- bs:JBGaps$default(I,I,I,I,I,java.lang.Object):com.intellij.ui.dsl.gridLayout.Gaps com.intellij.ui.dsl.gridLayout.Grid - a:getColumnsGaps():java.util.List - a:getResizableColumns():java.util.Set diff --git a/platform/platform-api/src/com/intellij/ui/dsl/gridLayout/Gaps.kt b/platform/platform-api/src/com/intellij/ui/dsl/gridLayout/Gaps.kt index 7170f1de481e..9f6a91c72d1e 100644 --- a/platform/platform-api/src/com/intellij/ui/dsl/gridLayout/Gaps.kt +++ b/platform/platform-api/src/com/intellij/ui/dsl/gridLayout/Gaps.kt @@ -2,19 +2,12 @@ package com.intellij.ui.dsl.gridLayout import com.intellij.ui.dsl.checkNonNegative -import com.intellij.ui.scale.JBUIScale import com.intellij.util.ui.JBUI import org.jetbrains.annotations.ApiStatus @Deprecated("Use UnscaledGaps instead") @ApiStatus.ScheduledForRemoval data class Gaps(val top: Int = 0, val left: Int = 0, val bottom: Int = 0, val right: Int = 0) { - companion object { - @Deprecated("Use UnscaledGaps instead", level = DeprecationLevel.HIDDEN) - @ApiStatus.ScheduledForRemoval - @JvmField - val EMPTY: Gaps = Gaps(0, 0, 0, 0) - } init { checkNonNegative("top", top) @@ -37,12 +30,6 @@ data class Gaps(val top: Int = 0, val left: Int = 0, val bottom: Int = 0, val ri } -@Deprecated("Use UnscaledGaps instead", replaceWith = ReplaceWith("UnscaledGaps(top, left, bottom, right)"), level = DeprecationLevel.HIDDEN) -@ApiStatus.ScheduledForRemoval -fun JBGaps(top: Int = 0, left: Int = 0, bottom: Int = 0, right: Int = 0): Gaps { - return Gaps(JBUIScale.scale(top), JBUIScale.scale(left), JBUIScale.scale(bottom), JBUIScale.scale(right)) -} - @ApiStatus.Internal @Deprecated("Use UnscaledGaps", replaceWith = ReplaceWith("UnscaledGaps()")) @ApiStatus.ScheduledForRemoval diff --git a/platform/platform-impl/api-dump.txt b/platform/platform-impl/api-dump.txt index a7ca032fa89d..41130d48ae79 100644 --- a/platform/platform-impl/api-dump.txt +++ b/platform/platform-impl/api-dump.txt @@ -1308,7 +1308,6 @@ Ff:com.intellij.ui.dsl.builder.Cell$DefaultImpls - bs:commentRight$default(com.intellij.ui.dsl.builder.Cell,java.lang.String,com.intellij.ui.dsl.builder.HyperlinkEventAction,I,java.lang.Object):com.intellij.ui.dsl.builder.Cell com.intellij.ui.dsl.builder.CellBase - a:align(com.intellij.ui.dsl.builder.Align):com.intellij.ui.dsl.builder.CellBase -- ba:customize(com.intellij.ui.dsl.gridLayout.Gaps):com.intellij.ui.dsl.builder.CellBase - a:customize(com.intellij.ui.dsl.gridLayout.UnscaledGaps):com.intellij.ui.dsl.builder.CellBase - a:enabled(Z):com.intellij.ui.dsl.builder.CellBase - a:enabledIf(com.intellij.openapi.observable.properties.ObservableProperty):com.intellij.ui.dsl.builder.CellBase diff --git a/platform/platform-impl/src/com/intellij/ui/dsl/builder/Cell.kt b/platform/platform-impl/src/com/intellij/ui/dsl/builder/Cell.kt index e2c02a6079f8..04352a52b017 100644 --- a/platform/platform-impl/src/com/intellij/ui/dsl/builder/Cell.kt +++ b/platform/platform-impl/src/com/intellij/ui/dsl/builder/Cell.kt @@ -34,11 +34,11 @@ interface Cell : CellBase> { @Deprecated("Use align(AlignX.LEFT/CENTER/RIGHT/FILL) method instead", level = DeprecationLevel.ERROR) @ApiStatus.ScheduledForRemoval - override fun horizontalAlign(horizontalAlign: HorizontalAlign): Cell + fun horizontalAlign(horizontalAlign: HorizontalAlign): Cell @Deprecated("Use align(AlignY.TOP/CENTER/BOTTOM/FILL) method instead", level = DeprecationLevel.ERROR) @ApiStatus.ScheduledForRemoval - override fun verticalAlign(verticalAlign: VerticalAlign): Cell + fun verticalAlign(verticalAlign: VerticalAlign): Cell override fun align(align: Align): Cell @@ -48,7 +48,7 @@ interface Cell : CellBase> { @Deprecated("Use customize(UnscaledGaps) instead", level = DeprecationLevel.HIDDEN) @ApiStatus.ScheduledForRemoval - override fun customize(customGaps: Gaps): Cell + fun customize(customGaps: Gaps): Cell override fun customize(customGaps: UnscaledGaps): Cell diff --git a/platform/platform-impl/src/com/intellij/ui/dsl/builder/CellBase.kt b/platform/platform-impl/src/com/intellij/ui/dsl/builder/CellBase.kt index 70337a835a9a..a84382697a27 100644 --- a/platform/platform-impl/src/com/intellij/ui/dsl/builder/CellBase.kt +++ b/platform/platform-impl/src/com/intellij/ui/dsl/builder/CellBase.kt @@ -2,7 +2,9 @@ package com.intellij.ui.dsl.builder import com.intellij.openapi.observable.properties.ObservableProperty -import com.intellij.ui.dsl.gridLayout.* +import com.intellij.ui.dsl.gridLayout.Constraints +import com.intellij.ui.dsl.gridLayout.Grid +import com.intellij.ui.dsl.gridLayout.UnscaledGaps import com.intellij.ui.layout.ComponentPredicate import org.jetbrains.annotations.ApiStatus @@ -57,16 +59,6 @@ interface CellBase> { */ fun enabledIf(property: ObservableProperty): CellBase - @ApiStatus.Internal - @Deprecated("Use align(AlignX.LEFT/CENTER/RIGHT/FILL) method instead", level = DeprecationLevel.ERROR) - @ApiStatus.ScheduledForRemoval - fun horizontalAlign(horizontalAlign: HorizontalAlign): CellBase - - @ApiStatus.Internal - @Deprecated("Use align(AlignY.TOP/CENTER/BOTTOM/FILL) method instead", level = DeprecationLevel.ERROR) - @ApiStatus.ScheduledForRemoval - fun verticalAlign(verticalAlign: VerticalAlign): CellBase - /** * Updates horizontal and/or vertical alignment of the component inside the cell. To stretch the content on whole cell * use [AlignX.FILL]/[AlignY.FILL]/[Align.FILL]. For setting both horizontal and vertical alignment use [Align] constants or @@ -97,13 +89,6 @@ interface CellBase> { */ fun gap(rightGap: RightGap): CellBase - /** - * Overrides all gaps around the cell by [customGaps]. Should be used rarely for very specific cases - */ - @Deprecated("Use customize(UnscaledGaps) instead", level = DeprecationLevel.HIDDEN) - @ApiStatus.ScheduledForRemoval - fun customize(customGaps: Gaps): CellBase - /** * Overrides all gaps around the cell by [customGaps]. Should be used rarely for very specific cases */ diff --git a/platform/platform-impl/src/com/intellij/ui/dsl/builder/impl/CellBaseImpl.kt b/platform/platform-impl/src/com/intellij/ui/dsl/builder/impl/CellBaseImpl.kt index 7f5f98e6e8af..d50a7eb414fc 100644 --- a/platform/platform-impl/src/com/intellij/ui/dsl/builder/impl/CellBaseImpl.kt +++ b/platform/platform-impl/src/com/intellij/ui/dsl/builder/impl/CellBaseImpl.kt @@ -50,14 +50,14 @@ internal sealed class CellBaseImpl> : CellBase { @Deprecated("Use align(AlignX.LEFT/CENTER/RIGHT/FILL) method instead") @ApiStatus.ScheduledForRemoval - override fun horizontalAlign(horizontalAlign: HorizontalAlign): CellBase { + open fun horizontalAlign(horizontalAlign: HorizontalAlign): CellBase { this.horizontalAlign = horizontalAlign return this } @Deprecated("Use align(AlignY.TOP/CENTER/BOTTOM/FILL) method instead") @ApiStatus.ScheduledForRemoval - override fun verticalAlign(verticalAlign: VerticalAlign): CellBase { + open fun verticalAlign(verticalAlign: VerticalAlign): CellBase { this.verticalAlign = verticalAlign return this } @@ -85,7 +85,7 @@ internal sealed class CellBaseImpl> : CellBase { @Deprecated("Use customize(UnscaledGaps) instead") @ApiStatus.ScheduledForRemoval - override fun customize(customGaps: Gaps): CellBase { + open fun customize(customGaps: Gaps): CellBase { return customize(customGaps.toUnscaled()) }