You use this editor to see and modify the generated code
of a Source Code instance. This editor complements the functions of
the standard code editor.
To see the code through this editor, you must have generated
a Source Code instance. Then, in the Design Explorer view,
right-click the corresponding generated file and select .
Modifying the generated code
You
can modify the generated code to adapt it to your particular needs.
You can
insert code lines easily by calling Static Micropatterns from the Snippets view, RPP
SDK Micropattern Snippets category. You can also call
micropatterns that were created with the application programming interface.
It is strongly recommended not to modify the code that is generated
by a micropattern. Warnings in the margin indicate where the insertion
of specific code can disrupt the reconciliation. Such is the case
if you override a line that is generated by a micropattern and add
a micropattern call in the specific code that is generated by a micropattern.
The
PDP editor includes many
functions. For example, you can cut, copy, paste, filter the lines,
debug, compare, and display the content assist by pressing the Ctrl
and space keys.
Limit: The Undo and Redo functions
of the editor are no longer available after a generation. The pile
of changes to undo and redo is emptied after each generation. The
changes that are made before a generation cannot be undone with the Undo function.
To delete changes (including the generation) made before the generation,
you can exit the editor without saving or use the Revert
File function.
The
PDP COBOL editor indicates
a modified state with an asterisk (*) in the editor tab when the generated
file is directly modified. To discard the changes, right-click and
select
Revert File.
Note: In the design editors,
you can modify the designs that are involved in the generation. In
this case, the
PDP COBOL
editor does not display a modified state. It only indicates the desynchronization
between the design and the generated code with the

icon. If you close the design editors without saving, then
close the
PDP COBOL
editor and open it again, the desynchronized state is no longer indicated.
You must be aware that if an instance is opened in several editors
simultaneously, the modifications are held as long as you have not
closed the last of these editors and saved.
Desynchronization between the design and
the generated code
When the design of the generated instance
is modified, the generated code is no longer synchronized. In this
case, the icon

is displayed, followed by a special character,
in the title of the PDP editor tab. The default special character
is
> but you can change it by selecting .
These signals alert you that a new generation is needed. You can regenerate
all the desynchronized files in the
Generation Manager view.
Note: The
desynchronization is also indicated in the
Design view
of the instance. The color of the generation button changes (

) to inform you that
Generate
is recommended due to modifications in the design. When
the generation is complete, the synchronization is restored and the
button returns to its initial appearance.
Specific display of the PDP Source Code editor
The PDP coloring, on top of
the standard editor coloring, identifies the origin of the lines.
By default, the generated code lines are gray and the micropattern
lines are blue.
You can change these PDP default colors by selecting .
Two symbols that are
related to Rational® Programming
Patterns can be displayed in the margin:
-
is displayed if code lines were deleted
or overwritten. If you place your mouse over this symbol, you can
see the deleted line or the line that was overwritten by the current
line.
is displayed in the following cases:
You can change the display in the PDP editor with filters from the Generated Code Structure view.