From efefe85bb75819bff218921d9f75a1592cff575f Mon Sep 17 00:00:00 2001 From: Tuukka Lehtonen Date: Wed, 11 Dec 2019 14:29:36 +0200 Subject: [PATCH] Added new UC SCL script phase: cleanup This is intended to support defining scripts that are ran just before the UC is removed from the solver. gitlab #431 Change-Id: I20c6024aa0ec61fbf79453df2fb81a3d79e4b83e --- .../ui/componentTypeEditor/ComponentTypeScriptEditor.java | 6 ++++-- .../simantics/modeling/ui/componentTypeEditor/Messages.java | 1 + .../modeling/ui/componentTypeEditor/messages.properties | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/ComponentTypeScriptEditor.java b/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/ComponentTypeScriptEditor.java index 026cd9c9f..6ee5ec77a 100644 --- a/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/ComponentTypeScriptEditor.java +++ b/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/ComponentTypeScriptEditor.java @@ -102,7 +102,8 @@ public class ComponentTypeScriptEditor extends SCLModuleEditor { "analogAutomation", //$NON-NLS-1$ "binaryAutomation", //$NON-NLS-1$ "preparation", //$NON-NLS-1$ - "post-preparation" //$NON-NLS-1$ + "post-preparation", //$NON-NLS-1$ + "cleanup", //$NON-NLS-1$ }; private static final String[] EXECUTION_PHASE_LABELS = new String[] { @@ -112,7 +113,8 @@ public class ComponentTypeScriptEditor extends SCLModuleEditor { Messages.ComponentTypeScriptEditor_ExecuteAnalogAutomation, Messages.ComponentTypeScriptEditor_ExecuteBinaryAutomation, Messages.ComponentTypeScriptEditor_ExecuteBeforePreparation, - Messages.ComponentTypeScriptEditor_ExecuteAfterPreparation + Messages.ComponentTypeScriptEditor_ExecuteAfterPreparation, + Messages.ComponentTypeScriptEditor_ExecuteBeforeRemoval, }; @Override diff --git a/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/Messages.java b/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/Messages.java index 78ebf9c11..50c06334d 100644 --- a/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/Messages.java +++ b/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/Messages.java @@ -12,6 +12,7 @@ public class Messages extends NLS { public static String ComponentTypeScriptEditor_ExecuteBinaryAutomation; public static String ComponentTypeScriptEditor_ExecuteBeforePreparation; public static String ComponentTypeScriptEditor_ExecuteAfterPreparation; + public static String ComponentTypeScriptEditor_ExecuteBeforeRemoval; public static String ComponentTypeViewer_OpenedInReadOnly; public static String ComponentTypeViewerData_ContainsInvalidCharacters; public static String ComponentTypeViewerData_CtrlEnterApplyChanges; diff --git a/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/messages.properties b/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/messages.properties index fa819c9b0..67c31ab2d 100644 --- a/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/messages.properties +++ b/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/componentTypeEditor/messages.properties @@ -6,6 +6,7 @@ ComponentTypeScriptEditor_ExecuteBeforeEachStep=Execute before each step ComponentTypeScriptEditor_ExecuteBinaryAutomation=Execute together with binary automation ComponentTypeScriptEditor_ExecuteBeforePreparation=Execute before solver preparation ComponentTypeScriptEditor_ExecuteAfterPreparation=Execute after solver preparation +ComponentTypeScriptEditor_ExecuteBeforeRemoval=Execute before component removal ComponentTypeViewer_OpenedInReadOnly=(Opened in read-only mode) ComponentTypeViewerData_ContainsInvalidCharacters=Property name ''{0}'' contains invalid characters, does not match pattern {1}. ComponentTypeViewerData_CtrlEnterApplyChanges=Ctrl+Enter to apply changes, ESC to cancel. -- 2.43.2