Community
Participate
Working Groups
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.
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)
> 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.
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.