Bug 318606 - [ClassDiagram][Properties View] No simple way to add parameters or comments to an operation
Summary: [ClassDiagram][Properties View] No simple way to add parameters or comments t...
Status: NEW
Alias: None
Product: Papyrus
Classification: Modeling
Component: Core (show other bugs)
Version: 0.7.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-01 10:26 EDT by Cedric Dumoulin CLA
Modified: 2017-09-08 09:45 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Cedric Dumoulin CLA 2010-07-01 10:26:16 EDT
There is no simple way to add parameters to an operation:
- in a class diagram, typing the name and then the parameters did not work
- in the property view, there is no way to see or add parameters
- in the model explorer, it is possible, but boring (too much levels of creation)

The same problem arise to add a comment to an operation.
We need a more simple way to be able to add parameters or comment to an operation.
Comment 1 Remi Schnekenburger CLA 2010-07-01 10:33:08 EDT
For the editing of an operation using direct edit functionnality:
- it is not really possible to do a correct text edition of operations with parameters: either you delete all parameters each time you edit the operation, either you try to do some reconciling (not so easy).
For example, editing from: op(param1: String, param2 : String) to op(param2 : String, param1 : String), you don't know if you have to move parameters in the ordered list of parameters or if you have to delete them and create new ones, resulting in loss of stereotype application, links, etc).
So the direct edition can be hard to implement.

For the property view:
Functionnality is coming, I only have to use the creation service for the [+] button on top of the table

for the model explorer, yes you can!

For the comments, a specific tab has been developed, but relies on a component which is specific either to linux/gtk, either windows systems. So, this would break the portable aspect of Papyrus tool.
Comment 2 Cedric Dumoulin CLA 2010-07-01 10:43:14 EDT
When I say 'add', I mean 'create' :-) :

When you create an operation for the first time, you expect to write its name and its parameters: 'myOp(name : String) : int'. And you can expect that the tool parse what you have written and create the parameters, found the type if they exist (or do content assist), ... 
All of this with no need to go to another view to create each parameter one by one :-(.
Comment 3 Remi Schnekenburger CLA 2010-07-01 12:43:01 EDT
(In reply to comment #2)
> When I say 'add', I mean 'create' :-) :
> 
> When you create an operation for the first time, you expect to write its name
> and its parameters: 'myOp(name : String) : int'. And you can expect that the
> tool parse what you have written and create the parameters, found the type if
> they exist (or do content assist), ... 
> All of this with no need to go to another view to create each parameter one by
> one :-(.

I do agree with you, this is not very nice to switch to another view in this case :-) Unfortunately, it is very hard to dissociate the creation of the element and the simple edition of the element with the direct edit framework.

This would be possible to implement an editor for the operation, as existing for property or port, but I am afraid that lots of bugs could derive from this editor, as editing an already existing operation. 

Arnaud is integrating XText into papyrus for direct editors, you can find already an example for UML Properties in the svn. A simple grammar could be implemented for UML Operation, with the behavior you expect.
Comment 4 Camille Letavernier CLA 2011-07-01 10:10:55 EDT
With the new property view framework, it is possible to add parameters from the property view.

However, there is no direct edition facility, for the reasons explained earlier.

So, it will probably stay that way for a while, unless we find a good and simple enough solution for implementing that.