Skip to end of metadata
Go to start of metadata

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 sytax check.

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.

Model ElementModel Property usedRemarks
OperationCode or BehaviorDepending on the Model Settings ▶ User Code storage field setting
State actions (do, entry and exit)Code or BehaviorDepending on the Model Settings ▶ User Code storage field setting
Atomic/Opaque ActionName/EffectCode changes will be read and written to Effect. The element name will only be used as fallback value.
ValueSpecification ActionName/EffectCode changes will be read and written to Effect. The element name will only be used as fallback value.
ReadVariable Action Name/EffectCode changes will be read and written to Effect. The element name will only be used as fallback value.
WriteVariable ActionName/EffectCode changes will be read and written to Effect. The element name will only be used as fallback value.
Control FlowGuard


TransitionGuard and EffectBoth fields are shown and can be changed

How to use

To start/enable the code editor use the Code Editor... menu entry in the addin and make sure the addin windows are shown in Enterprise Architect.

We recommend to dock the addin window, since it will get updated as soon as you change the selected element in the model.

The autocompletion will be triggered automatically when writing the keywords:

  • this.
  • this->
  • me.
  • me->

or by pressing Ctrl+Space.

Autocompletion will be updated everytime used and will give you access to the model elements attributes and operations.

Please consider during use to use the me/this keyword for attributes and the appropriate class name prefix for functions.

Example

This example shows the code editor during usage in Enterpirse Architect on serveral selected elements:

Element without code

in Project Browser

Atomic/Opaque Action

in Diagram

State Entry Action

in Diagram


State Transition

in Diagram

Class Operation

in Project Browser

with autocompletion active

Class Operation

in Project Browser

after unsave changes

(with Code Editor Save Strategy set to PromptUser)









  • No labels