Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a new flag to pull attribute editors into edge labels #692

Merged
merged 5 commits into from
Nov 15, 2023

Conversation

HeikoBecker
Copy link
Collaborator

Previously, if a model node had an attribute annotation and is used as an edge in a diagram, the attribute editor would be added as an external box in the diagram (also see example node R1 in the repo):

image

In this picture, the annotation Component Annotation is floating around in the diagram. Auto-layouting also does not work.

This PR adds support for pulling these annotations into the edge labels:

image

The key difference is that in the new setting, the annotation is part of the edge label and thus also automatically layouted.

To apply this change, the PR adds a new flag pullAnnotations as a boolean query over the node and the editor context. The standard behavior from above is retained by leaving it at the default false value.

This work was done jointly with @slisson.

The functionality is hidden behind the new "pull annotations" property of
diagram editors. Only if the flag is true (default false) will the behavior
change.
Removes print statements
This makes it easier to customize the behavior of the flag
Copy link
Collaborator

@alexanderpann alexanderpann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Entry in changelog is there, editorContext and node are accessible in query function and the code works in the sandbox. Looks good to me.

@HeikoBecker HeikoBecker merged commit eb804c1 into maintenance/mps20213 Nov 15, 2023
1 check passed
@HeikoBecker HeikoBecker deleted the feature/pull_annotations_611 branch November 15, 2023 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants