Tree Editors

This document explains how to use Sirius tree editors/modelers which allow to view and manipulate data in a hierarchical way.

  1. Tree Editors
    1. Introduction
    2. Creating, Renaming and Deleting Trees
    3. Refreshing Trees
    4. Adding and Removing Tree Items
    5. Editing Tree Items
    6. Tree Items Drag and Drop

Introduction

Sirius provides support for hierarchical representations called trees, which represent information in a hierarchical way.

Note that as always with Sirius, some of the features described below may or may not be available with all specific tree editors. Some tree editors are configured to only display information but do not allow edition for example. It all depends on which features the person who specified (configured) the tree decided to support.

Creating, Renaming and Deleting Trees

Trees are managed in the same way as the other kinds or representations supported by Sirius (diagrams, tables...). They are created either through the New Representation context menu on a semantic element, or through the Create Representation action on the context menu of a Modeling Project. Newly created trees are automatically opened. To open an existing tree, simply double-click on it in the Model Explorer: it will appear both inside the representation file ( aird file) and under the semantic element it represents inside the semantic model.

You can rename, duplicate or delete a tree by choosing the corresponding action (resp. Rename, Copy or Delete) in the context menu on the tree element in the Model Explorer.

Refreshing Trees

Depending on the value of the Automatic refresh Sirius preference (accessible through Window / Preferences... / Sirius), the contents of opened trees may or may not be automatically updated when the underlying semantic model changes. In manual refresh mode (when Automatic refresh is unchecked), you can explicitly request a refresh of the whole tree by using the Refresh button in the main Eclipse toolbar, as shown below:

Adding and Removing Tree Items

If the tree’s configuration has defined tools to create new element (tree items), they will appear in the context menu of existing tree items. The name of the creation tools is not fixed; it depend on the tree’s configuration, so it will be different for each tree modeler. Note that you must have a tree element selected for the creation tools to appear in the context menu, and the behavior of the tool may depend on the selected element.

If the tree is completely empty and you have no element to select, you can still create elements (if supported by the tree’s configuration) by using the drop-down menus in the main Eclipse toolbar (see screenshot).

Editing Tree Items

There are several ways to activate the edition of a tree item:

Once the edit mode is enabled, simply enter your text and hit Return to validate. The expected format of the edit string and its interpretation depends on how the tree’s configuration has been set up to interpret the text you enter.

Tree Items Drag and Drop

Drag and drop is a feature which can be enabled by the specifier in the tree configuration. It is turned off by default.

Simply select the Tree Items you would like to drag, and drop them inside an other Tree Item. Most of the time, this will result in the dropped element being added to the new location, but the exact effect of the operation is entirely dependent on how the tree was configured by its specifier.

Notice that it may also possible to drag elements from other Eclipse views. Again, this depends on how the tree was configured.