Skip to content

Commit

Permalink
Merge pull request #399 from valb3r/bugfix/ij-2024.2
Browse files Browse the repository at this point in the history
Bugfix/ij 2024.2
  • Loading branch information
valb3r authored Aug 26, 2024
2 parents 921c608 + d505e66 commit f0a8b02
Show file tree
Hide file tree
Showing 20 changed files with 116 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import com.intellij.ide.fileTemplates.FileTemplate
import com.intellij.ide.fileTemplates.FileTemplateManager
import com.intellij.ide.fileTemplates.actions.AttributesDefaults
import com.intellij.ide.fileTemplates.ui.CreateFromTemplateDialog
import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.project.DumbAware
import com.intellij.openapi.project.Project
import com.intellij.openapi.util.io.FileUtilRt
Expand All @@ -29,6 +30,10 @@ class NewActivitiBpmnAction:
}
}

override fun getActionUpdateThread(): ActionUpdateThread {
return ActionUpdateThread.BGT
}

override fun getActionName(directory: PsiDirectory?, newName: String, templateName: String?) = NEW_FILE

override fun buildDialog(project: Project, directory: PsiDirectory, builder: CreateFileFromTemplateDialog.Builder) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,4 @@ class ViewActivitiBpmnDiagramAction : BaseViewBpmnDiagramAction() {
override fun notificationBalloon(project: Project, message: String, type: NotificationType) {
showNotificationBalloon(project, message, type)
}

override fun getActionUpdateThread(): ActionUpdateThread {
return ActionUpdateThread.BGT
}
}
17 changes: 10 additions & 7 deletions activiti-intellij-plugin/src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<name>Activiti BPMN visualizer</name>

<!-- Plugin version -->
<version>0.5.4.3</version>
<version>0.5.4.4</version>

<!-- Unique identifier of the plugin. Cannot be changed between the plugin versions.
If not specified, assumed to be equal to <name>. -->
Expand Down Expand Up @@ -40,6 +40,15 @@
<!-- Description of changes in the latest version of the plugin. Displayed in the "Plugins" settings dialog and
in the plugin repository Web interface. -->
<change-notes><![CDATA[
<p>0.5.4.4:</p>
<ul>
<li>
Fixed compatibility issue with IntelliJ 2024.2
</li>
<li>
Support for 'Select All' elements via Ctrl-A or Cmd-A (MacOS)
</li>
</ul>
<p>0.5.4.3:</p>
<ul>
<li>
Expand Down Expand Up @@ -70,12 +79,6 @@
Fixed: Language injection into XML was using hardcoded extension list
</li>
</ul>
<p>0.5.3.1:</p>
<ul>
<li>
Fixed blocker issue when users have multiple (i.e. Flowable,Camunda) plugins installed
</li>
</ul>
]]></change-notes>

<!-- The vendor of the plugin. The optional "url" attribute specifies the URL of the vendor homepage.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import com.intellij.database.model.DasNamespace
import com.intellij.database.psi.DbElement
import com.intellij.database.remote.jdbc.RemoteConnection
import com.intellij.database.util.DbImplUtil
import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.actionSystem.LangDataKeys
Expand All @@ -24,6 +25,10 @@ import java.util.concurrent.atomic.AtomicReference

