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/Mars Work Description/Improvments/Multiplicity Editor

< Papyrus‎ | Mars Work Description
Revision as of 04:03, 15 April 2015 by Celine.Janssens.all4tec.net (Talk | contribs) (Multiplicity Editor)

Multiplicity Editor

Description

The multiplicity editor contains two modes of edition:

  • The simple mode which allows to edit the lower and the upper values from a unique editor
  • The advanced mode which allows to edit the lower and the upper values from two editors of ValueSpecification.

Usage

Simple mode

The simple mode is represented as the following:

SimpleMode.png

This editor must be filled by the following pattern:

Value filled Lower value Upper value
1 null (default value is 1) null (default value is 1)
x..y LiteralInteger with value x LiteralUnlimitedNatural with value y
x..* LiteralInteger with value x LiteralUnlimitedNatural with value -1 (interpreted as *)
x LiteralInteger with value x LiteralUnlimitedNatural with value x

The values set as lower and upper are always positive (except the * for the upper which is valued as -1).

This editor is usable only when the lower ValueSpecification is a LiteralInteger or null and when the upper ValueSpecification is a LiteralUnlimitedNatural or null. On the other hand, this editor will be displayed like the following:

SimpleModeDisabled.png

Advanced mode

Simple ValueSpecification editor

The advanced mode with simple ValueSpecificatiton editors is represented as the following:

AdvancedMode.png

The lower and the upper ValueSpecification can be created/edited/deleted by the buttons:

ButtonsEdit.png

XText ValueSpecification editor

The advanced mode with XText ValueSpecification editors is represented as the following:

AdvancedModeXText.png

This editor use the XText ValueSpecification editors (explain here) with some specificities depending on lower or upper value edition.

The specificity of the lower ValueSpecification edition is when the value filled is an integer, this one will be handled as LiteralInteger instead of LiteralUnlimitedNatural or LiteralInteger (the * value will create an OpaqueExpression).

The specificity of the upper ValueSpecification edition is when the value filled is an integer or *:

  • if the integer is positive or -1, a LiteralUnlimitedNatural will be created
  • if the integer is negative, an OpaqueExpression will be created instead of LiteralInteger

Switch modes

This is possible to switch between the two modes by two ways:

  • The button in the multiplicity editor:

ButtonSwitch.png

  • The multiplicity editor preferences in the property views preferences:

PreferencesMultiplicityEditor.png

Regarless of the way used to switch modes, the mode used is saved in the preferences and will be used for each multiplicity in Papyrus.

Back to the top