Since Papyrus 0.10 (Eclipse Kepler), Papyrus provides a new version of the tabular editors. This version replaces the previous version in Eclipse Luna.
Since Papyrus 1.1.0 (Eclipse Mars), Papyrus provides hierarchical table too.
A table can be divided in several areas
Papyrus provides tabular editors to allow to the user to edit their models with a new way as well than the Diagram editors and the Property View. So, in the table, the user can create/destroy model's element and edit their features.
Papyrus provides to main kinds of tabular editors :
Moreover the contents (most often the rows) of the table, can be synchronized on the context of the table.
This action will create a new row, if the dropped element is allowed by the table implementation.
The contents of the tree table is always synchronized, excepted for the first level (depth=0), which can be synchronized of filled by the user by Drag and Drop from the ModelExplorer, as for normal table. The Tree Table provides a way to choose :
The table framework provides a large number of features. Here we will describe all existing features supported by the framework, but not necessarily by all the tables. The main part of the features supported by flat tables are supported by tree table too. Moreover Tree table provides some specific features
Paste From Spreadsheet in a Table
This table lists all feature available for Tabular editors provided by Papyrus (the 17th of December 2014). This list could be considered as representative of tables capabilities assuming 3 points:
UML
Generic Table |
SysML Allocation Table | SysML Requirement Table | Views Table | UML
Class Tree Table |
|
---|---|---|---|---|---|
Invert Axis (exchange Rows And Columns) | Yes | No | |||
Content synchronized on table context | No, filled by DnD | Yes | Yes | Yes | No in provided configuration
Yes for depth=0, if the user changed the provided configuration |
Edit Cell Values (excepted if cell read-only) | Yes (F2, or Double click on a cell) | ||||
Sort Row Axis clicking on column header | Yes (ALT-Click on column header, or MAJ-ALT-Click to sort on several columns) | ||||
Change Columns Order | Yes | ||||
Change Rows Order | No (not yet implemented) | ||||
Add Column Axis By Drag And Drop | No (Not yet implemented) | ||||
Add Row Axis By Drag And Drop | Yes (all UML Elements) | No (synchronized table) | No in provided configuration,
but possible (only classes for depth=0), if the user changed the configuration |
||
Remove Column Axis | Yes | ||||
Remove Row Axis | Yes | No (synchronized table) | No in default configuration, Yes (only classes for depth=0),
if the user changed the configuration |
||
Destroy Column Element | Yes | ||||
Destroy Row Element | Yes | No, (too dangerous to remove an editor) | Yes | ||
Rename column header | Yes, but we create a column alias, features are not editable | ||||
Resize Axis | Yes | ||||
Rename row header | Yes, we change the name of the represented element (if it has a feature called "name") | Yes, UML Named Element are renamed, and an alias if created for categories | |||
Choose the Displayed Columns (Dialog) | Yes | ||||
Choose the Displayed Columns for Stereotype Property in the popup menu | Yes | No (not a UML Table) | Yes | ||
Choose the Displayed Rows (Dialog) | No | Partially Yes, thanks to the Wizard to choose the listen categories | |||
Choose the Displayed Rows for Stereotype Property in the popup menu | No (no sense in provided tables) | ||||
Paste Column From Spreadsheet | No (not yet implemented) | ||||
Export to Excel (in fact html) | Yes | ||||
Paste Row From Spreadsheet | Yes | No | Yes | ||
Display Index Column/Row Header | Yes | ||||
Display Label Column/Row Header | Yes | ||||
Configure Index Header Style | Yes | ||||
Configure Label Header Style | Yes | ||||
Print table | Yes | ||||
Sort Column Axis By Name | Yes | ||||
Sort Row Axis By Name | Yes | No (not yet implemented) | |||
Save and Restore Several Columns Axis Configuration | Yes (but, this feature has not really been tested) | ||||
Save and Restore Several Columns Axis Configuration | No | ||||
Select All | Yes (CTRL + A or clicking on the corner) | ||||
AutoResize Row/Column axis | Yes (with an action in the popup menu of the header) | ||||
Merge Selected Body Cells
(cells must displayed the same values) |
Not supported (and probably will never been supported) | ||||
Merged All Body Cells for a Column
(cells must contains the same values) |
Yes (action provided by a poopup menu of the body) | ||||
Merged All Body Cells for a Row
(cells must contains the same values) |
Yes (action provided by a poopup menu of the body) | ||||
Merge Column./Row Header Cells
(cells must contains the same values) |
No (not yet implemented) | ||||
Merge All Body Cells for Rows AND Columns | No (not yet supported), you only can merge on rows OR in columns, but not on rows and on columns inside the same table | ||||
Collapse/Expand | No | Yes | |||
Choose the categories (features) to fill the table | No
(it is not a synchronized table) |
No, but it could be interesting to allow it | No | Yes | |
Hide categories | No | Yes | |||
Filter Rows | Yes | ||||
Unset cell value | Yes | No | Yes | ||
Display Validation Marker in Row and Column Label Header | Yes | ||||
Display Validation Marker in Row and Column Label Header | Yes | ||||
The feature of the tree table are mostly the same than for the flat table.
This action open a Wizard Dialog, when you can choose add/remove depth and edit the categories (features) to listen for each depth.
We assume that the user wants to paste rows (and not columns).
true
), paste is faster but actions done by service edit will be ignored.
false
, Paste action uses the service edit (initialize default values, apply stereotypes required by element id).true
, stereotype required by the element id will be ignored.false
The mecanism used for import in the same than for the Paste, so previous rules are always available.
In the popup menu of the table, you will find a menu called "Import From File". This menu allows to import a CSV file, managing the columns separators and the text delimiter.
The Property View of the table is accessible selecting the table in the ModelExplorer.
Since Eclipse Mars, Papyrus Table provides a Filter Row in the Column Header. This row can be shown or hidden.
To Show/Hide the filter row, do a right click in the body of the table, then choose Select the Column Menu, then Display Row Filter.
Now, the filter row is visible.
num:
(see below) in the string editor, all values which are not numerical values will be hiddenBy default, Papyrus provides 2 kinds of editors for filters:
Filter String or references: Papyrus provides several keyword to define how to filter the rows. By default, we check than the text displayed in the cells of the column contains the string typed in the filter editor. Some options are available:
contains:
: it is the default behavior, you should not have to add this keyword before the type your text.num:
: This mode will allow you to use comparison operators : <
, >
, <=
, >=
, =
and <>
for not equals.=
: This mode allow you to find only the cell with this valueregex:
: This mode allow you to type a regex. The result will be all rows where we found a substring matching the regexregex_m:
: This mode allow you to type a regex. The result will be all rows where the regex match the full labelstart:
: This mode allow you to find all rows where the label displayed for the filter column start by your stringRegex
Starting with this initial state:
regex:.C
will give you this result: all strings owning a C in upper case, preceded by one other character have been found
and regex_m:.C
will give you this result: all string owning only 2 characters, where the second one in a C in upper case have been found
Numeric
For the column representing a numeric type, the string editor is already configured, so don't need (and you can't!) to prefix your search with num:
As illustrated below this feature is enabled when the <I>Link With Editor</I> button is activated :
This link the active diagram, in the multi editor view, with the model explorer view. This link works bidirectionally.
As shown below, more than one element can be selected in one view and their counterparts, if present in the other, will be automatically selected as well.
<I>It is to be noted that, when changing pages, the selection for each of them remain in memory and handled by setInput in tabbedPropertySheetPage</I>
The default behavior of the tables, and their representation, is to list the appropriate elements as rows with each property indicated by a column as illustrated below.
The axis of the table can also be inverted and the elements represented as columns with their properties as rows :
Both those selections are achieved either by clicking on the element in the model explorer or the element's row or Column tag in the table.
Wether the axis of the table is inverted or not, the user can select elements represented as cells inside a row or column of the table and see its counterpart selected as well.
It is important to remember that the cell selection is a one way behavior, from cell to model explorer, as the table cannot know what the user wants to select, row or cell, based on a selection in the model explorer.<br/ >
A behavior worthy of notice is that elements represented as cells, for example elements owned, if selected in conjunction with a row or a column, in the event of an inverted axis, produces a mixed selection of all the elements in the model explorer.
As a reminder, selections initiated by the model explorer will only result in column or row selections as the table has no means of knowing what type of selection is required by the user.
It is important to note that the changes below are coming into eclipse Mars as they are dependant on a modification of the model.
NamedStyles are used to introduce those changes and intValues ares used to mark the resizing of table elements.
Below is the default model used for the table used to demonstrate the changes when styles are written and/or applied in a table.
Sliding the header's cell frontier will result in the creation of a <I> localHeaderAxisConfiguration </I> and to it will be add the new values of the header's width and/or height. Both sets of headers can have stored values for heoght and width as the table can be inverted and if so the row and the column headers will be too.
Below is the state of the model during the first change: resizing the row headers' index and label.
In this case the local header created is the RowHeader but if the column headers are changed the model gets a ColumnHeader as illustrated by the image below.
The values carried by the localHeaders only affect the headerLayer of the table and therefore the height or width of the Axis (columns and/or rows) will not be affected by them. For those to change, new values will be carried by the Axis themselves as can be seen in the following image. Of course, the method used to change the values is the same sliding of the frontier used when resizing the headers.
In this example one row and two columns were changed and they all bear the corresponding value in their Axis element.
For this type of change the NamedStyles used are booleanValues, indicating if the Axis are to be merged or not.
The behavior has been copied from the previous one and the booleans will be caried by the Axis, in case of a user selecting the axis to be merged, or the localHeaders if the user chooses to merge all the rows or columns of the table in one go.
To initiate the merge, the user has access to a merge menu and chooses between the four types of merge the one best suited to the task (as illustrated below). The programm then proceeds to merge the cells of same value inside the selection.
As mentionned above, in case of a merge of a selected axis, the boolean will be caried by the Axis element in the model.
The other choices will then be greyed-out and a toggle will be displayed on the selected option to notify the user that this is (or these are) the axis merge.
If the user selects a cell or an axis that has not been part of the previously merged selection, the toggle will not be displayed but the option will still be visible as the other will still be greyed-out.
It is important to note that, if the user so chooses, the merge option can be reapplied to the new selection and the merge span will consist of the newly selected axis. A cautionary note however as only full rows or columns will be merged.
The user can merge all the rows in the table and the result will look like this.
Once the cells are merged, the user might want to edit them. This edition can be problematic as the merge only takes into account the values of the cells and not their types when applying the merge option. This is shown in the example below asa classifier can be an activity but not the other way around.
The first image illustrates the model and the profile's stereotype, applied on both classes, containing the three attributes activity and classifiers.
When the user clicks on the left most part of the merged area, under the activity label, the editing tool only shows activity1 as a possible choice. But if the user selects the right side, under the classifier label, then the choices are many. In this example the choice is to apply the interface type to the merged cells and handle the editing behavior as illustrated by the three next images.
The tool will then automatically detect the possibility, or impossibility, of the edition and split the merge accordingly.
Please note that the merge selection will not be changed and the selected axis will still carry their merge booleans as other values might still be equal and therefore the user might still want those merged.
The fill action is available in tables and can be used by clicking on the right bottom corner and drop until release.
This action is available for 2 types:
It is possible to copy the initial value.
[none|frame|Fill Copy Number
When the initial selection before the fill is a single cell, it is possible to increment or decrement values from the initial value by adding or removing 1 to the initial value.
[none|frame|Fill Increment Number when one selected cell
When two cells are selected before filling the selection, it is possible to increment or decrement values from the initial value by adding or removing the initial values difference.
[none|frame|Fill Increment Number when two selected cells
As number fill action, it is possible to copy the initial value.
[none|frame|Fill Copy String
When an integer is available at the beginning or at the ending of the value, it is possible to increment or decrement integer prefix or suffix values depending of the integer position.
[none|frame|Fill Increment prefix String
[none|frame|Fill Increment suffix String
The filled integer values are calculated by the same way than the fill numbers.
Several kind of cell editors are available in Papyrus Table. Currently, the user can't choose himself the cell editor to use for a cell/row/column.
Several kind of cell editors are available:
but not the other way around.
The first image illustrates the model and the profile's stereotype, applied on both classes, containing the three attributes activity and classifiers.
When the user clicks on the left most part of the merged area, under the activity label, the editing tool only shows activity1 as a possible choice. But if the user selects the right side, under the classifier label, then the choices are many. In this example the choice is to apply the interface type to the merged cells and handle the editing behavior as illustrated by the three next images.
The tool will then automatically detect the possibility, or impossibility, of the edition and split the merge accordingly.
Please note that the merge selection will not be changed and the selected axis will still carry their merge booleans as other values might still be equal and therefore the user might still want those merged.
The paste and the insert work differently (create new objects or update existing ones) depending on the selection in the table as following:
Paste ( 1 ) | Insert ( 2 ) | |
---|---|---|
No selection ( A ) | Create | Create |
Cells ( B ) | Update | X |
Rows Header ( C ) | Update | Create |
Columns Header ( D ) | Update | X |
Actions:
In details:
Selection | Paste | Action |
---|---|---|
Y | Y | Values in the selection must be updated. |
Y | Y | The values pasted must be updated for all selected rows (by repeat of the pasted row values). |
|X, Y] | Y | An error message will be displayed. |
Y | Z | An error message will be displayed. |
Selection | Paste | Action |
---|---|---|
Y | Y | Values in the selection must be updated. |
Y | 1 | The values pasted must be updated for all selected columns (by repeat of the pasted column values). |
|X, Y] | Y | An error message will be displayed. |
Y | Z | An error message will be displayed. |
In some cases (A1, A2 and C2), the existence of the pasted or inserted objects must be checked. This is done by comparison between pasted object axis identifier and the existing axis identifier values. To define this axis identifier, just select the column (available in the table) from the paste configuration:
Here, you will find the possible warning messages at the end of the paste/insert (if no modification is applied during the paste/insert and a warning message was caught, the warning message must be displayed as error):
Two types of error can be displayed while the paste/insert:
Here, you will find the possible paste configuration error messages at the end of the paste/insert:
Here, you will find the possible error messages at the end of the paste/insert:
The paste with rows header in the clipboard must respect the number of columns in the target table. The hierarchy of the rows header must be respected, i.e. when the categories are hidden or shown.
When the categories are hidden, the number of defined categories by depth must be equals to 1 if you want to paste.
N.B: The undo/redo is not implemented for this paste.
Get the following current table:
And this copied text:
The objects are created with the correct values:
Get the following current table:
With this following categories configuration:
And this copied text:
The objects are created with the correct values:
This paste or insert allows to replace, add or skip the existing objects and allows to create the non-existing objects. The 'Replace' action allows to update the values of the existing object, the 'Skip' action does nothing on it and the 'Add' action allows to create an object on the same depth of the existing one. The created objects must be at the end of the table.
For the TreeTable, some specifications exist:
Get the following current table:
And this copied text:
Depending on the previous specifications explained, the result is the following:
Depending on the selection and to the clipboard, differents actions are possible:
Get the following current table and selection:
And this copied text:
The result of the paste is selected and is this following:
Get the following current table and selection:
And this copied text:
The result of the paste is selected and is this following:
Get the following current table and selection:
And this copied text:
The result of the paste is selected and is this following:
This paste allows to update the selected existing rows when the rows header height selected is equals to the height of rows in the clipboard.
Get the following current table and selection:
And this copied text:
The result of the paste is selected and is like following (the first class is not modified because it does not exist):
This paste or insert allows to replace, add, skip the existing objects and allows to create the non-existing objects. The 'Replace' action allows to update the values of the existing object, the 'Skip' action does nothing on it and the 'Add' action allows to create an object on the same depth of the existing one. The created objects must be inserted before the selection.
For the TreeTable, some specifications exist (in addition of specifications of the paste/insert without selection ( A1 and A2):
Get the following current table and selection:
And this copied text:
The result is the following:
Get the following current table and selection:
And this copied text:
The result is the following:
Depending on the selection and to the clipboard, different actions are possible:
Get the following current table and selection:
And this copied text:
The result is the following:
Get the following current table and selection:
And this copied text:
The result is the following:
Get the following current table and selection:
And this copied text:
The result is the following:
The import from file (CSV) works like paste with rows header when the rows header are available in the CSV.
If the rows header are not available, the rows works like insert without selection or insert with rows header selection depending to the selection.