Skip to content

Commit 17a9cc3

Browse files
committed
Display "Gitpod Workspace: <WORKSPACE_ID>" on the top-left NavBar from JetBrains IDEs
1 parent 0e37dbc commit 17a9cc3

File tree

3 files changed

+30
-1
lines changed

3 files changed

+30
-1
lines changed

components/ide/jetbrains/backend-plugin/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pluginUntilBuild=221.*
1212
pluginVerifierIdeVersions=2021.3, 2022.1
1313
# IntelliJ Platform Properties -> https://github.com/JetBrains/gradle-intellij-plugin#intellij-platform-properties
1414
platformType=IU
15-
platformVersion=221.4994-EAP-CANDIDATE-SNAPSHOT
15+
platformVersion=221-EAP-SNAPSHOT
1616
platformDownloadSources=true
1717
# Plugin Dependencies -> https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
1818
# Example: platformPlugins = com.intellij.java, com.jetbrains.php:203.4449.22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Copyright (c) 2022 Gitpod GmbH. All rights reserved.
2+
// Licensed under the GNU Affero General Public License (AGPL).
3+
// See License-AGPL.txt in the project root for license information.
4+
5+
package io.gitpod.jetbrains.remote
6+
7+
import com.jetbrains.rdserver.unattendedHost.customization.GatewayClientCustomizationProvider
8+
import com.jetbrains.rdserver.unattendedHost.customization.controlCenter.DefaultGatewayControlCenterProvider
9+
import com.jetbrains.rdserver.unattendedHost.customization.controlCenter.GatewayControlCenterProvider
10+
import com.jetbrains.rdserver.unattendedHost.customization.controlCenter.GatewayHostnameDisplayKind
11+
import io.gitpod.jetbrains.remote.icons.GitpodIcons
12+
import javax.swing.Icon
13+
14+
class GitpodGatewayClientCustomizationProvider : GatewayClientCustomizationProvider {
15+
override val icon: Icon = GitpodIcons.Logo
16+
override val title: String = "Gitpod Workspace"
17+
18+
override val controlCenter: GatewayControlCenterProvider = object : GatewayControlCenterProvider {
19+
override fun getHostnameDisplayKind() = GatewayHostnameDisplayKind.ShowHostnameOnNavbar
20+
override fun getHostnameShort() = if (System.getenv("GITPOD_WORKSPACE_ID") != null) {
21+
title + ": " + System.getenv("GITPOD_WORKSPACE_ID")
22+
} else {
23+
title
24+
}
25+
override fun getHostnameLong() = getHostnameShort()
26+
}
27+
}
28+

components/ide/jetbrains/backend-plugin/src/main/resources/META-INF/plugin.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
<projectService serviceImplementation="io.gitpod.jetbrains.remote.GitpodClientProjectSessionTracker" client="guest" preload="true"/>
2929
<projectService serviceImplementation="io.gitpod.jetbrains.remote.GitpodTerminalService" preload="true"/>
3030
<projectService serviceImplementation="io.gitpod.jetbrains.remote.GitpodProjectManager" preload="true"/>
31+
<gateway.customization.name implementation="io.gitpod.jetbrains.remote.GitpodGatewayClientCustomizationProvider"/>
3132
</extensions>
3233

3334
</idea-plugin>

0 commit comments

Comments
 (0)