From e6ea173fec56a04b155a03f04b2b0a2f27f7716d Mon Sep 17 00:00:00 2001 From: Nikolay Rykunov Date: Mon, 4 Sep 2023 19:59:26 +0200 Subject: [PATCH] Code style --- .../jewel/bridge/actionSystem/ProvideData.kt | 6 ++--- .../bridge/actionSystem/ProvideDataTest.kt | 23 +++++++++---------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/ide-laf-bridge/src/main/kotlin/org/jetbrains/jewel/bridge/actionSystem/ProvideData.kt b/ide-laf-bridge/src/main/kotlin/org/jetbrains/jewel/bridge/actionSystem/ProvideData.kt index b0e1ab751..1bc1805ab 100644 --- a/ide-laf-bridge/src/main/kotlin/org/jetbrains/jewel/bridge/actionSystem/ProvideData.kt +++ b/ide-laf-bridge/src/main/kotlin/org/jetbrains/jewel/bridge/actionSystem/ProvideData.kt @@ -27,7 +27,7 @@ import javax.swing.JComponent fun ComponentDataProviderBridge( component: JComponent, modifier: Modifier = Modifier, - content: @Composable () -> Unit + content: @Composable () -> Unit, ) { val rootDataProviderModifier = remember { RootDataProviderModifier() } @@ -59,7 +59,7 @@ fun ComponentDataProviderBridge( */ @Suppress("unused") fun Modifier.provideData(dataProvider: (dataId: String) -> Any?) = this.then( - DataProviderElement(dataProvider) + DataProviderElement(dataProvider), ) @VisibleForTesting @@ -108,4 +108,4 @@ private fun DataProviderNode.traverseDownToFocused(): DataProviderNode? { } return this.takeIf { hasFocus } -} \ No newline at end of file +} diff --git a/ide-laf-bridge/src/test/kotlin/org/jetbrains/jewel/bridge/actionSystem/ProvideDataTest.kt b/ide-laf-bridge/src/test/kotlin/org/jetbrains/jewel/bridge/actionSystem/ProvideDataTest.kt index 0fb2bda92..f3c6e0cee 100644 --- a/ide-laf-bridge/src/test/kotlin/org/jetbrains/jewel/bridge/actionSystem/ProvideDataTest.kt +++ b/ide-laf-bridge/src/test/kotlin/org/jetbrains/jewel/bridge/actionSystem/ProvideDataTest.kt @@ -37,7 +37,7 @@ class ProvideDataTest { else -> null } } - .focusable() + .focusable(), ) } rule.awaitIdle() @@ -66,18 +66,18 @@ class ProvideDataTest { else -> null } } - .focusable() + .focusable(), ) { Box(modifier = Modifier.testTag("non_data_provider").focusable()) { - Box(modifier = Modifier - .testTag("data_provider_item") - .provideData { - when (it) { - "data" -> "ok" - else -> null - } - } - .focusable() + Box( + modifier = Modifier + .testTag("data_provider_item") + .provideData { + when (it) { + "data" -> "ok" + else -> null + } + }.focusable(), ) } } @@ -91,7 +91,6 @@ class ProvideDataTest { assertEquals("yes", rootDataProviderModifier.dataProvider("isRoot")) assertEquals(null, rootDataProviderModifier.dataProvider("data")) - focusManager!!.moveFocus(FocusDirection.Next) rule.awaitIdle()