[ui-dsl] Mark row comments content as Nls
authorNikolay Rykunov <nikolay.rykunov@jetbrains.com>
Tue, 11 Aug 2020 11:45:37 +0000 (14:45 +0300)
committerintellij-monorepo-bot <intellij-monorepo-bot-no-reply@jetbrains.com>
Tue, 11 Aug 2020 12:09:38 +0000 (12:09 +0000)
GitOrigin-RevId: ed60b731bd1742bd3ea42fb6ce5c67b93a7773eb

platform/platform-impl/src/com/intellij/ui/layout/Cell.kt
platform/platform-impl/src/com/intellij/ui/layout/migLayout/MigLayoutRow.kt

index 47cfc6dfa601065ea79d4bc65bd0e6db33ad82bf..3a6d6ca3d1091672291608893124d391b0564a27 100644 (file)
@@ -99,7 +99,7 @@ class ValidationInfoBuilder(val component: JComponent) {
 interface CellBuilder<out T : JComponent> {
   val component: T
 
-  fun comment(text: String, maxLineLength: Int = 70, forComponent: Boolean = false): CellBuilder<T>
+  fun comment(@Nls text: String, maxLineLength: Int = 70, forComponent: Boolean = false): CellBuilder<T>
   fun commentComponent(component: JComponent, forComponent: Boolean = false): CellBuilder<T>
   fun focused(): CellBuilder<T>
   fun withValidationOnApply(callback: ValidationInfoBuilder.(T) -> ValidationInfo?): CellBuilder<T>
index 23c4aa84657f88b80620a806f2ef4517383404d0..610fe0bba47f16fb77dc44ed275058dfe8de982e 100644 (file)
@@ -18,6 +18,7 @@ import com.intellij.util.SmartList
 import net.miginfocom.layout.BoundSize
 import net.miginfocom.layout.CC
 import net.miginfocom.layout.LayoutUtil
+import org.jetbrains.annotations.Nls
 import javax.swing.*
 import javax.swing.border.LineBorder
 import kotlin.math.max
@@ -380,7 +381,7 @@ internal class MigLayoutRow(private val parent: MigLayoutRow?,
   private val JComponent.constraints: CC
     get() = builder.componentConstraints.getOrPut(this) { CC() }
 
-  fun addCommentRow(comment: String, maxLineLength: Int, forComponent: Boolean) {
+  fun addCommentRow(@Nls comment: String, maxLineLength: Int, forComponent: Boolean) {
     val commentComponent = ComponentPanelBuilder.createCommentComponent(comment, true, maxLineLength, true)
     addCommentRow(commentComponent, forComponent)
   }