Bug 399855

Summary: [Comments] Papyrus shall enable to reference model elements within free-text of comments.
Product: [Modeling] Papyrus Reporter: Camille Letavernier <cletavernier>
Component: CoreAssignee: Camille Letavernier <cletavernier>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: lars.gelin, papyrus-bugs, patrik
Version: 0.10.0Keywords: plan
Target Milestone: M6Flags: rschnekenburger: kepler+
Hardware: All   
OS: All   
Whiteboard: Documentation

Description Camille Letavernier CLA 2013-02-04 07:53:01 EST
Papyrus shall enable to insert references to Model Elements within comments. The displayed text of the comment (Or Label for non-named elements, such as other comments) must be automatically computed to match the Model Element's name/label change.
Comment 1 Camille Letavernier CLA 2013-05-02 12:06:03 EDT
r11033: initial contribution

This commit implements the runtime of the name resolution tools. The EObject is referenced via its URI (javadoc-style links: {@link uri#fragment}), and it replaced with its display String when displayed (i.e. the URI of the EObject is replaced with the Label of the EObject).

In the specific case of Comments, the Edit Part replaces the raw String with the display String.

r11034:

Use the Display String in the LabelProvider service (Instead of Raw string). The comments are now properly displayed e.g. in the ModelExplorer and Properties view.

Todo:

- Add support for editing such links (Currently they have to be typed in manually because we don't have a Richtext editor yet - See Bug 399853). A partial support for references should be implemented independently of the Richtext editor (It should be reused in the Richtext editor when it is available)
Comment 2 Camille Letavernier CLA 2013-05-06 10:43:50 EDT
> A partial support for references should be implemented independently of the Richtext editor

r11084:

Added a "Browse reference" button to the comment body editor. This is used to insert new references to NamedElements in the current comment.
This button will be reused in the RichText editor when it is available.
Comment 3 Patrik Nandorf CLA 2013-06-10 07:19:09 EDT
I think it would be good if the name of the referenced object also is shown in the body of the comment. 

Currently the body might look like:
"This is a test {@link #_92RbAMkdEeK8WY5J53naHw}" which might be find if there is only one reference but if there are several a display of the name of the object would ease the readability of the comment, e.g.:
"This is a test {@link <NAME> #_92RbAMkdEeK8WY5J53naHw}" where name is the object name.


(In reply to comment #2)
> > A partial support for references should be implemented independently of the Richtext editor
> 
> r11084:
> 
> Added a "Browse reference" button to the comment body editor. This is used
> to insert new references to NamedElements in the current comment.
> This button will be reused in the RichText editor when it is available.