Implement global notification for configurations update of gradle scripts
For 193: it will be a simple notification at the bottom of the IDEA window For 201: a floating notification in the editor is implemented near "Load Gradle Changes" icon ^KT-34443 Fixed
This commit is contained in:
+3
-4
@@ -58,9 +58,8 @@ class DefaultScriptConfigurationNotificationFactory : ScriptConfigurationNotific
|
||||
withSelectedEditor(project) { manager ->
|
||||
val existingPanel = notificationPanel
|
||||
if (existingPanel != null) {
|
||||
notificationPanel?.let {
|
||||
manager.removeTopComponent(this, it)
|
||||
}
|
||||
existingPanel.onClick = onClick
|
||||
return@withSelectedEditor
|
||||
}
|
||||
|
||||
val panel = NewLoadConfigurationNotificationPanel(onClick, project)
|
||||
@@ -84,7 +83,7 @@ class DefaultScriptConfigurationNotificationFactory : ScriptConfigurationNotific
|
||||
by UserDataProperty<FileEditor, NewLoadConfigurationNotificationPanel>(Key.create("load.script.configuration.panel"))
|
||||
|
||||
private class NewLoadConfigurationNotificationPanel(
|
||||
val onClick: () -> Unit,
|
||||
var onClick: () -> Unit,
|
||||
project: Project
|
||||
) : EditorNotificationPanel() {
|
||||
|
||||
|
||||
+2
-3
@@ -191,17 +191,16 @@ internal class DefaultScriptConfigurationManager(project: Project) :
|
||||
if (postponeLoading) {
|
||||
ScriptConfigurationNotificationFactory.NOTIFICATION_FACTORY.getPoint(project).extensionList.firstOrNull {
|
||||
it.showNotification(virtualFile, project) {
|
||||
runAsyncLoaders(file, virtualFile, scriptDefinition, async, postponeLoading)
|
||||
runAsyncLoaders(file, virtualFile, scriptDefinition, async, isLoadingPostponed = true)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
runAsyncLoaders(file, virtualFile, scriptDefinition, async, postponeLoading)
|
||||
runAsyncLoaders(file, virtualFile, scriptDefinition, async, isLoadingPostponed = false)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// в нотификации остается старый колбек - нужно перезаписывать колбек
|
||||
private fun runAsyncLoaders(
|
||||
file: KtFile,
|
||||
virtualFile: VirtualFile,
|
||||
|
||||
Reference in New Issue
Block a user