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

General refactoring and cleanup #16

Merged
merged 1 commit into from
Apr 26, 2022
Merged

General refactoring and cleanup #16

merged 1 commit into from
Apr 26, 2022

Conversation

tortmayr
Copy link
Contributor

  • Ensure consistent usage of ModelState
    Previously the default implementations used and inconsistent mix of injecting GModelState (the custom model state for the direct Gmodel lib)
    and ModelState (the default class). This introduced and indirect dependency to the GModelDiagramModule. Since the GModelState actually did only contain generally reusable code it has been removed and merged with ModelState. All default implementations now consistently inject the ModelState.

  • Move all services (action & operations handlers etc.) that contain implementation specific code for the direct gmodel usecase (graphical model === source model) into a dedicated gmodel-lib subdirectory.

  • Extract a reusable AbstractJsonModelStorage base implementation from the GModelStorage that can be reused for any model storage
    that loads JSON models from files.

  • Introduce a generic abstract base implementation for CreateNodeOperationHandlers.

  • Ensure that the OperationHandler correctly sets the reason when dispatching a new SetDirtyStateAction

  • Fix issue in ChangeBoundsOperationHandler. Only set the prefWidth, prefHeight layout options if the changed object has a layout property.

  • Cleanup index imports

s21
Fix change-bounds-operation-handler

save model action

s

@tortmayr tortmayr requested a review from planger April 25, 2022 07:29
- Ensure consistent usage of `ModelState`
Previously the default implementations used and inconsistent mix of injecting `GModelState` (the custom model state for the direct Gmodel lib)
and `ModelState` (the default class). This introduced and indirect dependency to the `GModelDiagramModule`.  Since the `GModelState` actually did only contain generally reusable code it has been removed and merged with `ModelState`. All default implementations now consistently inject the `ModelState`.

- Move all services (action & operations handlers etc.) that contain implementation specific code for the direct gmodel usecase (graphical model === source model) into a dedicated `gmodel-lib` subdirectory.

- Extract a reusable `AbstractJsonModelStorage` base implementation from the `GModelStorage` that can be reused for any model storage
that loads JSON models from files.

- Introduce a generic abstract base implementation for `CreateNodeOperationHandlers`. 

- Ensure that the `OperationHandler` correctly sets the reason when dispatching a new `SetDirtyStateAction`

- Fix issue in `ChangeBoundsOperationHandler`. Only set the `prefWidth, prefHeight` layout options if the changed object has a `layout` property.
- Cleanup index imports


s21
Fix change-bounds-operation-handler


save model action


s
tortmayr added a commit to eclipse-glsp/glsp-examples that referenced this pull request Apr 25, 2022
Setup glsp server and client
Consume latest glsp server and client 
Load and save to a json resource
Supports creation and deletion, resizing, moving of nodes as well as label editing.
Part of eclipse-glsp/glsp#622

Requires: eclipse-glsp/glsp-vscode-integration#26
Requires: eclipse-glsp/glsp-server-node#16
Contributed on behalf of STMicroelectronics.
Copy link
Member

@planger planger left a comment

Choose a reason for hiding this comment

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

Code looks good, thanks! I tested the workflow example server and it seems to still work fine! 👍

@tortmayr tortmayr merged commit 0193b16 into main Apr 26, 2022
@tortmayr tortmayr deleted the improvements branch April 26, 2022 06:38
planger pushed a commit to eclipse-glsp/glsp-examples that referenced this pull request Apr 28, 2022
Setup glsp server and client
Consume latest glsp server and client 
Load and save to a json resource
Supports creation and deletion, resizing, moving of nodes as well as label editing.
Part of eclipse-glsp/glsp#622

Requires: eclipse-glsp/glsp-vscode-integration#26
Requires: eclipse-glsp/glsp-server-node#16

Co-authored-by: Philip Langer <planger@eclipsesource.com>

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

2 participants