blob: e87a9de3c5abd8d4c55779d479456ba981e0afb9 [file] [log] [blame]
= Textual Editor for UML Class =
You need to install the Papyrus '''Papyrus Look And Feel''' to use this function.
== Overview ==
The textual editor for UML classes allows you to add, modify or remove visible properties and operations of a class displayed in a diagram. As shown in the following figure on the Librarian class example, a large number of characteristics of properties, operations and parameters of the class Librarian can be edited: their name, visibility, type, multiplicity and the characteristics of the value set for multi-valued elements.
[[File:images/overview.png|frame|none|Textual edition of the class Librarian]]
== How it works ==
The class editor is triggered or opened by simultaneously pressing the Shift and Enter keys after selecting a (single) class.
A frame with the editor in it appears to the right of the class.
You can then write new properties or operations (or modify/delete old ones), and to validate this new definition of your class, you just have to press Shift and Enter again at the same time. If you do not want to validate anything and cancel the edition, just press ESC.
== Autocomplete ==
At any time, you can press simultaneously Ctrl and Enter to have propositions (autocomplete). Of course, proposition for the name of property or operation won't be useful but for types or modifiers, it will be.
[[File:images/autocomplete.png|frame|none|Autocomplete for the type of a property]]
== What can you edit? ==
=== The "names" ===
It is important to know that for class names, properties, operations or parameters you can use quotation marks in order to have names containing spaces, as you can see with the "return a free" method in the Librarian example.
=== The class name ===
The first (non-empty) line should start with the keyword class followed by the name of your class.
It must not have anything else.
=== The properties ===
[[File:images/propertyPattern.png|frame|none|Pattern for the property definition]]
A property must at least have a '''name'''. In other words, a line with only one "word" will correspond to a property with this "word" as its name.
You can indicate its '''visibility''' by prefixing the name with +, -, # or ~ (for public, private, package or protected respectively).
Just after the visibility character, you can also indicate if it is a '''derived''' property with the / character.
For the other definition elements, put a ''':''' after the property name.
The '''type of the property''' is defined after the :. You have at your disposal the basic types defined in the imported package named '''primitive types''': boolean, string, integer and real. Are added the classes, data types and enumerations defined in your model.
The last definition elements are the '''modifiers''' and are indicated between { }.
The available modifiers are :
* readOnly: is this a read-only property?
* id: is it an identification property?
* Union: is it a union derived from subsets?
* Ordered | unordered: is the list of possible values ordered?
* Unique | nonunique: is each value in the list of possible values unique?
* Seq or sequence: the list of possible values is ordered and the values are unique
The following figure shows the autocomplete for property modifiers.
[[File:images/propertyModifiers.png|frame|none|Autocomplete for the modifiers of a property]]
=== The operations ===
[[File:images/operationParameterPattern.png|frame|none|Pattern for the definition of an operation and its parameter]]
A line becomes the definition of an operation if there are ( and ).
For example "op" is the definition of the property ''''op''''. "Op ( )" is the definition of the operation ''''op'''' which has no parameter.
Like a property, you can indicate its '''visibility''' by prefixing the name with +, -, # or ~ (for public, private, package or protected respectively).
For the definition of the '''returnValue''', as indicated on the Pattern figure, you can specify its type, its multiplicity and some modifiers mainly related to the case of a list of returned values. For the meaning of possible modifiers, see the property definition.
For each '''parameter''' (separated by a coma), you can specify its name, its type, its multiplicity and, like for the returnValue, modifiers for list of values.
You can also indicate the '''direction''' of a parameter: in, out, inout. The default value is ''in'' which is the classic direction (i.e by value). ''Out'' means "by reference".
The only mandatory element in the parameter definition is its name.