@@ -7,10 +7,16 @@ import com.intellij.icons.AllIcons
7
7
import com.intellij.ide.BrowserUtil
8
8
import com.intellij.openapi.actionSystem.AnAction
9
9
import com.intellij.openapi.actionSystem.AnActionEvent
10
+ import com.intellij.openapi.application.runInEdt
11
+ import com.intellij.openapi.progress.ProgressIndicator
12
+ import com.intellij.openapi.progress.ProgressManager
13
+ import com.intellij.openapi.progress.Task
10
14
import com.intellij.openapi.project.Project
11
15
import com.intellij.openapi.ui.Messages
12
16
import com.intellij.ui.EditorNotificationPanel
17
+ import software.aws.toolkits.jetbrains.AwsPlugin
13
18
import software.aws.toolkits.jetbrains.AwsToolkit
19
+ import software.aws.toolkits.jetbrains.core.plugin.PluginUpdateManager
14
20
import software.aws.toolkits.resources.AwsCoreBundle
15
21
16
22
fun checkSeverity (notificationSeverity : String ): NotificationSeverity = when (notificationSeverity) {
@@ -37,7 +43,7 @@ object NotificationManager {
37
43
if (action.type == " UpdateExtension" ) {
38
44
add(
39
45
NotificationActionList (AwsCoreBundle .message(" notification.update" )) {
40
- // TODO: Add update logic
46
+ updatePlugins()
41
47
}
42
48
)
43
49
}
@@ -96,6 +102,21 @@ object NotificationManager {
96
102
97
103
return panel
98
104
}
105
+ private fun updatePlugins () {
106
+ val pluginUpdateManager = PluginUpdateManager ()
107
+ runInEdt {
108
+ ProgressManager .getInstance().run (object : Task .Backgroundable (
109
+ null ,
110
+ AwsCoreBundle .message(" aws.settings.auto_update.progress.message" )
111
+ ) {
112
+ override fun run (indicator : ProgressIndicator ) {
113
+ pluginUpdateManager.checkForUpdates(indicator, AwsPlugin .CORE )
114
+ pluginUpdateManager.checkForUpdates(indicator, AwsPlugin .TOOLKIT )
115
+ pluginUpdateManager.checkForUpdates(indicator, AwsPlugin .Q )
116
+ }
117
+ })
118
+ }
119
+ }
99
120
}
100
121
101
122
data class NotificationActionList (
0 commit comments