Editing the declaration tree

The LavaPE declaration view is associated with three specific toolbars, the "tree operations bar", the actual "declarations bar", and the "details bar"..

The tree operations toolbar

Tree operations toolbar

provides the following operations (from left to right), which partly apply to a single tree node, partly to the sub-tree starting at the current selection, partly to the entire declaration tree:

The declarations toolbar

Declarations toolbar

provides the following operations (from left to right):

The details toolbar

Details toolbar

provides the following operations (from left to right):

Basics of declaration tree editing

Context-sensitive help

Use the context-sensitive help of LavaPE to get information about individual menu items and operator and keyword tool buttons: Click the context help tool button context help, drag it to the respective Lava tool button or menu item for which you want to get an explanation and drop it there.

How to insert/delete/edit Lava entities

The declaration tree consists of two alternating kinds of layers: 1. declaration layers containing the actual entity declarations, and 2. category layers that serve for the distinction between several kinds of nested, subordinate declarations for some entities, for instance virtual types, nested declarations, features, execs/invariants, or input/output parameters of functions or initiators.

If you select any tree node of the Lava declaration view then the enabled tool buttons on the declaration toolbar indicate which declarations may be inserted after the selected declaration node or below the selected category node by clicking these buttons. If you click the scissors scissors then the selected declaration is deleted (together with the entire sub-tree that may beginning at this node) and copied to the clipboard. If you press the DEL key instead of clicking the scissors scissors then the declaration is deleted but not written to the clipboard.

If you double-click the text to the right of an entity icon then the property sheet of the entity is opened for editing. Alternatively you can select the declaration node and then click the spectacles spectaclesto open the property sheet.

How to insert/delete optional parts

You can click the "Show empty optionals" tool button {short description of image} on a declaration node to toggle the visibility of its empty category nodes (having no subordinate nodes). The same can be achieved for an entire sub-tree by using the "Show/hide all empty optionals" buttons show all optionals instead.

How to insert, edit and step through comments

The yellow balloon {short description of image} may be clicked to add or change a comment that is associated with the currently selected tree node of the declaration view. The icon of a commented tree node has a little yellow bubble on the right side, for instance commented node. The two buttons Comments may be used to open/close the comments window and to step from comment to comment in forward or backward direction. If the comments window is open and you click a commented tree node then the associated comment will be shown in the comments window.

Error navigation

The two buttons Errors may be used to open/close the error window and to step from error to error in forward or backward direction. The icon of an erroneous tree node has a little red rectangle on the right side, for instance Error node.

Cut/copy/paste and drag/drop

Cut/copy/paste work in the usual way, using the clipboard of MS Windows. Proper enabling/disabling of the corresponding buttons Cut/Copy/Paste combined with subsequent checks that are performed anyway after each edit operation prevent inadmissible operations.

Drag-and-drop is also available in the declaration view. For instance you can rearrange the declarations of a package, the items of an enumeration type, or the features of an class or implementation simply by drag-and-drop. To shift an item to the first position on its respective tree layer you can drag-and-drop it to the parent node. The Shift key can be used in the usual way to select a sequence of contiguous items.

Note that "cut" deletes a Lava entity and a subsequent "paste" creates a new one in any case, having a new internal ID, whereas the "move" mode of drag-and-drop (press the Shift key while dragging!) retains the identity of the moved Lava entity.

If you drag and drop between different Lava files then all existing references to the moved Lava entity are updated accordingly, provided they are contained in a file that is open at that moment in the Lava declaration editor.

For drag-and-drop the default operation is move. Press Ctrl after starting the drag operation to enforce a copy. You can also select multiple items (using the Ctrl key) before starting the drag operation. In this case don't release the left mouse button after the last selection but rather start dragging immediately. The pressed or released state of the Ctrl button (which means copy or move, respectively) matters only at the moment of the drop operation.

Undo/Redo

Use the "Undo" and "Redo" buttons Undo/Redo to undo or redo individual edit operations in any of the LavaPE views step by step.

Drag-and-drop operations between different Lava files modify these files in a single edit step. Up to Lava release 0.6.3 undo/redo had to be applied to each of these files separately. Release 0.6.4 has introduced synchronized undo/redo support for such operations: You have to apply undo/redo only to one of these files to undo/redo the edit step also in the other file. But note that you can undo/redo edit steps only in strictly reverse order. So if you have applied further edit steps to one or both of these files then you have to undo/redo these before you can undo/redo the drag-and-drop operation between the files, or else you have to resort to manual "forward" repair steps.

Go to declaration / return to reference

If the declaration of a Lava entity references another Lava entity then you can double-click the icon left of the actual declaration to jump to the referenced entity's declaration. Alternatively you can select the respective declaration node and click the "Go to declaration" button go to declaration. If the selected declaration references more than one other entity then a small combo box is popped up from which you can select where to go.

Use the "Return to reference" button return to reference to follow the sequence of such "Go to declaration" operations in backward direction (= back to the locations from where you came). Both operations may jump forth and back between exec and declaration views and even between different ("included") Lava documents.

See also override view.