Since Papyrus 1.1.0 (Eclipse Mars), Papyrus provides a new texutal editor to edit references to UML NamedElement. This editor works only for references which are not in containment. This editor has not been developed using XText. it use a custom string parser and the class NameResolutionHelper to find named elements from their name. This string editor works for all references multiplicities.
'
.
value and display ...
to prevent the user than it should type more text.
+ ...
to prevent the user than more values are available, opening the dialog'
'
.If you have 3 Classes in your model, named Class1
, Class2
and Clas,s3
.
typed text | completion proposal | explanation |
---|---|---|
empty string | we look for nothing, so we provide the value and ... to ask to the user to write more text |
|
Clas | 3 classes matches the string, is always proposed |
|
Class | 3 classes matches the string, is always proposed |
|
'Clas | the string starts with a quote and Clas,s3 contains a comma, so we propose Clas,s3 ; is always proposed |
|
Clas, | interpreted as a list of value, the first value is Clas , and we have no information for the second one, for the completion it is an empty string |
This editor has been added to the list of available editors for the property view.
CompletionStyledTextReferenceDialog
to edit single reference value
CompletionStyledTextMultiReference
to edit multi references values
MultiReference
editor, and we added it the text field for completion
Papyrus provide an integration of this editor for Papyrus NatTable. This is the same editor for single and multi references. It is a textfield, with a button displayed to its right. This button allows to the user to open the dialog to choose the reference too. It allows to the user to edit the cell as text or selected the new value directly in the model tree with the dialog
org.eclipse.papyrus.uml.nattable.manager.cell.editor.UMLReferenceTextWithCompletionCellEditor
org.eclipse.papyrus.uml.nattable.config.UMLSingleReferenceTextualCellEditorWithButtonConfiguration
org.eclipse.papyrus.uml.nattable.manager.cell.editor.UMLReferenceTextWithCompletionCellEditor