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

Fixes #21: Align action processor with client-side action dispatcher #66

Merged
merged 3 commits into from
Aug 3, 2020

Conversation

martin-fleck-at
Copy link
Contributor

  • Action processor should invoke ALL registered action handlers
  • Each response by an action handler should be processed
  • Introduce client action handler that sends actions to client

Note: This change does not adapt the operation handlers which execute operations and do not return any actions as of now.

Signed-off-by: Martin Fleck [email protected]

@martin-fleck-at martin-fleck-at requested a review from tortmayr July 29, 2020 11:14
- Action processor should invoke ALL registered action handlers
- Each response by an action handler should be processed
- Introduce client action handler that sends actions to client

Note: This change does not adapt the operation handlers which execute
operations and do not return any actions as of now.

Fixes eclipse-glsp/glsp#21

Signed-off-by: Martin Fleck <[email protected]>
Copy link
Contributor

@tortmayr tortmayr left a comment

Choose a reason for hiding this comment

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

Thanks! Code looks good for the most part, I only noticed a few minor issues.
I really like the approach of using named injection to identify client actions 👍

Maybe it would be a good idea to also adapt the workflow example and create a multi-handler scenario to demonstrate/test this new feature

@@ -88,7 +97,22 @@ private MultiBindingDefaults() {}
TriggerEdgeCreationAction.class,
UpdateModelAction.class);

public static final List<Class<? extends Action>> DEFAULT_CLIENT_ACTIONS = Lists.newArrayList(
SetClipboardDataAction.class,
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like this list is not complete. There are a couple of other client actions (ike. Center, FitToScreen, Select, Expand, ServerStatusAction etc.)

We should also double check the ActionHandlers e.g. the SetEditModeActionHandler implicitly registers the SetEditModeAction which has to be registered as client action as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Very good point! As discussed, I registered the necessary actions as client actions and also removed up some unused actions, cf also eclipse-glsp/glsp-client#74.

I also added a logging example for the server-side action dispatching, cf. eclipse-glsp/glsp-examples#60

Copy link
Contributor

Choose a reason for hiding this comment

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

Looks good to me. Just a quick question: There are a couple of actions that are declared in both DEFAULT_ACTIONS and DEFAULT_CLIENT_ACTIONS. Is this really necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Very good observation! I tested this and you are right, the DIActionRegistry already captures all handled actions through the action and operation handler bindings. As a result, the default action binding was removed altogether. I pushed a new commit to reflect that. Thank you!

- Fix wrong logger
- Add missing client actions

- Add client-side actions that could be sent from server
-- NavigateToTarget action

- Remove actions that are neither used on the server nor on the client
-- CollapseExpandAction
-- CollapseExpandAllAction
-- OpenAction
-- RequestExportSvgAction

Signed-off-by: Martin Fleck <[email protected]>
- DIActionRegistry already considers handled actions and operations
-- Remove default action binding altogether
-- Only handled actions are part of the action registry

- Add missing trigger actions and SetBounds action to client action set

Signed-off-by: Martin Fleck <[email protected]>
@tortmayr tortmayr merged commit f197b66 into master Aug 3, 2020
@tortmayr tortmayr deleted the issue-21 branch August 27, 2020 13:22
MatthiasHofstaetter pushed a commit to MatthiasHofstaetter/glsp-server that referenced this pull request Dec 21, 2024
… dispatcher (eclipse-glsp#66)

* eclipse-glsp#21: Align action processor more with client-side action dispatcher

- Action processor should invoke ALL registered action handlers
- Each response by an action handler should be processed
- Introduce client action handler that sends actions to client

Note: This change does not adapt the operation handlers which execute
operations and do not return any actions as of now.

Fixes eclipse-glsp/glsp#21

Signed-off-by: Martin Fleck <[email protected]>

* eclipse-glsp#21: Incorporate feedback

- Fix wrong logger
- Add missing client actions

- Add client-side actions that could be sent from server
-- NavigateToTarget action

- Remove actions that are neither used on the server nor on the client
-- CollapseExpandAction
-- CollapseExpandAllAction
-- OpenAction
-- RequestExportSvgAction

Signed-off-by: Martin Fleck <[email protected]>

* eclipse-glsp#21: Avoid registering actions that are automatically registered anyway

- DIActionRegistry already considers handled actions and operations
-- Remove default action binding altogether
-- Only handled actions are part of the action registry

- Add missing trigger actions and SetBounds action to client action set

Signed-off-by: Martin Fleck <[email protected]>
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