Remove NotificationAction.createSimple to fix compilation in 173

This commit is contained in:
Nikolay Krasko
2018-09-28 00:50:06 +03:00
parent e7bed58ebe
commit 1901331ee5
2 changed files with 11 additions and 5 deletions
+2
View File
@@ -105,6 +105,8 @@
<Problem reference="org.jetbrains.java.decompiler.main.decompiler.BaseDecompiler#addSpace" reason="Method was replaced with outher methods in 182. Use addSpaceEx instead." />
<Problem reference="com.intellij.psi.codeStyle.CommonCodeStyleSettings#copyFrom" reason="Absent in 173. Use CompatibilityKt.copyFromEx instead." />
<Problem reference="com.intellij.psi.codeStyle.CommonCodeStyleSettingsManager#copy" reason="Removed since 181. Use CompatibilityKt.copyFromEx instead." />
<Problem reference="com.intellij.notification.NotificationAction#createSimple" reason="Absent in 173." />
<Problem reference="com.intellij.notification.NotificationAction#create" reason="Absent in 173." />
</list>
</option>
</inspection_tool>
@@ -38,12 +38,16 @@ internal fun showMigrationNotification(project: Project, migrationInfo: Migratio
null
)
.also { notification ->
notification.addAction(NotificationAction.createSimple("Run migrations") {
val projectContext = SimpleDataContext.getProjectContext(project)
val action = ActionManager.getInstance().getAction(CodeMigrationAction.ACTION_ID)
Notification.fire(notification, action, projectContext)
notification.addAction(object : NotificationAction("Run migrations") {
// Replace with NotificationAction.createSimple after abandoning 173 and as31
// BUNCH: 181
override fun actionPerformed(e: AnActionEvent, notification: Notification) {
val projectContext = SimpleDataContext.getProjectContext(project)
val action = ActionManager.getInstance().getAction(CodeMigrationAction.ACTION_ID)
Notification.fire(notification, action, projectContext)
notification.expire()
notification.expire()
}
})
}
.notify(project)