Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Papyrus/Papyrus User Guide/Table Documentation

< Papyrus‎ | Papyrus User Guide
Revision as of 05:06, 3 April 2014 by Vincent.lorenzo.cea.fr (Talk | contribs) (Paste From Spreadsheet in a Table)

Since Papyrus 0.10 (Eclipse Kepler), Papyrus provides a new version of the tabular editors. This version will replace the previous version in Eclipse Luna.

Existing Tables

  • UML Generic Table
  • SysML Allocation Table
  • SysML Requirement Table
  • Views Table


UML Generic Table

Elements Accepted : UML Element only (all of them)

Filling Way : User, by Drag&Drop from the Model Explorer

Possible Context : all UML Element.

Save : All rows displayed in the table are saved in the model

Element Creation : All UML Elements


SysML Allocation Table

Elements Accepted : SysML Allocation only

Filling Way : Automatic, by Synchronization on the context of the model. Only the Allocation directly owned by the context of the table are displayed.

Possible Context : UML Package, with the SysML Profile Allocations applied.

Save : The Rows are not serialized in the model, because they are derived of the UML Model.

Element Creation : SysML Allocation


SysML Requirement Table

Elements Accepted : SysML Requirement only

Filling Way : Automatic, by Synchronization on the context of the model. Only the Requirements directly owned by the context of the table are displayed.

Possible Context : UML Package, with the SysML Profile Requirement applied.

Save : The Rows are not serialized in the model, because they are derived of the UML Model.

Element Creation : SysML Requirement


Views Table

Elements Accepted : Papyrus Views (Table/Diagram/...) only

Filling Way : Automatic, by Synchronization on the context of the model.

Possible Context : All UML Elements

Save : The Rows are not serialized in the model, because they are derived of the notation Model.

None


Table Features

The table framework provides a large number of features. Here we will describe all existing features supported by the framework, but not necessarly by all the tables.

  1. Edit Cell Values
  2. Change Axis (Columns/Row) Order
  3. Invert Axis (Exchange Column And Row)
  4. Add Axis (Column/Row) Element by Drag&Drop from another view (ModelExplorer)
  5. Remove Column/Row
  6. Destroy Column/Row Element
  7. Rename Column/Row Header
  8. Choose the Displayed Columns/Rows
  9. Choose the Displayed Columns/Rows for Stereotype Property in the popup menu
  10. Paste Columns/Rows From External Spreadsheet
  11. Display Index Column/Row Header
  12. Display Label Column/Row Header
  13. Configure Index Header Style (A, B, C...Z, AA, AB, ... or 0,1,2,3)
  14. Configure Label Header Style : select the information to Display in the Header Label (Name, Multiplicity, Type, Icon, isDerived)
  15. Export table into the Excel Format
  16. Print table
  17. Sort Column/Row Axis by Alphabetic order
  18. Sort Rows selecting one or several column header
  19. Save and restore Table Axis Configuration
  20. Select All
  21. AutoResize axis


Edit Cell Values

Double Click on a cell or selecting a cell then pressing F2, excepted for derived features

Change Axis Order

Click on the axis to move and drop it to its new location.

Invert Axis

Select the action Invert Axis in the popup menu or change it into the Table Property View.

Add Axis (Column/Row) Element by Drag&Drop

Select your element and drop it into the table, in the column region or in the row region to add it.

Remove Column/Row

Select the header of the axis to remove then right click and select Remove Column/Row. The axis will be remove of the table, but the represented element will continue to be in the model.

Destroy Column/Row Element

Select the header of the axis element to destroy then right click and select Destroy Column/Row Element. The represented element will be destroyed and its axis will be removed from the table.

Rename Column/Row Header

This function can do 2 things according to the usecase :

  • Rename the element represented by the axis, when the element is owned by your model
  • Define an alias to the axis, when the element is not owned by your model (UML Feature for example)

Select the header of the axis element to rename then right click and select Rename Header.

Choose the Displayed Columns/Rows

