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

#694: Add Layoutable interface #175

Merged
merged 1 commit into from
Jul 14, 2022
Merged

#694: Add Layoutable interface #175

merged 1 commit into from
Jul 14, 2022

Conversation

CamilleLetavernier
Copy link
Member

@CamilleLetavernier CamilleLetavernier commented Jul 6, 2022

  • Update the Graph model for consistency with the Sprotty API
  • GShapeElement is a GLayoutable and can have layoutOptions

refs eclipse-glsp/glsp#694

Contributed on behalf of STMicroelectronics.

@CamilleLetavernier
Copy link
Member Author

Layout Options on children will be useful to configure child-specific layout options (Rather than only be able to configure the parent layout itself). This change also makes the Graph model more consistent with the Sprotty API (Which accepts layout options on SShapeElement)

@CamilleLetavernier
Copy link
Member Author

Test model:

issue_610.zip

This model can't be open on the current master, because one Label has a layoutOptions property. It will cause a syntax exception:

2022-07-06 14:09:16,208208000 [DefaultActionDispatcher 3] ERROR DefaultGLSPServer - [ERROR] Could not process message:ActionMessage [action=requestModel, clientId=workflow-diagram:file:///home/camille/Git/glsp-theia-integration/examples/workspace/issue_610.wf]
com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected NAME but was BEGIN_OBJECT at path $[0].layoutOptions

It can be open with this PR.

Note: layout might be off, as I'm still working on the client layout for eclipse-glsp/glsp#694. The goal of this PR is to make it possible to open/parse the model.

Copy link
Contributor

@ndoschek ndoschek left a comment

Choose a reason for hiding this comment

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

Thanks Camille, the changes look great and work excellent! 🎉
I have a minor comment inline regarding the year range in the copyrightText of the genModel.

- Update the Graph model for consistency with the Sprotty API
- GShapeElement is a GLayoutable and can have layoutOptions

refs eclipse-glsp/glsp#694

Contributed on behalf of STMicroelectronics.

Signed-off-by: Camille Letavernier <cletavernier@eclipsesource.com>
@CamilleLetavernier
Copy link
Member Author

Thanks for the review! I've updated the Genmodel and regenerated the files. I also rebased on master.

Copy link
Contributor

@ndoschek ndoschek left a comment

Choose a reason for hiding this comment

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

Great, thank you Camille for the update! 👍

@ndoschek ndoschek merged commit b76ec30 into master Jul 14, 2022
@ndoschek ndoschek deleted the issues/694-layout branch July 14, 2022 06:35
@ndoschek ndoschek mentioned this pull request Jul 14, 2022
ndoschek added a commit that referenced this pull request Jul 14, 2022
cf. #175
Contributed on behalf of STMicroelectronics.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants