Skip to content

Commit

Permalink
FBP-73. Initial work to support community edition
Browse files Browse the repository at this point in the history
  • Loading branch information
valb3r committed Jul 22, 2023
1 parent 0172499 commit 75e57b7
Show file tree
Hide file tree
Showing 12 changed files with 89 additions and 81 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<idea-plugin>
<!-- Actions -->
<actions>
<group id="BpmnActivitiAttachToDataSource"
text="Attach To Schema"
description="Attach to database schema to investigate process"
icon="/icons/icon.png"
popup="false">
<!-- The <action> element defines an action to register.
- "id" (required) specifies an unique identifier for the action.
- "class" (required) specifies the full-qualified name of the class implementing the action.
- "text" (required) specifies the text (tooltip for toolbar button or text for menu item).
- "use-shortcut-of" (optional) specifies the ID of the action whose keyboard shortcut this action uses.
- "description" (optional) specifies the text displayed in the status bar when the action is focused.
- "icon" (optional) specifies the icon displayed on the toolbar button or next to the menu item. -->
<action id="BpmnDiagram.AttachActivitiToDataSource"
class="com.valb3r.bpmn.intellij.activiti.plugin.actions.AttachActivitiBpmnDebuggerToDbAction"
text="Attach To Schema (Activiti)"
description="Attach to database schema (Activiti) for BPMN process debugging"
icon="/icons/icon.png">
</action>
<!-- The <add-to-group> node specifies that the action should be added to an existing group.
An action can be added to several groups.
- "group-id" (required) specifies the ID of the group to which the action is added. The group must be
implemented by an instance of the DefaultActionGroup class.
- "anchor" (required) specifies the position of the action in the group relative to other actions.
It can have the values "first", "last", "before" and "after".
- "relative-to-action" (required if the anchor is set to "before" and "after") specifies the action
before or after which the current action is inserted. -->
<add-to-group group-id="DatabaseViewPopupMenu" anchor="last"/>
<!-- The <separator> element defines a separator between actions. -->
<!-- <separator/> -->
<!-- <group id="AnotherNestedGroup"/> -->
<!-- The <reference> element allows to add an existing action to the group.
- "ref" (required) specifies the ID of the action to add. -->
<!-- <reference ref="EditorCopy"/> -->
</group>
<group id="BpmnActivitiDetachFromDataSource"
text="Detach Debugger"
description="Detach BPMN debugger from DataSource"
icon="/icons/icon.png"
popup="false">
<!-- The <action> element defines an action to register.
- "id" (required) specifies an unique identifier for the action.
- "class" (required) specifies the full-qualified name of the class implementing the action.
- "text" (required) specifies the text (tooltip for toolbar button or text for menu item).
- "use-shortcut-of" (optional) specifies the ID of the action whose keyboard shortcut this action uses.
- "description" (optional) specifies the text displayed in the status bar when the action is focused.
- "icon" (optional) specifies the icon displayed on the toolbar button or next to the menu item. -->
<action id="BpmnDiagram.BpmnDetachActivitiFromDataSource"
class="com.valb3r.bpmn.intellij.activiti.plugin.actions.DetachActivitiBpmnDebuggerFromDbAction"
text="Detach Debugger"
description="Detach BPMN debugger from DataSource (Activiti)"
icon="/icons/icon.png">
</action>
<!-- The <add-to-group> node specifies that the action should be added to an existing group.
An action can be added to several groups.
- "group-id" (required) specifies the ID of the group to which the action is added. The group must be
implemented by an instance of the DefaultActionGroup class.
- "anchor" (required) specifies the position of the action in the group relative to other actions.
It can have the values "first", "last", "before" and "after".
- "relative-to-action" (required if the anchor is set to "before" and "after") specifies the action
before or after which the current action is inserted. -->
<add-to-group group-id="DatabaseViewPopupMenu" anchor="last"/>
<!-- The <separator> element defines a separator between actions. -->
<!-- <separator/> -->
<!-- <group id="AnotherNestedGroup"/> -->
<!-- The <reference> element allows to add an existing action to the group.
- "ref" (required) specifies the ID of the action to add. -->
<!-- <reference ref="EditorCopy"/> -->
</group>
</actions>
</idea-plugin>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<idea-plugin>
<!-- Only SpEL here -->
</idea-plugin>
76 changes: 4 additions & 72 deletions activiti-intellij-plugin/src/main/resources/META-INF/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

<!-- Description of the plugin. -->
<description><![CDATA[
<p>The plugin to bring BPMN (Activiti) world closer to developer needs. It supports editing and visualizing Activiti 6.x and older
BPMN diagrams with navigation and process debugging support. Provides necessary glue to jump between code and BPMN diagram
<p>The plugin to bring BPMN (Activiti) world closer to developer needs. It supports editing and visualizing Activiti
BPMN diagrams with navigation and process debugging support. Provides necessary glue to jump between code and BPMN diagram
and bridges IntelliJ refactorings (changing bean names for example) to XML diagrams.</p>
<p><b>Please check <a href="https://github.com/valb3r/flowable-bpmn-intellij-plugin">plugin repository</a> for how-to videos</b> (yes it is correct URL)</p>
<p><strong>Key features</strong></p>
Expand Down Expand Up @@ -93,8 +93,8 @@

<!-- The unique identifiers of the plugins on which this plugin depends. -->
<depends>com.intellij.modules.lang</depends>
<depends>com.intellij.modules.java</depends>
<depends>com.intellij.database</depends>
<depends optional="true" config-file="activiti-bpmn-visualizer-with-java.xml">com.intellij.modules.java</depends>
<depends optional="true" config-file="activiti-bpmn-visualizer-with-db.xml">com.intellij.database</depends>

<!-- Optional dependency on another plugin. If the plugin with the "com.MySecondPlugin" ID is installed,
the contents of mysecondplugin.xml (the format of this file conforms to the format of plugin.xml)
Expand Down Expand Up @@ -202,74 +202,6 @@
- "ref" (required) specifies the ID of the action to add. -->
<!-- <reference ref="EditorCopy"/> -->
</group>
<group id="BpmnActivitiAttachToDataSource"
text="Attach To Schema"
description="Attach to database schema to investigate process"
icon="/icons/icon.png"
popup="false">
<!-- The <action> element defines an action to register.
- "id" (required) specifies an unique identifier for the action.
- "class" (required) specifies the full-qualified name of the class implementing the action.
- "text" (required) specifies the text (tooltip for toolbar button or text for menu item).
- "use-shortcut-of" (optional) specifies the ID of the action whose keyboard shortcut this action uses.
- "description" (optional) specifies the text displayed in the status bar when the action is focused.
- "icon" (optional) specifies the icon displayed on the toolbar button or next to the menu item. -->
<action id="BpmnDiagram.AttachActivitiToDataSource"
class="com.valb3r.bpmn.intellij.activiti.plugin.actions.AttachActivitiBpmnDebuggerToDbAction"
text="Attach To Schema (Activiti)"
description="Attach to database schema (Activiti) for BPMN process debugging"
icon="/icons/icon.png">
</action>
<!-- The <add-to-group> node specifies that the action should be added to an existing group.
An action can be added to several groups.
- "group-id" (required) specifies the ID of the group to which the action is added. The group must be
implemented by an instance of the DefaultActionGroup class.
- "anchor" (required) specifies the position of the action in the group relative to other actions.
It can have the values "first", "last", "before" and "after".
- "relative-to-action" (required if the anchor is set to "before" and "after") specifies the action
before or after which the current action is inserted. -->
<add-to-group group-id="DatabaseViewPopupMenu" anchor="last"/>
<!-- The <separator> element defines a separator between actions. -->
<!-- <separator/> -->
<!-- <group id="AnotherNestedGroup"/> -->
<!-- The <reference> element allows to add an existing action to the group.
- "ref" (required) specifies the ID of the action to add. -->
<!-- <reference ref="EditorCopy"/> -->
</group>
<group id="BpmnActivitiDetachFromDataSource"
text="Detach Debugger"
description="Detach BPMN debugger from DataSource"
icon="/icons/icon.png"
popup="false">
<!-- The <action> element defines an action to register.
- "id" (required) specifies an unique identifier for the action.
- "class" (required) specifies the full-qualified name of the class implementing the action.
- "text" (required) specifies the text (tooltip for toolbar button or text for menu item).
- "use-shortcut-of" (optional) specifies the ID of the action whose keyboard shortcut this action uses.
- "description" (optional) specifies the text displayed in the status bar when the action is focused.
- "icon" (optional) specifies the icon displayed on the toolbar button or next to the menu item. -->
<action id="BpmnDiagram.BpmnDetachActivitiFromDataSource"
class="com.valb3r.bpmn.intellij.activiti.plugin.actions.DetachActivitiBpmnDebuggerFromDbAction"
text="Detach Debugger"
description="Detach BPMN debugger from DataSource (Activiti)"
icon="/icons/icon.png">
</action>
<!-- The <add-to-group> node specifies that the action should be added to an existing group.
An action can be added to several groups.
- "group-id" (required) specifies the ID of the group to which the action is added. The group must be
implemented by an instance of the DefaultActionGroup class.
- "anchor" (required) specifies the position of the action in the group relative to other actions.
It can have the values "first", "last", "before" and "after".
- "relative-to-action" (required if the anchor is set to "before" and "after") specifies the action
before or after which the current action is inserted. -->
<add-to-group group-id="DatabaseViewPopupMenu" anchor="last"/>
<!-- The <separator> element defines a separator between actions. -->
<!-- <separator/> -->
<!-- <group id="AnotherNestedGroup"/> -->
<!-- The <reference> element allows to add an existing action to the group.
- "ref" (required) specifies the ID of the action to add. -->
<!-- <reference ref="EditorCopy"/> -->
</group>
</actions>

<!-- Extension points defined by the plugin. Extension points are registered by a plugin so that other plugins
Expand Down
1 change: 0 additions & 1 deletion bpmn-intellij-plugin-common-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ dependencies {

intellij {
version = intellijPlatform
plugins = intellijPlatformPlugins
}

patchPluginXml.enabled = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import com.intellij.psi.PsiElement
import com.intellij.psi.PsiFile
import com.intellij.psi.PsiLanguageInjectionHost
import com.intellij.psi.PsiLiteralExpression
import org.jetbrains.uast.UastFacade.language
import java.util.*

private val currentFile = Collections.synchronizedMap(WeakHashMap<Project, PsiFile>())
Expand Down Expand Up @@ -47,8 +48,9 @@ abstract class DefaultDelegateExpressionUiInjector: MultiHostInjector {

private fun injectSpel(context: PsiLanguageInjectionHost, registrar: MultiHostRegistrar) {
val text = context.text
val beanName = Language.getRegisteredLanguages().first { it.id == "SpEL" }!!
registrar.startInjecting(beanName)
val language = Language.getRegisteredLanguages().firstOrNull { it.id == "SpEL" } ?:
Language.getRegisteredLanguages().firstOrNull { it.id == "JAVA" } ?: return
registrar.startInjecting(language)
registrar.addPlace("", "", context, TextRange(3, text.length - 2))
registrar.doneInjecting()
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.valb3r.bpmn.intellij.plugin.core.properties

import com.intellij.database.util.toFixString
import com.intellij.openapi.project.Project
import com.valb3r.bpmn.intellij.plugin.bpmn.api.PropertyTable
import com.valb3r.bpmn.intellij.plugin.bpmn.api.bpmn.BpmnElementId
Expand Down Expand Up @@ -204,7 +203,7 @@ class PropertiesVisualizer(

private fun computePropertyKey(entry: Pair<PropertyType, Property>): String {
return entry.first.group?.mapIndexed { index, type ->
type.name + entry.second.index?.getOrElse(index) {""} + entry.first.positionInGroup.toFixString(4)
type.name + entry.second.index?.getOrElse(index) {""} + entry.first.positionInGroup.toString().padStart(4, '0')
}?.joinToString() ?: ""
}

Expand Down
Empty file.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@

<!-- The unique identifiers of the plugins on which this plugin depends. -->
<depends>com.intellij.modules.lang</depends>
<depends>com.intellij.modules.java</depends>
<depends>com.intellij.database</depends>
<depends optional="true" config-file="camunda-bpmn-visualizer-with-java.xml">com.intellij.modules.java</depends>
<depends optional="true" config-file="camunda-bpmn-visualizer-with-db.xml">com.intellij.database</depends>

<!-- Optional dependency on another plugin. If the plugin with the "com.MySecondPlugin" ID is installed,
the contents of mysecondplugin.xml (the format of this file conforms to the format of plugin.xml)
Expand Down
Empty file.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@

<!-- The unique identifiers of the plugins on which this plugin depends. -->
<depends>com.intellij.modules.lang</depends>
<depends>com.intellij.modules.java</depends>
<depends>com.intellij.database</depends>
<depends optional="true" config-file="flowable-bpmn-visualizer-with-java.xml">com.intellij.modules.java</depends>
<depends optional="true" config-file="flowable-bpmn-visualizer-with-db.xml">com.intellij.database</depends>

<!-- Optional dependency on another plugin. If the plugin with the "com.MySecondPlugin" ID is installed,
the contents of mysecondplugin.xml (the format of this file conforms to the format of plugin.xml)
Expand Down

0 comments on commit 75e57b7

Please sign in to comment.