Prev | Next |
Editing Source Code
Enterprise Architect contains a powerful source code editor that helps you to view, edit and maintain your source code directly inside the tool. Once source code has been generated for one or more Classes it can be viewed in this flexible editing environment. Seeing the code in the context of the UML models from which it is derived brings clarity to both the code and the models, and bridges the gap between design and implementation that has historically introduced errors into software systems.
The Source Code Editor is fully-featured, with a structure tree for easy navigation of attributes, properties and methods. Line numbers can be displayed and syntax highlight options can be configured. Many of the features that software engineers are familiar with in their favorite IDE, such as Intelli-sense and code completion are included in the editor. There are many additional features, such as macro recording that makes it easy to manage the source code inside Enterprise Architect. There are also many options for managing the code, available through the code editor context menu, toolbar and function keys.
For most programming languages a single file is created from a UML Class, but in the case of C++ both header and implementation classes are created and the source code editor displays these files in separate tabs.
A number of options change the way the source code editor works; they can be altered using the 'Preferences' dialog available from the Start ribbon:
'Start > View > Preferences > Source Code Engineering > Code Editors'
There are four variants of the Source Code Editor, with different access methods. The variants are discussed in the Compare Editors topic.
Access
Ribbon |
Code > Source Code > Edit > Open Source File or Code > Source Code > Edit > Edit Element Source or Code > Source Code > Edit > Edit New Source File |
Keyboard Shortcuts |
(for external files) |
Facilities
Facility |
Description |
See also |
---|---|---|
Source Code editor |
By default the Source Code editor is set to:
If you are editing an XML file, the structure tree is presented in a folder hierarchy rather than a Class structure hierarchy:
|
|
Structure Tree |
The structure tree is available for supported language files, such as C++, C#, Java, XML files such as XSD, XSL |
Notes
Learn more