Home » Eclipse Projects » GEF » GEF 5 (MVC) + e4 RCP Application Tutorial
|
Re: GEF 5 (MVC) + e4 RCP Application Tutorial [message #1771653 is a reply to message #1771498] |
Tue, 29 August 2017 07:30 |
|
Hi Ken,
no there is no tutorial dedicated to GEF 5.x integrated into e4 RCP.
IMHO, you do not need such a tutorial to get started. There are plenty of examples and other documentation for GEF (mindmap tutorial, GitHub wiki, MVC example, Zest Graph example, javadoc). Integrating into e4 RCP is not a big deal at all.
Best regards,
Matthias
|
|
| | | | | | | |
Re: GEF 5 (MVC) + e4 RCP Application Tutorial [message #1773571 is a reply to message #1773530] |
Fri, 29 September 2017 14:53 |
|
Hi Ken, I will check it out now, thank you for your patience.
Maybe stating a tutorial "is not needed" does not do justice to the problem. However, I still believe integration (into Eclipse UI) is a rather small aspect of application development with GEF. Nonetheless, I am happy to see that you are putting something together =) Moreover, I was not even thinking about all the UI builder stuff that can be used in conjunction with JavaFX, not bad!
I will answer here later, when I took a deeper look.
PS: I really appreciate that the discussion shifted from "Can you provide a tutorial for X?" to "I am trying to do X, but it fails due to Y. How can I proceed from here?". This is much more productive.
Best regards,
Matthias
|
|
| |
Re: GEF 5 (MVC) + e4 RCP Application Tutorial [message #1773593 is a reply to message #1773583] |
Fri, 29 September 2017 18:46 |
|
Alright, some notes first w.r.t. the problems you encountered on the way:
1) Dependencies (e.g. Guice). These can be taken directly from GEF, i.e. org.eclipse.gef.mvc.fx lists com.google.inject;version="[1.3.0,1.4.0)" as one of its dependencies. So, you can see that the 1.4.0 version is excluded (an internal data structure was changed between 1.3.0 and 1.4.0, which caused a bug in GEF Common IIRC).
2) Running with e(fx)eclipse. The VM argument that you need to supply so that JavaFX dependencies can be resolved in the OSGi environment (-Dosgi.framework.extensions=org.eclipse.fx.osgi) is listed in the "Getting started" section in the GEF README [0] (launching examples).
3) You are not forced to use the MvcFxModule with GEF, however, it installs the AdapterInjectionSupport and sets up some useful default bindings, therefore, it is a good idea to extend that module. However, you certainly do not need to use MvcFxUiModule, which only contributes bindings that are useful when integrating into a classic Eclipse UI (e.g. FXCanvasFactory, operation history, selection provider etc.).
These problems are unrelated to e4. You would need to get this right regardless of whether you are using e4 or not. That's why this is explained, for example, in the GEF Mindmap Tutorial [1].
Now, talking about the implementation:
- I am unsure, but I think you can use the compatibility layer and still access the functionality provided by MVC.FX.UI, however, when doing pure e4, you probably need to implement it differently. You can take a look at the Eclipse Wiki for a list of the eclipse application services and their current status w.r.t. e4 [2].
- You do not need to use the SWT renderer with e4. You can use a pure JavaFX renderer instead, if you wish [3].
- The ShapeModel seems to be more complicated than it needs to be. I would try to start with a simpler model, e.g. {boxes=>ObservableList<IShape>,lines=>ObservableMap<IShape,IShape>}
- I implemented just what was needed to get a Rectangle onto the screen and added a standalone JavaFX application for your shapes example. You can find a corresponding patch attached to this message if you are interested.
- The GitHub repository has a single plugin project on the root level. I would use the parent folder as the root, so that you can comprise multiple projects in that repository.
I think you chose a good scope for the example and that it has some potential, but I can imagine that it would be more interesting to develop a pure JavaFX e4 application with GEF and to fill the gap w.r.t. Eclipse Application Services.
PS: I do not work with or use e4, therefore, despite my efforts, I am probably making false assumptions / missing an understanding for some concepts, and am thus glad to get corrected if that is the case.
Best regards,
Matthias
[0] https://github.com/eclipse/gef#getting-started-with-the-framework-components-adopters
[1] https://info.itemis.com/en/gef/tutorials/
[2] https://wiki.eclipse.org/E4/Eclipse_Application_Services
[3] https://wiki.eclipse.org/Efxclipse/Tutorials/Tutorial3
-
Attachment: rect.patch
(Size: 6.59KB, Downloaded 238 times)
|
|
| | | |
Goto Forum:
Current Time: Tue Oct 08 15:22:31 GMT 2024
Powered by FUDForum. Page generated in 0.05364 seconds
|