Skip to content

Commit 0de38b2

Browse files
committed
Add welcome screen
- a bundle with localizable strings - implement gateway connector extension point
1 parent a9f540f commit 0de38b2

File tree

5 files changed

+68
-1
lines changed

5 files changed

+68
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,6 @@
44

55
## [Unreleased]
66

7-
### Added
7+
### Added
8+
9+
* welcome screen
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package com.coder.gateway
2+
3+
import com.intellij.DynamicBundle
4+
import org.jetbrains.annotations.NonNls
5+
import org.jetbrains.annotations.PropertyKey
6+
7+
@NonNls
8+
private const val BUNDLE = "messages.CoderGatewayBundle"
9+
10+
object CoderGatewayBundle : DynamicBundle(BUNDLE) {
11+
12+
@Suppress("SpreadOperator")
13+
@JvmStatic
14+
fun message(@PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any) = getMessage(key, *params)
15+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
package com.coder.gateway
2+
3+
import com.intellij.ui.IconManager
4+
import com.intellij.ui.components.ActionLink
5+
import com.intellij.ui.components.BrowserLink
6+
import com.jetbrains.gateway.api.GatewayConnector
7+
import com.jetbrains.gateway.api.GatewayConnectorView
8+
import com.jetbrains.rd.util.lifetime.Lifetime
9+
import javax.swing.Icon
10+
import javax.swing.JComponent
11+
12+
class CoderGatewayConnector : GatewayConnector {
13+
override val icon: Icon
14+
get() = IconManager.getInstance().getIcon("coder_logo.svg", this::class.java)
15+
16+
override fun createView(lifetime: Lifetime): GatewayConnectorView {
17+
TODO("Not yet implemented")
18+
}
19+
20+
override fun getActionText(): String {
21+
return CoderGatewayBundle.message("gateway.connector.action.text")
22+
}
23+
24+
override fun getDescription(): String? {
25+
return CoderGatewayBundle.message("gateway.connector.description")
26+
}
27+
28+
override fun getDocumentationLink(): ActionLink? {
29+
return BrowserLink(null, "Learn more about Coder Workspaces", null, "https://coder.com/docs/coder/latest/workspaces")
30+
}
31+
32+
override fun getTitle(): String {
33+
return CoderGatewayBundle.message("gateway.connector.title")
34+
}
35+
36+
override fun getTitleAdornment(): JComponent? {
37+
return null
38+
}
39+
40+
override fun isAvailable(): Boolean {
41+
return true
42+
}
43+
}

src/resources/META-INF/plugin.xml renamed to src/main/resources/META-INF/plugin.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,8 @@
88
<!-- https://plugins.jetbrains.com/docs/intellij/plugin-compatibility.html -->
99
<depends>com.intellij.modules.platform</depends>
1010
<depends>com.jetbrains.gateway</depends>
11+
12+
<extensions defaultExtensionNs="com.jetbrains">
13+
<gatewayConnector implementation="com.coder.gateway.CoderGatewayConnector"/>
14+
</extensions>
1115
</idea-plugin>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
gateway.connector.title = Coder
2+
gateway.connector.description = Connects to a dev environment running in Coder Workspaces
3+
gateway.connector.action.text = Connect to Coder Workspaces

0 commit comments

Comments
 (0)