File tree Expand file tree Collapse file tree 16 files changed +354
-0
lines changed
components/ide/jetbrains/backend-plugin/src/main
kotlin/io/gitpod/jetbrains/remote Expand file tree Collapse file tree 16 files changed +354
-0
lines changed Original file line number Diff line number Diff line change 44
55package io.gitpod.jetbrains.remote
66
7+ import com.intellij.ide.BrowserUtil
78import com.intellij.ide.plugins.PluginManagerCore
89import com.intellij.notification.NotificationAction
910import com.intellij.notification.NotificationGroupManager
@@ -53,6 +54,7 @@ import java.util.concurrent.CancellationException
5354import java.util.concurrent.CompletableFuture
5455import javax.websocket.DeploymentException
5556
57+ @Suppress(" UnstableApiUsage" , " OPT_IN_USAGE" )
5658@Service
5759class GitpodManager : Disposable {
5860
@@ -392,4 +394,9 @@ class GitpodManager : Disposable {
392394 }
393395 }
394396
397+ /* * Opens the give URL in the Browser and records an event indicating it was open from a custom IntelliJ Action. */
398+ fun openUrlFromAction (url : String ) {
399+ trackEvent(" jb_perform_action_open_url" , mapOf (" url" to url))
400+ BrowserUtil .browse(url)
401+ }
395402}
Original file line number Diff line number Diff line change 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.actions
6+
7+ import com.intellij.openapi.actionSystem.AnAction
8+ import com.intellij.openapi.actionSystem.AnActionEvent
9+ import com.intellij.openapi.components.service
10+ import io.gitpod.jetbrains.remote.GitpodManager
11+ import org.apache.http.client.utils.URIBuilder
12+
13+ class AccessControlAction : AnAction () {
14+ private val manager = service<GitpodManager >()
15+
16+ override fun actionPerformed (event : AnActionEvent ) {
17+ manager.pendingInfo.thenAccept { workspaceInfo ->
18+ URIBuilder (workspaceInfo.gitpodHost).setPath(" integrations" ).build().toString().let { url ->
19+ manager.openUrlFromAction(url)
20+ }
21+ }
22+ }
23+ }
Original file line number Diff line number Diff line change 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.actions
6+
7+ import com.intellij.openapi.actionSystem.AnAction
8+ import com.intellij.openapi.actionSystem.AnActionEvent
9+ import com.intellij.openapi.components.service
10+ import io.gitpod.jetbrains.remote.GitpodManager
11+
12+ class CommunityChatAction : AnAction () {
13+ private val manager = service<GitpodManager >()
14+
15+ override fun actionPerformed (event : AnActionEvent ) {
16+ manager.openUrlFromAction(" https://www.gitpod.io/chat" )
17+ }
18+ }
Original file line number Diff line number Diff line change 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.actions
6+
7+ import com.intellij.openapi.actionSystem.AnAction
8+ import com.intellij.openapi.actionSystem.AnActionEvent
9+ import com.intellij.openapi.components.service
10+ import io.gitpod.jetbrains.remote.GitpodManager
11+
12+ class ContextAction : AnAction () {
13+ private val manager = service<GitpodManager >()
14+
15+ override fun actionPerformed (event : AnActionEvent ) {
16+ manager.pendingInfo.thenAccept { workspaceInfo ->
17+ manager.openUrlFromAction(workspaceInfo.workspaceContextUrl)
18+ }
19+ }
20+ }
Original file line number Diff line number Diff line change 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.actions
6+
7+ import com.intellij.openapi.actionSystem.AnAction
8+ import com.intellij.openapi.actionSystem.AnActionEvent
9+ import com.intellij.openapi.components.service
10+ import io.gitpod.jetbrains.remote.GitpodManager
11+
12+ class DashboardAction : AnAction () {
13+ private val manager = service<GitpodManager >()
14+
15+ override fun actionPerformed (event : AnActionEvent ) {
16+ manager.pendingInfo.thenAccept { workspaceInfo ->
17+ manager.openUrlFromAction(workspaceInfo.gitpodHost)
18+ }
19+ }
20+ }
Original file line number Diff line number Diff line change 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.actions
6+
7+ import com.intellij.openapi.actionSystem.AnAction
8+ import com.intellij.openapi.actionSystem.AnActionEvent
9+ import com.intellij.openapi.components.service
10+ import io.gitpod.jetbrains.remote.GitpodManager
11+
12+ class DocumentationAction : AnAction () {
13+ private val manager = service<GitpodManager >()
14+
15+ override fun actionPerformed (event : AnActionEvent ) {
16+ manager.openUrlFromAction(" https://www.gitpod.io/docs" )
17+ }
18+ }
Original file line number Diff line number Diff line change 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.actions
6+
7+ import com.intellij.openapi.actionSystem.AnAction
8+ import com.intellij.openapi.actionSystem.AnActionEvent
9+
10+ class ExtendWorkspaceTimeoutAction : AnAction () {
11+ override fun actionPerformed (event : AnActionEvent ) {
12+ TODO (" Not yet implemented" )
13+ }
14+ }
Original file line number Diff line number Diff line change 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.actions
6+
7+ import com.intellij.openapi.actionSystem.AnAction
8+ import com.intellij.openapi.actionSystem.AnActionEvent
9+ import com.intellij.openapi.components.service
10+ import io.gitpod.jetbrains.remote.GitpodManager
11+
12+ class FollowUsOnTwitterAction : AnAction () {
13+ private val manager = service<GitpodManager >()
14+
15+ override fun actionPerformed (event : AnActionEvent ) {
16+ manager.openUrlFromAction(" https://twitter.com/gitpod" )
17+ }
18+ }
Original file line number Diff line number Diff line change 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.actions
6+
7+ import com.intellij.openapi.actionSystem.AnAction
8+ import com.intellij.openapi.actionSystem.AnActionEvent
9+ import com.intellij.openapi.components.service
10+ import io.gitpod.jetbrains.remote.GitpodManager
11+
12+ class InBrowser : AnAction () {
13+ private val manager = service<GitpodManager >()
14+
15+ override fun actionPerformed (event : AnActionEvent ) {
16+ manager.pendingInfo.thenAccept { workspaceInfo ->
17+ manager.openUrlFromAction(workspaceInfo.workspaceUrl)
18+ }
19+ }
20+ }
Original file line number Diff line number Diff line change 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.actions
6+
7+ import com.intellij.openapi.actionSystem.AnAction
8+ import com.intellij.openapi.actionSystem.AnActionEvent
9+ import com.intellij.openapi.components.service
10+ import io.gitpod.jetbrains.remote.GitpodManager
11+
12+ class ReportIssueAction : AnAction () {
13+ private val manager = service<GitpodManager >()
14+
15+ override fun actionPerformed (event : AnActionEvent ) {
16+ manager.openUrlFromAction(" https://github.com/gitpod-io/gitpod/issues/new/choose" )
17+ }
18+ }
You can’t perform that action at this time.
0 commit comments