Right click in the table (not in the header) and select Columns ->  Create/Destroy Columns. (the same thing for rows

Choose the Displayed Columns/Rows for Stereotype Property in the popup menu

Right click in the table (not in the header) and select Select Stereotype Properties Columns (or Rows)


Features/Tables, when the Axis are NOT inverted.


UML Generic Table
SysML Allocation Table
SysML Requirement Table
Views Table
Content synchronized on table context
No
Yes
Yes
Yes
Edit Cell Value
Yes
Change Axis Order
Add Column Axis By Drag & Drop No
Add Row Axis By Drag & Drop All UML Elements
No (Synchronized table)
Remove Column
Yes
Remove Row
Yes
Destroy Column Element
Yes
Yes
Yes

Destroy Row Element
Yes
Yes
Yes

Rename Column Header




Rename Row Header




Choose the Displayed Columns
Yes
Choose the Displayed Columns for Stereotype Property in the popup menu

Choose the Displayed Rows
No
No
No

Choose the Displayed Rows for Stereotype Property in the popup menu
No
Paste Column From Spreadsheet
No
No
No

Paste Row From Spreadsheet
Yes
Display Index Column/Row Header
Display Label Column/Row Header
Configure Index Header Style
Configure Label Header Style
Export to Excel
Print table
Sort Column Axis By Name
Sort Row Axis By Name




Save and restore Table Axis Configuration
Yes
Select All
AutoResize axis
Yes








Paste From Spreadsheet in a Table

  • Tables support the paste from Spreadsheet (Excel for example).
  • This feature is already configured for SysML Requirements Table and SysML Allocations Table.
  • For Generic Table, the user must configure the paste himself.
  • Stereotype application :
    • If your table displays columns representing stereotype's properties, the required stereotypes will be applied if there is a value to paste in the cell.
    • If you want force stereotype application on all pasted elements, you must use post-actions
  • Name Resolution
      • papyrus table tries to resolve the text pasted from the external spreadsheet. That is to say if the text is pasted in a column representing a boolean, text will be converted in boolean value, if the text is pasted in a column representing a UML NamedElement, we try to find this NamedElement in the exising model to set the value.
      • if the resolution of the pasted text failed, we create a CellProblem, to store the pasted value. This value is displayed in the table, underlined in red.
  • If the pasted spreadsheet as more columns than the current table, the too many columns will be ignored.
  • If the pasted spreadsheet as less columns than the current table there is no problem to do the paste.
  • In the mixed case, some rows have too many columns and others not enough, there is no problem to do the paste.


Steps to paste in a Generic Table :

We assume that the user wants to paste rows (and not columns).

  • Create a new Generic table
  • Select the columns to display in your table.
  • Select the table in the ModelExplorer View in order to display its Property View
  • In the Property View goes into the Paste Tab. 4 informations must be completed by the user :
    • Detached Mode (when true, paste is faster but it is possible than some initializations done by the Papyrus Service Edit will not be done):
      • if false, Paste action uses the service edit (initialize default values, apply stereotypes required by element id).
      • if true, stereotype required by the element id will be ignored (uses Post Action to apply stereotypes)
    • Pasted Element Id : define the pasted element: org.eclispe.papyrus.uml.Class will create a UML Class
      • org.eclipse.papyrus.sysml.Requirement will create a uml.Class stereotyped Requirement if detached mode==false
      • org.eclipse.papyrus.sysml.Requirement will create a uml.Class
    • ContainementFeature : the feature owning the pasted elements
    • Post Actions : a way to define actions done just after the element creation but before to paste the cell value. Post Actions are not available when Detached Mode is false; Existing Post Actions allows to apply stereotypes

Paste In Table Configuration Property View

Paste Example  : Pasting SysML Requirement in Generic table

The table shows the columns id and text only.

Containement Feature is packageableElement:PackageableElement.

  • Detached Mode is false (we use service edit)
    • Pasting Element Id = org.eclipse.papyrus.sysml.Requirement
      • Post Action: none
        • You get a Class stereotyped Requirement, named Requirement1, with wanted values in the cells text and id.
    • Pasting Element Id = org.eclipse.papyrus.uml.Class
      • Post Action: None
        • You get a Class named Class1, with wanted values in the cells text and id, required stereotype Requirement has been applied.

Post Actions are always ignored when Detached Mode is false


  • Detached Mode is true (we don't service edit)
    • Pasting Element Id = org.eclipse.papyrus.sysml.Requirement
      • Post Action: none
        • You get a Class named Class1, with no applied stereotyped (and N/A displayed in the cells text and id). org.eclipse.papyrus.sysml.Requirement can't be resolved, we use its super type : org.eclipse.papyrus.uml.Class. Required stereotype can't be applied.
    • Pasting Element Id = org.eclipse.papyrus.uml.Class
      • Post Action: none
        • You get a Class named Class1, with no applied stereotyped (and N/A displayed in the cells text and id), required stereotype can't be applied.
    • Pasting Element Id = org.eclipse.papyrus.uml.Class
      • Post Action: applyStereotype:/SysML::Requirements::Requirement
        • You get a Class stereotyped Requirement, named Requirement1, with wanted values in the cells text and id.

Import From Spreadsheet in a Table (CSV File)

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.

Table Property View

The Property View of the table is accessible selecting the table in the ModelExplorer.


Back to the top