Closed planger closed 5 years ago
Thanks a lot for the fast review!
If I'm not mistaken there are now only some minor dependencies to the sprotty server plugins. Maybe we could remove these dependencies entirely in a follow-up PR. This would be especially helpful for the p2-generation.
Yes, you're right! I think the only reason we need the dependency is the HtmlRoot, which would be easy to add. I'll open up a ticket for a follow-up change.
On a side note: What formatting settings for Eclipse are you using? I think we do not use the same settings which causes a lot of (more or less) unnecessary changes like adding/removing blank lines Maybe we should agree on standard settings here.
I use the default Eclipse built-in formatter of a 2019-3 Eclipse IDE. However, it may well be the case that I added/removed blank lines here and there for my personal code feng shui -- sorry about that.
I addressed your feedback in 3fcc48a. Nice catch re the min width and height, btw! :+1:
:+1: Looks good to me. I have to do some preparatory steps in the glsp-p2 repository to ensure succesfull deployment before we can merge this.
This change introduces an EMF-based graph (called GModel) in place of the SModel on the server. The serialization and deserialization of SModel compatible JSON is done with Gson customizations that are used for LSP4J as well as for loading and writing models from the file system. Therefore a type map indicates which type (e.g. "task:manual") is mapped to which EClass. This type map is configured DI of type
GraphGsonConfiguratorFactory
, which can register custom EPackages alongside the baseGraphPackage
and a type map. This is then picked up by the Gson configuration as well as in a few other places (e.g. to create an instance of a node).We also introduce a dedicated
GModelIndex
instead of the oldSModelIndex
which builds on EMF's cross referencer and content adapter. So it is not necessary anymore to explicitly add or remove added or removed elements to the index.With the help of the index and custom code in
GEdge
, we can resolve ID based references, such as source and target and therefore have support foredge.getSource() : GModelElement
as well asedge.setSource(GModelElement)
. You can choose whether you want to read and write those references via ID or via the actual object reference.Things to be done in follow up changes (I'll create issues for them as soon as this is merged):
HtmlRoot
: it appears this is the only class left that requires the sprotty dependencyILayoutEngine
for GModels doesn't have any non-null implementation so far.GModelIndex
is a bit weird for ID generation. Not strictly related to EMF, but I'd like to replace that with java-uuid for ID generation and a better concept for label provider for new elements.Closes #231