abstract class DefaultAttachBpmnDebuggerToDbAction(private val debugger: (schema: DbElement) -> BpmnDebugger) : AnAction() {

override fun getActionUpdateThread(): ActionUpdateThread {
return ActionUpdateThread.EDT
}

override fun actionPerformed(anActionEvent: AnActionEvent) {
val project = anActionEvent.project ?: return
val schema = properElem(anActionEvent) ?: return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.valb3r.bpmn.intellij.plugin.commons.actions

import com.intellij.database.model.DasNamespace
import com.intellij.database.psi.DbElement
import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.actionSystem.LangDataKeys
Expand All @@ -12,6 +13,10 @@ import com.valb3r.bpmn.intellij.plugin.core.debugger.detachDebugger

abstract class DefaultDetachBpmnDebuggerFromDbAction : AnAction() {

override fun getActionUpdateThread(): ActionUpdateThread {
return ActionUpdateThread.EDT
}

override fun actionPerformed(anActionEvent: AnActionEvent) {
val project = anActionEvent.project ?: return
detachDebugger(project)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ class KeyboardEventHandler(private val project: Project, private val canvas: Can

private fun handleKeyWithControl(e: KeyEvent) {
when (e.keyCode) {
KeyEvent.VK_A -> {
currentCanvas(project).selectAllElements()
}
KeyEvent.VK_Y -> if (updateEventsRegistry(project).undoRedoStatus().contains(ProcessModelUpdateEvents.UndoRedo.REDO)) {
updateEventsRegistry(project).redo()
currentCanvas(project).repaint()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.valb3r.bpmn.intellij.plugin.core.actions

import com.intellij.notification.NotificationType
import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.actionSystem.CommonDataKeys
Expand All @@ -18,6 +19,10 @@ abstract class BaseViewBpmnDiagramAction : AnAction() {

abstract val toolWindowName: String

override fun getActionUpdateThread(): ActionUpdateThread {
return ActionUpdateThread.BGT
}

override fun actionPerformed(anActionEvent: AnActionEvent) {
val project = anActionEvent.project ?: return
val file = psiElement(anActionEvent)?.containingFile ?: return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,17 @@ open class Canvas(private val project: Project, private val settings: CanvasCons
this.selectedElements.addAll(elements)
}

fun selectAllElements() {
clearSelection()
this.selectedElements.addAll(
elemsUnderRect(
null,
excludeAreas = setOf(AreaType.PARENT_PROCESS_SHAPE, AreaType.SELECTS_DRAG_TARGET)
)
)
repaint()
}

private fun selectDragTarget(dragged: DiagramElementId, ctx: ElementInteractionContext): DiagramElementId? {
val areas = areaByElement!!
val area = areas[dragged]!!.area
Expand Down Expand Up @@ -556,8 +567,8 @@ open class Canvas(private val project: Project, private val settings: CanvasCons
return result
}

private fun elemsUnderRect(withinRect: Rectangle2D, excludeAreas: Set<AreaType> = setOf(AreaType.PARENT_PROCESS_SHAPE)): List<DiagramElementId> {
val intersection = areaByElement?.filter { withinRect.contains(it.value.area.bounds2D) }
private fun elemsUnderRect(withinRect: Rectangle2D?, excludeAreas: Set<AreaType> = setOf(AreaType.PARENT_PROCESS_SHAPE)): List<DiagramElementId> {
val intersection = if (null == withinRect) areaByElement else areaByElement?.filter { withinRect.contains(it.value.area.bounds2D) }

val result = mutableListOf<DiagramElementId>()
intersection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.valb3r.bpmn.intellij.plugin.core.ui.components.notifications

import com.intellij.ide.BrowserUtil
import com.intellij.notification.*
import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.project.Project
import java.util.concurrent.ConcurrentHashMap
Expand All @@ -27,6 +28,10 @@ fun genericShowNotificationBalloon(project: Project, groupId: String, text: Stri
actionCallBack.invoke()
notification.expire()
}

override fun getActionUpdateThread(): ActionUpdateThread {
return ActionUpdateThread.EDT
}
}
notification.addAction(action)
}
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
}

ext {
intellijPlatform = 'IU-2022.3'
intellijPlatform = 'IU-2023.1'
intellijPlatformPlugins = ['java', 'DatabaseTools'] // DatabaseTools is for BPMN process 'debugging'

kotlinStdlib = '1.5.30'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import com.intellij.ide.fileTemplates.FileTemplate
import com.intellij.ide.fileTemplates.FileTemplateManager
import com.intellij.ide.fileTemplates.actions.AttributesDefaults
import com.intellij.ide.fileTemplates.ui.CreateFromTemplateDialog
import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.project.DumbAware
import com.intellij.openapi.project.Project
import com.intellij.openapi.util.io.FileUtilRt
Expand All @@ -29,6 +30,10 @@ class NewCamundaBpmnAction:
}
}

override fun getActionUpdateThread(): ActionUpdateThread {
return ActionUpdateThread.BGT
}

override fun getActionName(directory: PsiDirectory?, newName: String, templateName: String?) = NEW_FILE

override fun buildDialog(project: Project, directory: PsiDirectory, builder: CreateFileFromTemplateDialog.Builder) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,4 @@ class ViewCamundaBpmnDiagramAction : BaseViewBpmnDiagramAction() {
val psiElement = psiElement(anActionEvent)
anActionEvent.presentation.isEnabledAndVisible = project != null && isValidFileName(psiElement?.containingFile?.name)
}

override fun getActionUpdateThread(): ActionUpdateThread {
return ActionUpdateThread.BGT
}
}
17 changes: 10 additions & 7 deletions camunda-intellij-plugin/src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<name>Camunda BPMN visualizer</name>

<!-- Plugin version -->
<version>0.5.4.3</version>
<version>0.5.4.4</version>

<!-- Unique identifier of the plugin. Cannot be changed between the plugin versions.
If not specified, assumed to be equal to <name>. -->
Expand Down Expand Up @@ -40,6 +40,15 @@
<!-- Description of changes in the latest version of the plugin. Displayed in the "Plugins" settings dialog and
in the plugin repository Web interface. -->
<change-notes><![CDATA[
<p>0.5.4.4:</p>
<ul>
<li>
Fixed compatibility issue with IntelliJ 2024.2
</li>
<li>
Support for 'Select All' elements via Ctrl-A or Cmd-A (MacOS)
</li>
</ul>
<p>0.5.4.3:</p>
<ul>
<li>
Expand Down Expand Up @@ -76,12 +85,6 @@
Fixed: Language injection into XML was using hardcoded extension list
</li>
</ul>
<p>0.5.3.1:</p>
<ul>
<li>
Fixed blocker issue when users have multiple (i.e. Flowable,Camunda) plugins installed
</li>
</ul>
]]></change-notes>

<!-- The vendor of the plugin. The optional "url" attribute specifies the URL of the vendor homepage.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import com.intellij.ide.fileTemplates.FileTemplate
import com.intellij.ide.fileTemplates.FileTemplateManager
import com.intellij.ide.fileTemplates.actions.AttributesDefaults
import com.intellij.ide.fileTemplates.ui.CreateFromTemplateDialog
import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.project.DumbAware
import com.intellij.openapi.project.Project
import com.intellij.openapi.util.io.FileUtilRt
Expand All @@ -29,6 +30,10 @@ class NewFlowableBpmnAction:
}
}

override fun getActionUpdateThread(): ActionUpdateThread {
return ActionUpdateThread.BGT
}

override fun getActionName(directory: PsiDirectory?, newName: String, templateName: String?) = NEW_FILE

override fun buildDialog(project: Project, directory: PsiDirectory, builder: CreateFileFromTemplateDialog.Builder) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,4 @@ class ViewFlowableBpmnDiagramAction : BaseViewBpmnDiagramAction() {
override fun notificationBalloon(project: Project, message: String, type: NotificationType) {
showNotificationBalloon(project, message, type)
}

override fun getActionUpdateThread(): ActionUpdateThread {
return ActionUpdateThread.BGT
}
}
17 changes: 10 additions & 7 deletions flowable-intellij-plugin/src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<name>Flowable BPMN visualizer</name>

<!-- Plugin version -->
<version>0.5.4.3</version>
<version>0.5.4.4</version>

<!-- Unique identifier of the plugin. Cannot be changed between the plugin versions.
If not specified, assumed to be equal to <name>. -->
Expand Down Expand Up @@ -40,6 +40,15 @@
<!-- Description of changes in the latest version of the plugin. Displayed in the "Plugins" settings dialog and
in the plugin repository Web interface. -->
<change-notes><![CDATA[
<p>0.5.4.4:</p>
<ul>
<li>
Fixed compatibility issue with IntelliJ 2024.2
</li>
<li>
Support for 'Select All' elements via Ctrl-A or Cmd-A (MacOS)
</li>
</ul>
<p>0.5.4.3:</p>
<ul>
<li>
Expand Down Expand Up @@ -70,12 +79,6 @@
Fixed: Language injection into XML was using hardcoded extension list
</li>
</ul>
<p>0.5.3.1:</p>
<ul>
<li>
Fixed blocker issue when users have multiple (i.e. Flowable,Camunda) plugins installed
</li>
</ul>
]]></change-notes>

<!-- The vendor of the plugin. The optional "url" attribute specifies the URL of the vendor homepage.
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit f0a8b02

Please sign in to comment.