From 0172499542a433218af9b2c4216b6c5870e3d8d5 Mon Sep 17 00:00:00 2001 From: valb3r Date: Mon, 17 Jul 2023 21:16:01 +0300 Subject: [PATCH] Release 0.5.3.1 - Hotfix for multiple plugins (Activiti,Camunda) on same host --- .../ActivitiBpmnPluginToolWindowFactory.kt | 6 ++++++ .../plugin/ActivitiPluginPreloaded.kt | 3 +++ .../ActivitiAdvertisementState.kt | 8 +++++++ .../src/main/resources/META-INF/plugin.xml | 10 +++++++-- ...mentState.kt => BaseAdvertisementState.kt} | 21 ++++++++++++------- .../advertisement/NotificationTryPolyBpmn.kt | 10 ++++----- .../CamundaBpmnPluginToolWindowFactory.kt | 3 +++ .../plugin/camunda/CamundaPluginPreloaded.kt | 3 +++ .../advertisement/AdvertisementState.kt | 8 +++++++ .../src/main/resources/META-INF/plugin.xml | 10 +++++++-- .../FlowableBpmnPluginToolWindowFactory.kt | 3 +++ .../flowable/FlowablePluginPreloaded.kt | 3 +++ .../FlowableAdvertisementState.kt | 8 +++++++ .../src/main/resources/META-INF/plugin.xml | 10 +++++++-- 14 files changed, 87 insertions(+), 19 deletions(-) create mode 100644 activiti-intellij-plugin/src/main/kotlin/com/valb3r/bpmn/intellij/activiti/plugin/advertisement/ActivitiAdvertisementState.kt rename bpmn-intellij-plugin-core/src/main/kotlin/com/valb3r/bpmn/intellij/plugin/core/advertisement/{AdvertisementState.kt => BaseAdvertisementState.kt} (50%) create mode 100644 camunda-intellij-plugin/src/main/kotlin/com/valb3r/bpmn/intellij/plugin/camunda/advertisement/AdvertisementState.kt create mode 100644 flowable-intellij-plugin/src/main/kotlin/com/valb3r/bpmn/intellij/plugin/flowable/advertisement/FlowableAdvertisementState.kt diff --git a/activiti-intellij-plugin/src/main/kotlin/com/valb3r/bpmn/intellij/activiti/plugin/ActivitiBpmnPluginToolWindowFactory.kt b/activiti-intellij-plugin/src/main/kotlin/com/valb3r/bpmn/intellij/activiti/plugin/ActivitiBpmnPluginToolWindowFactory.kt index 69053635..6efb8651 100644 --- a/activiti-intellij-plugin/src/main/kotlin/com/valb3r/bpmn/intellij/activiti/plugin/ActivitiBpmnPluginToolWindowFactory.kt +++ b/activiti-intellij-plugin/src/main/kotlin/com/valb3r/bpmn/intellij/activiti/plugin/ActivitiBpmnPluginToolWindowFactory.kt @@ -7,8 +7,10 @@ import com.intellij.openapi.project.Project import com.intellij.openapi.vfs.VirtualFile import com.intellij.openapi.wm.ToolWindow import com.intellij.openapi.wm.ToolWindowFactory +import com.valb3r.bpmn.intellij.activiti.plugin.advertisement.ActivitiAdvertisementState import com.valb3r.bpmn.intellij.activiti.plugin.notifications.showNotificationBalloon import com.valb3r.bpmn.intellij.activiti.plugin.popupmenu.ActivitiCanvasPopupMenuProvider +import com.valb3r.bpmn.intellij.activiti.plugin.settings.ActivitiBpmnPluginSettingsState import com.valb3r.bpmn.intellij.activiti.plugin.xmlnav.ActivitiXmlNavigator import com.valb3r.bpmn.intellij.plugin.activiti.parser.Activiti7ObjectFactory import com.valb3r.bpmn.intellij.plugin.activiti.parser.Activiti7Parser @@ -16,9 +18,11 @@ import com.valb3r.bpmn.intellij.plugin.activiti.parser.ActivitiObjectFactory import com.valb3r.bpmn.intellij.plugin.activiti.parser.ActivitiParser import com.valb3r.bpmn.intellij.plugin.commons.langinjection.registerCurrentFile import com.valb3r.bpmn.intellij.plugin.core.BpmnPluginToolWindow +import com.valb3r.bpmn.intellij.plugin.core.advertisement.currentAdvertisementStateProvider import com.valb3r.bpmn.intellij.plugin.core.getContentFactory import com.valb3r.bpmn.intellij.plugin.core.newelements.registerNewElementsFactory import com.valb3r.bpmn.intellij.plugin.core.parser.registerParser +import com.valb3r.bpmn.intellij.plugin.core.settings.currentSettingsStateProvider import com.valb3r.bpmn.intellij.plugin.core.ui.components.popupmenu.registerPopupMenuProvider import com.valb3r.bpmn.intellij.plugin.core.xmlnav.registerXmlNavigator import java.nio.charset.StandardCharsets @@ -29,6 +33,8 @@ class ActivitiBpmnPluginToolWindowFactory: ToolWindowFactory { override fun createToolWindowContent(project: Project, toolWindow: ToolWindow) { log.info("Creating tool window content") + currentSettingsStateProvider.set { ServiceManager.getService(ActivitiBpmnPluginSettingsState::class.java) } + currentAdvertisementStateProvider.set { ServiceManager.getService(ActivitiAdvertisementState::class.java) } val bpmnWindow = BpmnPluginToolWindow( project, diff --git a/activiti-intellij-plugin/src/main/kotlin/com/valb3r/bpmn/intellij/activiti/plugin/ActivitiPluginPreloaded.kt b/activiti-intellij-plugin/src/main/kotlin/com/valb3r/bpmn/intellij/activiti/plugin/ActivitiPluginPreloaded.kt index c1ea37da..86c39e32 100644 --- a/activiti-intellij-plugin/src/main/kotlin/com/valb3r/bpmn/intellij/activiti/plugin/ActivitiPluginPreloaded.kt +++ b/activiti-intellij-plugin/src/main/kotlin/com/valb3r/bpmn/intellij/activiti/plugin/ActivitiPluginPreloaded.kt @@ -3,7 +3,9 @@ package com.valb3r.bpmn.intellij.activiti.plugin import com.intellij.openapi.components.ServiceManager import com.intellij.openapi.project.Project import com.intellij.openapi.startup.StartupActivity +import com.valb3r.bpmn.intellij.activiti.plugin.advertisement.ActivitiAdvertisementState import com.valb3r.bpmn.intellij.activiti.plugin.settings.ActivitiBpmnPluginSettingsState +import com.valb3r.bpmn.intellij.plugin.core.advertisement.currentAdvertisementStateProvider import com.valb3r.bpmn.intellij.plugin.core.settings.currentSettingsStateProvider import java.util.concurrent.atomic.AtomicBoolean @@ -14,6 +16,7 @@ class ActivitiPluginPreloaded: StartupActivity.Background { override fun runActivity(project: Project) { if (isLoaded.compareAndSet(false, true)) { currentSettingsStateProvider.set { ServiceManager.getService(ActivitiBpmnPluginSettingsState::class.java) } + currentAdvertisementStateProvider.set { ServiceManager.getService(ActivitiAdvertisementState::class.java) } } } } \ No newline at end of file diff --git a/activiti-intellij-plugin/src/main/kotlin/com/valb3r/bpmn/intellij/activiti/plugin/advertisement/ActivitiAdvertisementState.kt b/activiti-intellij-plugin/src/main/kotlin/com/valb3r/bpmn/intellij/activiti/plugin/advertisement/ActivitiAdvertisementState.kt new file mode 100644 index 00000000..2c747549 --- /dev/null +++ b/activiti-intellij-plugin/src/main/kotlin/com/valb3r/bpmn/intellij/activiti/plugin/advertisement/ActivitiAdvertisementState.kt @@ -0,0 +1,8 @@ +package com.valb3r.bpmn.intellij.activiti.plugin.advertisement + +import com.intellij.openapi.components.State +import com.intellij.openapi.components.Storage +import com.valb3r.bpmn.intellij.plugin.core.advertisement.BaseAdvertisementState + +@State(name = "ActivitiIntellijPluginAdvertisementState", storages = [(Storage("valb3r-activiti-opensource-polybpmn-advertisement.xml"))], defaultStateAsResource = true) +class ActivitiAdvertisementState: BaseAdvertisementState() \ No newline at end of file diff --git a/activiti-intellij-plugin/src/main/resources/META-INF/plugin.xml b/activiti-intellij-plugin/src/main/resources/META-INF/plugin.xml index 46eeafb6..dca10941 100644 --- a/activiti-intellij-plugin/src/main/resources/META-INF/plugin.xml +++ b/activiti-intellij-plugin/src/main/resources/META-INF/plugin.xml @@ -4,7 +4,7 @@ Activiti BPMN visualizer - 0.5.3 + 0.5.3.1 @@ -39,6 +39,12 @@ 0.5.3.1:

+

0.5.3: