Creation and Management of Generated Content

Adding Generated Content to a Chapter

Generated content is always added at the current cursor position of the active chapter. When the cursor is placed, do the following

The generated content is now inserted in the chapter. Additionally, a new reference from the chapter to the artifact is displayed in the Project Explorer.

Identifiers such as Ecore class or attribute names can be added as generated content to the running text. Using the method from above would interrupt the writing flow too much, therefore DEFT provides an alternative, keyboard-only method to add identifiers. Press Alt+I to open a dialog with all available artifacts. Select the artifact which contains the desired identifier. Then a new dialog opens which lets you select the identifier. In both dialogs you can type the name of the identifier and use the arrow keys to navigate through the proposed autocomplete entries.

Deleting Generated Content

Generated content is deleted by just deleting its representation in the editor. After saving the reference in the Project Explorer is also deleted.

Editing Generated Content

The reconfiguration of already inserted generated content is not yet implemented. As a workaround delete the content and add it again.

Moving Generated Content

Generated content can only be moved within the same chapter. Select the generated content in the editor and move it to a new position with cut & paste. Be sure NOT to save the document between cutting and pasting or the internal reference will be lost, which means that the content cannot be updated automatically anymore. Pasting the generated content to another file will also delete the internal reference.

Updating Generated Content

Generated content (code listings, images, ...) is updated when the underlying artifacts (source code files, Ecore diagrams, ...) have been updated. Artifacts are updated in one of the following ways

Note: If the source file contains invalid content (i.e. it cannot be parsed) the update will not be performed.

When the artifact has been updated, the following can happen to the generated content

All generated content which has been changed or could not be computed (error) is listed in the Task View.

For changed content you are asked to check the content and accept the changes. Double clicking on a Check task sets the cursor to the affected generated content. Note that an explicit comparison with the previous version of the generated content (such as highlighting differences in a diff view) is not implemented in the current version of DEFT. If the new generated content looks like expected you must explicitly accept the change by double clicking the corresponding "Accept changes" task in the Task View. If you would like to change the generated content, you have to remove it and add it again (see Sect. Editing Generated Content).

Similarly, if content could not be generated after the update you must remove the error message from the chapter and, if necessary, insert the content again.