Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0d396f1

Browse files
committed
impl: direct access to observable properties
- without the need to go through a "field accessor"- fixes some NPE when reading the url
1 parentfb68191 commit0d396f1

File tree

4 files changed

+18
-26
lines changed

4 files changed

+18
-26
lines changed

‎src/main/kotlin/com/coder/gateway/views/CoderPage.kt‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -61,18 +61,6 @@ abstract class CoderPage(
6161
notifier?.accept(ex)?: errorBuffer.add(ex)
6262
}
6363

64-
/**
65-
* Get the value for a field.
66-
*
67-
* TODO@JB: Is this really meant to be used with casting? I kind of expected
68-
* to be able to do `myField.value`.
69-
*/
70-
funget(field:UiField):Any? {
71-
//return stateAccessor?.get(field)
72-
// TODO - check this later
73-
returnnull
74-
}
75-
7664
/**
7765
* Immediately notify any pending errors and store for later errors.
7866
*/

‎src/main/kotlin/com/coder/gateway/views/CoderSettingsPage.kt‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,17 @@ class CoderSettingsPage(private val settings: CoderSettingsService) : CoderPage(
4848

4949
overridefungetActionButtons():MutableList<RunnableActionDescription>=mutableListOf(
5050
Action("Save", closesPage=true) {
51-
settings.binarySource=get(binarySourceField)asString
52-
settings.binaryDirectory=get(binaryDirectoryField)asString
53-
settings.dataDirectory=get(dataDirectoryField)asString
54-
settings.enableDownloads=get(enableDownloadsField)asBoolean
55-
settings.enableBinaryDirectoryFallback=get(enableBinaryDirectoryFallbackField)asBoolean
56-
settings.headerCommand=get(headerCommandField)asString
57-
settings.tlsCertPath=get(tlsCertPathField)asString
58-
settings.tlsKeyPath=get(tlsKeyPathField)asString
59-
settings.tlsCAPath=get(tlsCAPathField)asString
60-
settings.tlsAlternateHostname=get(tlsAlternateHostnameField)asString
61-
settings.disableAutostart=get(disableAutostartField)asBoolean
51+
settings.binarySource= binarySourceField.text.value
52+
settings.binaryDirectory= binaryDirectoryField.text.value
53+
settings.dataDirectory= dataDirectoryField.text.value
54+
settings.enableDownloads= enableDownloadsField.checked.value
55+
settings.enableBinaryDirectoryFallback= enableBinaryDirectoryFallbackField.checked.value
56+
settings.headerCommand= headerCommandField.text.value
57+
settings.tlsCertPath= tlsCertPathField.text.value
58+
settings.tlsKeyPath= tlsKeyPathField.text.value
59+
settings.tlsCAPath= tlsCAPathField.text.value
60+
settings.tlsAlternateHostname= tlsAlternateHostnameField.text.value
61+
settings.disableAutostart= disableAutostartField.checked.value
6262
},
6363
)
6464
}

‎src/main/kotlin/com/coder/gateway/views/SignInPage.kt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class SignInPage(
4545
* Call onSignIn with the URL, or error if blank.
4646
*/
4747
privatefunsubmit() {
48-
val urlRaw=get(urlField)asString
48+
val urlRaw= urlField.text.value
4949
// Ensure the URL can be parsed.
5050
try {
5151
if (urlRaw.isBlank()) {

‎src/main/kotlin/com/coder/gateway/views/TokenPage.kt‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ package com.coder.gateway.views
33
importcom.coder.gateway.settings.Source
44
importcom.coder.gateway.util.withPath
55
importcom.jetbrains.toolbox.api.ui.actions.RunnableActionDescription
6-
importcom.jetbrains.toolbox.api.ui.components.*
6+
importcom.jetbrains.toolbox.api.ui.components.LabelField
7+
importcom.jetbrains.toolbox.api.ui.components.LinkField
8+
importcom.jetbrains.toolbox.api.ui.components.TextField
9+
importcom.jetbrains.toolbox.api.ui.components.TextType
10+
importcom.jetbrains.toolbox.api.ui.components.UiField
711
importjava.net.URL
812

913
/**
@@ -42,7 +46,7 @@ class TokenPage(
4246
* Buttons displayed at the bottom of the page.
4347
*/
4448
overridefungetActionButtons():MutableList<RunnableActionDescription>=mutableListOf(
45-
Action("Connect", closesPage=false) { submit(get(tokenField)asString) },
49+
Action("Connect", closesPage=false) { submit(tokenField.text.value) },
4650
)
4751

4852
/**

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp