Refreshing diagram nodes based on preference change [message #1854641] |
Wed, 31 August 2022 16:13  |
Eclipse User |
|
|
|
Hey there,
We currently have a number of semantic diagrams, in these diagrams we have our own custom node figures and edit parts.
For each of these we have made our own preferences that let the user decide if they want to show decorators and also what the number format for certain fields on the nodes should be.
What we want to be able to do is when the user applies the preferences the diagrams get refreshed and the decorators get updated and the number fields get re formatted. The former works fine, however trying to get the number fields to refresh is proving tricky.
What we attempted to do was calling the DialectManager.INSTANCE.refresh for the diagrams that we want to update after the preferences, this triggers fine, however because the nodes are using custom figures and nothing has changed in the model, there are never any notifications sent to trigger a visual refresh.
Are we doing something incorrectly here ? I was considering adding listeners on each of the custom figures for the preference store but I would rather do that as a last resort.
Cheers
Jonathan
|
|
|
|
|
|
Re: Refreshing diagram nodes based on preference change [message #1854945 is a reply to message #1854834] |
Mon, 19 September 2022 19:53  |
Eclipse User |
|
|
|
Hi Steve,
So I went back through the code, we have a style configuration that extends SimpleStyleConfiguration using the "org.eclipse.sirius.diagram.styleConfigurationProvider" extension point. We have an edit part that extends AbstractNotSelectableShapeNodeEditPart, a policy provider that implements IEditPolicyProvider. And then our figures are based on the draw2d Shape class and hooked into the relevant EditPart. As far as I can see all of them are hooked up fine but when I refresh using the method it hits none of the methods on any of them.
Edit: Is there a debug path or anything I can check to see if it's just not hitting the right things on our end ? For example when I run the refresh, what should be getting hit on the edit parts ?
Cheers
Jonathan
[Updated on: Mon, 19 September 2022 19:56] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.04036 seconds