Prev Next

Source Code Panel

The 'Source Code' panel brings together a number of facilities for working with source code. Here you can import existing source code files into your model, creating new model elements that represent the classes in those files. You can select a Class in your model, then click a button to open the code editor window and automatically load the source code file associated with that Class. Facilities for editing Code Generation Templates and Language Grammars are also accessed from this panel, as are the commands to generate source code from the model and synchronize the model from the source code.

Part of the Code ribbon in Sparx Systems Enterprise Architect.

Available Facilities

Facility

Description

See also

Synchronize

Click on this icon to display options to synchronize the currently selected model elements with their associated source code files, or to synchronize the whole Package containing the selected elements.

Update Package Contents Synchronize Model and Code

Generate

Click on this icon to display options to generate source code for:

  • The currently selected model element(s), or
  • A single element, with options, or
  • All elements in the current context

Source code is generated into the file that is associated with each individual element. Code is generated only for elements that are of type Class or Interface.

Generate a Package Generate a Group of Classes Generate a Single Class

Edit

This icon provides a collection of tools for viewing and editing source code files associated with elements in the current model. Also provided are tools that generate source code for a particular element or synchronize an element to reflect changes in its associated source code file.

  • Open Source File - display a 'File Chooser' dialog to browse for a source code file to open in the code editor window
  • Search in Files - display the 'Find in Files window, to locate files of a selected type containing a specified code string
  • Edit Element Source - open the code editor window and load the source code file associated with the currently selected element
  • Browse Element Source - open a docked source code window and load the source code file associated with the currently selected element, for browsing through
  • Edit New Source File - create and populate a new source code file
  • Open in External Editor - launch the configured External Editor and load the source code file associated with the currently selected element
Editing Source Code Search in Files

Merge

This option is enabled when there is a user-defined Merge command defined in the currently active Analyzer script. Select it to execute the command and perform the defined operation.

Merge Script

Learn more