Skip to content

EditorContextService and AutoCompleteWidget - what are they good for? #605

Answered by planger
rsoika asked this question in Q&A
Discussion options

You must be logged in to vote

The EditorContextService is a central injectable component that gives read-only access to certain aspects of the diagram, such as the currently selected elements, the model root (GModel), the edit mode, the latest position of the mouse in the diagram. It has been introduced for two main reasons:

  1. to simplify accessing the model root and the current selection from components that are not commands, because in Sprotty only those had convenient access to that data
  2. to conveniently create an EditorContext, which is a context object sent as part of several actions to the server to describe the current state of the editor (selection, last mouse position, etc.).

The AutoCompleteWidget is a reusab…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@rsoika
Comment options

Answer selected by rsoika
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants