File tree 16 files changed +371
-8
lines changed
components/ide/jetbrains/backend-plugin/src/main
kotlin/io/gitpod/jetbrains/remote
16 files changed +371
-8
lines changed Original file line number Diff line number Diff line change 4
4
5
5
package io.gitpod.jetbrains.remote
6
6
7
+ import com.intellij.ide.BrowserUtil
7
8
import com.intellij.ide.plugins.PluginManagerCore
8
9
import com.intellij.notification.NotificationAction
9
10
import com.intellij.notification.NotificationGroupManager
@@ -53,6 +54,7 @@ import java.util.concurrent.CancellationException
53
54
import java.util.concurrent.CompletableFuture
54
55
import javax.websocket.DeploymentException
55
56
57
+ @Suppress(" UnstableApiUsage" , " OPT_IN_USAGE" )
56
58
@Service
57
59
class GitpodManager : Disposable {
58
60
@@ -392,4 +394,9 @@ class GitpodManager : Disposable {
392
394
}
393
395
}
394
396
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
+ }
395
402
}
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
+ import org.apache.http.client.utils.URIBuilder
12
+
13
+ class DashboardAction : AnAction () {
14
+ private val manager = service<GitpodManager >()
15
+
16
+ override fun actionPerformed (event : AnActionEvent ) {
17
+ manager.pendingInfo.thenAccept { workspaceInfo ->
18
+ URIBuilder (workspaceInfo.gitpodHost).setPath(" workspaces" ).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 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
+ }
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 SettingsAction : AnAction () {
14
+ private val manager = service<GitpodManager >()
15
+
16
+ override fun actionPerformed (event : AnActionEvent ) {
17
+ manager.pendingInfo.thenAccept { workspaceInfo ->
18
+ URIBuilder (workspaceInfo.gitpodHost).setPath(" settings" ).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
+
10
+ class ShareRunningWorkspaceAction : 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
+
10
+ class ShareWorkspaceSnapshotAction : 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
+
10
+ class StopWorkspaceAction : 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
+ import org.apache.http.client.utils.URIBuilder
12
+
13
+ class UpgradeSubscriptionAction : AnAction () {
14
+ private val manager = service<GitpodManager >()
15
+
16
+ override fun actionPerformed (event : AnActionEvent ) {
17
+ manager.pendingInfo.thenAccept { workspaceInfo ->
18
+ URIBuilder (workspaceInfo.gitpodHost).setPath(" plans" ).build().toString().let { url ->
19
+ manager.openUrlFromAction(url)
20
+ }
21
+ }
22
+ }
23
+ }
You can’t perform that action at this time.
0 commit comments