Skip to content

Conversation

amolenaar
Copy link
Member

@amolenaar amolenaar commented Feb 26, 2024

PR Type

What kind of change does this PR introduce?

  • Bug fix
  • Feature
  • Chore (refactoring, formatting, local variables, other cleanup)
  • Documentation content changes

What is the current behavior?

Only items selected in a diagram are shown in the Property Editor.

Issue Number: Fixes #2545

What is the new behavior?

When you select an element in the Model Browser, it will show in the Property Editor.

Property pages that contain both model and presentation settings (normally a Show Something setting) have been split in two pages.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

Still to do:

  • Attributes and Operations for Block, Requirement, etc.
  • Select Extension relation in model browser causes error
  • ActivityParameterNode also shows ObjectNode properties

@github-actions github-actions bot added the python Pull requests that update Python code label Feb 26, 2024
@amolenaar amolenaar changed the title Model browser property editor Element selected in Model Browser shows in Property Editor Feb 26, 2024
@amolenaar amolenaar requested a review from danyeaw February 26, 2024 16:19
@amolenaar amolenaar marked this pull request as draft February 27, 2024 23:00
@amolenaar amolenaar force-pushed the model-browser-property-editor branch 2 times, most recently from 6c42482 to 2f8e380 Compare February 29, 2024 11:36
@amolenaar amolenaar marked this pull request as ready for review February 29, 2024 12:35
@amolenaar amolenaar force-pushed the model-browser-property-editor branch from 2f8e380 to ec970f1 Compare February 29, 2024 13:08
@amolenaar
Copy link
Member Author

amolenaar commented Feb 29, 2024

@danyeaw By separating the model and presentation specific properties, I found out that some property editors are now applied to elements they were not applied to before.

E.g. ActivityParameterNode now also has Upper Bound and Ordering editors, since it inherits from ObjectNode.

image

Same goes for attributes and operations on any model element that inherits from Class (Block, Requirement).

We can explicitly blacklist those cases, but I'm not sure if we should. What do you think?

@danyeaw danyeaw added feature A new feature and removed python Pull requests that update Python code labels Mar 3, 2024
Copy link
Member

@danyeaw danyeaw left a comment

Choose a reason for hiding this comment

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

Hi @amolenaar, wow, this is a really nice feature to be able to show the property editor from the model browser!

One thing I noticed while testing this:

  1. Create a Class and a Block
  2. Select the Block in the Diagram -> Block Property Page is shown
  3. Select the Class in the Model Browser -> Class Property Page is shown
  4. Try to click on the Block in the Diagram again -> Class Property Page is still shown

@amolenaar
Copy link
Member Author

amolenaar commented Mar 3, 2024

Thanks for testing this. It's a bit tricky to orchestrate the events coming both from the model browser and diagram. I'll have a look into this.

The problem is that DiagramSelectionChanged events are emitted for every state change: selected, focused, but also hovered. Currently there's no way to know if the events originate from movement or from a mouse click.

@github-actions github-actions bot added the python Pull requests that update Python code label Mar 4, 2024
@amolenaar
Copy link
Member Author

@danyeaw I think I resolved the (re)selection issue. DiagramSelectionChanged events are now emited explicitly, and not based on changes in the diagram selection.

@amolenaar amolenaar force-pushed the model-browser-property-editor branch from c2f3c7d to 5a5d99f Compare March 4, 2024 10:45
Copy link
Member

@danyeaw danyeaw left a comment

Choose a reason for hiding this comment

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

Nice, this is working great now! 🤩

Make sure we only show editors for elements that
can actually show it.
So we can trigger the event when a user (re)selects an
already selected element on a diagram.

This is important, since reselecting does not work as expected
after an element has been selected in the model browser.
@amolenaar amolenaar force-pushed the model-browser-property-editor branch from 5a5d99f to 4cda17e Compare March 5, 2024 21:22
@amolenaar amolenaar merged commit bc04fdc into main Mar 5, 2024
@amolenaar amolenaar deleted the model-browser-property-editor branch March 5, 2024 21:48
@amolenaar amolenaar mentioned this pull request Mar 8, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature python Pull requests that update Python code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Open element property page for an element selected from the model explorer
2 participants