You can modify the code directly from the Preview tab of a class or an interface, it is a quick and easy way to apply modifications to your code and update the model.
If you want to modify the code, you have to select the Preview Editable check box from
. This option is applicable to the entire model. Any changes apply as soon as you leave the Preview tab, or you click the Apply button. Your changes are also displayed in the Output window located in the lower part of the main window.The code modified must contain a valid definition otherwise the changes are ignored. Your changes only apply to the current class or interface, therefore you are not allowed to:
You are allowed to create generalization and realization links provided their classifiers already exist in the model, if the classifiers do not exist, then creation is ignored.
In a model designed for PowerBuilder, this feature can be used to provide a global vision of the code of an object and its functions as this is not available in PowerBuilder. You can use the Preview tab to check where instance variables are used in the code. You can also modify the body of a function or create a new function from an existing function using copy/paste. However, it is still strongly recommended to be very careful when performing such actions.
You should avoid renaming attributes and operations because all attributes that are not generated, like description, annotation or extended attributes will be lost.