Table of Contents

  1. Edit elements in a table
  2. View elements in a table
  3. Drag & Drop
    1. Create new elements
  4. Remove elements from the table
  5. Delete elements from the model
  6. Editing
    1. Editing unary attributes
    2. Editing n-ary attributes
    3. Editing unary references
    4. Editing n-ary references
  7. Undo/Redo
  8. Copy to clipboard
  9. Sort The Columns In The Table
  10. Customizations
    1. Load Customizations
    2. Edit Customization
  11. Serialization of Table
    1. How to save a table
    2. What is serialized in the .table file ?
    3. How to open a saved table
  12. Add a Query Column
  13. Add Facets to the table
  14. Select Columns to Show/Hide
  15. Preferences
  16. Select a query to restrict allowed contents
  17. Known Problems

Edit elements in a table

You can open the table by selecting model elements in a model editor (such as the MoDisco model browser), right-clicking and choosing Edit in a table editor :

View elements in a table

You can open the table by selecting model elements in a model editor (such as the MoDisco model browser), right-clicking and choosing Show in a new table view :

Drag & Drop

You can drag elements from any model editor and drop them on an open table to add them to this table.

You can also drop a model element onto a reference to set a unary reference, or add the element to the list for a n-ary reference :

Create new elements

If the table was opened with a configuration that allows this (for example, you can create instances of Dependency in a "table of dependencies"), you can add a model element by clicking on the "plus" icon :

If the table configuration allows creating several types of elements, you can choose which one you want to create in the drop down menu:

Remove elements from the table

You can remove elements from the table by selecting them, right-clicking and choosing Remove Lines.
This only removes the elements from the view, not the model.

Delete elements from the model

You can delete elements from the model by selecting the elements in the Label column, right-clicking and selecting Delete Elements from Model:

Editing

To edit an attribute or reference, double-click on its cell in the table, or select the cell and hit F2.
The cell should then go in edit mode (if the value is editable):

To commit the value, hit Enter. To cancel the edit, hit Escape.

Editing unary attributes

You can edit all the standard Ecore data types: EString, EChar, EFloat, EFloatObject, ECharacterObject, EBoolean, EBooleanObject, EDouble, EDoubleObject, EInt, EIntegerObject, ELong, ELongObject, EBigInteger, EBigDecimal, EByte, EByteObject, EShort, EShortObject.

If the value you entered is not valid for this type, the contents become highlighted in red, and you can't commit the value:

Editing n-ary attributes

When you enter edit mode for a n-ary attribute (one which accepts a list of values instead of just a single value), a dialog opens to let you edit the values:

You can add, remove, and move elements in the list by using the buttons.

Editing unary references

For unary references, you can select a value in several ways:

For composite references, you will be asked for confirmation because changing a composite reference means deleting the previous value (if any) from the model, and moving the new value from its previous parent.

Editing n-ary references

When you edit a n-ary reference, this dialog opens:

Undo/Redo

You can undo/redo modifications done on the model by using the undo/redo actions in the editor in which the model is opened.

Copy to clipboard

Select cells and use the copy action (either through the context menu or the Edit menu) to copy the contents of the cells as text to the clipboard. You can then paste it in any program, such as Text or SpreadSheet editor.

Sort The Columns In The Table

There is 2 way to sort the columns :

Customizations

Load Customizations

Click on the Load Customizations button, and in the dialog that opens, move the customizations you want to use to the right column:

The table use a local customization file to store the columns visibility. This file cannot be unloaded by the user, but it is visible in the dialog in grayed mode.

Edit Customization

See the documentation for the MoDisco browser customizations.

The features that are customizable for the table are:

Serialization of Table

How to save a table

It is possible to serialize your tables in order to keep your preferences saved. To do so, you can use the usual "File" menu to prompt the "Save As" window, or the key binding "CTRL + s". If the table has not already been serialized, the "Save As" window will pop up too.

What is serialized in the .table file ?

The .table file is a xmi one, which contains : - references to the objects contained in the table - the list of the columns with a boolean hidden or not - the options you have checked ("Hide empty columns", "Only show commons columns" ... ) - the size of the columns as well as the height of the rows - the list of loaded customization - the list of referenced facets - an optional reference to a tableConfiguration

How to open a saved table

To open a saved table in order to edit it, you need to use the editor.You can use the contextual menu and choose "Model table" as a viewer, or simply double click on the .table file.

If you want to use the Table View to only visualize your saved table, you need to open an empty view :

And open your file with the "Open saved table" button :

Add a Query Column

It is possible to add a column representing the result of a query on every table's elements. The "Add query column" menu is accessible in the table contextual menu :

A new column is added for each query, and the result is updated if the model changes.

Once a query Column has been added to the table, you can easily delete it using the usual contextual menu, and pressing "delete".

Add Facets to the table

It is possible to add some EMF Facets to the table. A first menu button is placed in the main toolbar, another one in the contextual menu.

If the applied facets contained FacetAttribute or FacetReference, some new columns will be added to the table to represent their results.

You can also provide the facet with a "SetQuery", which will enable you to edit the content of the facet. In this example, we can edit the content of the facet "Is Abstract" the same way we could edit any other cell:

Facets applied on a table will automatically be applied again when the .table file is opened.

Select Columns to Show/Hide

The EMF Facet table comes with a SelectionDialog to choose whether to show/hide columns. To do so, just open the selection dialog with the menu button in the main toolbar :

Then choose which columns you want to show/hide. You can also sort the column's name by alphabetical order. Storage of the hidden columns is done using local customization file. We recommend to set the local file at the top of the customization stack. The following dialog can appear when the local file is not the first :

Preferences

The action Select Columns To Show/Hide can display a warning message with a question. This dialog provides a CheckBox in order not to be displayed each time. The NatTable Editor Preference Page allows to reset the display of the message and to change your answer.

Select a query to restrict allowed contents

You can choose a query which determines which elements are allowed to be in the table. Any query that accepts an EObject and returns a boolean is usable for this purpose.

To set the query, click on "Change Allowed Contents" in the toolbar:

This opens a dialog from which you can select the query :

If some of the elements that were already in the table before you changed the query don't match the new query, then you will be asked whether you want to remove these non-presentable elements:

Once the query is changed, you won't be able to add elements that are not matched by this query.

Known Problems

Copyright © 2010, 2011 CEA LIST. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Nicolas Bros (Mia-Software) ; Nicolas Guyomar (Mia-Software) ; Vincent Lorenzo (CEA-LIST)