Code Editor
The code editor allows the user to update opaque/user code directly in the model using autocompletion and snytax highlighting.
Please consider that the current implementation only support syntax highlighting but no syntax check.
Info
Due to implementation issues the Code Editor is currently only available for the Enterprise Architect version.
Supported Elements
Any model element containing opaque/user code.
Uml Element | Model Property used | Remarks |
---|---|---|
Operation | Code or Behavior | Depending on the Model Settings User Code storage field setting |
State actions (do, entry and exit) | Code or Behavior | Depending on the Model Settings User Code storage field setting |
Opaque Action | Name/Effect | Code changes will be read and written to Effect. The element name will only be used as fallback value. |
ValueSpecification Action | Name/Effect | Code changes will be read and written to Effect. The element name will only be used as fallback value. |
ReadVariable Action | Name/Effect | Code changes will be read and written to Effect. The element name will only be used as fallback value. |
WriteVariable Action | Name/Effect | Code changes will be read and written to Effect. The element name will only be used as fallback value. |
Control Flow | Guard | |
Transition | Guard and Effect | Both fields are shown and can be changed |
How to use
Embedded Engineer will automatically start the Code Editor window when Enterprise Architect is starting.
The Always Show Code Editor
feature can be checked or unchecked in the addin menu of Embedded Engineer.
Setting it will automatically bring the Code Editor "to front" if an element containing code was selected in the Enterprise Architect.
Info
We recommend to dock the addin window, since it will get updated as soon as you change the selected element in the model.
Auto completion
The Code Editor is equipped with auto completion/intellisense and will update everytime it is used. To give you access to the model elements, attributes and operations.
The autocompletion is triggered automatically when writing the keywords:
this.
this->
me.
me->
- or when pressing
Ctrl
+Space
Info
Please consider, during use, to use the me
/this
keyword for attributes and the appropriate class name prefix for functions.
Examples
These examples show the code editor during usage in Enterpirse Architect on serveral elements
Selected from the Project Browser
Selected in a diagram
Selected in a diagram
Selected in a diagram
Selected in the Project Browser with autocompletion active
Class Operation selected in the Project Browser after unsaved changes
Info
Check the PromptUser
setting in Code Editor Save Strategy