BestSolution-at / e4-efxclipse-maven-sample

Sample using pure maven for e4 application
5 stars 8 forks source link

Questions to expand the application #17

Open MarceloRuiz opened 4 years ago

MarceloRuiz commented 4 years ago

I am having trouble extending the sample maven application. I have efxclipse tooling version 3.7.0.202004170922 installed. I would like to create a new module that will contribute elements to the UI via a fragment.e4xmi. In the new project wizard, the closest thing that I found was maven module. That gave me the basic directory structure and I could easily edit the pom.xml to declare the module parent, and the new module to the feature and to the parent pom.

My questions are:

1 - Do I need to create a bnd.bnd file manually and add content based on the other bnd.bnd files in the project?

2 - How do I set which packages are exported? I looked at the bnd.bnd file in sample.mvn.lib and there the exported lib is mentioned by -exportcontents: sample.mvn.lib (which seems not to work properly) but if I edit the file with the bnd editor, in its 'Contents' tab there is a section for 'Export Packages' that is empty. I can click there the plus sign and select sample.mvn.lib, and the file gets modify by adding Export-Package: sample.mvn.lib. Which one is the valid one?

3 - I created a new fragment.e4xmi file inside of the src > main > resources folder, following the structure of sample.mvn.app. When I edit the file to add a 'Model Fragment', I am unable to select the right 'Extended Element-ID'. After clicking the 'Find...' button, I can't see anything relevant to the current project. No matter which Container-Type I select, the wizard detects only my e4 spy tool. If I select 'Application' as the Container-Type the wizard gives me only 2 choices: Application (xpath:/) and Application (org.eclipse.e4.legacy.ide.application). If I remember correctly, I should have an 'org.eclipse.e4.application' here. Even if I type that and click and find a Feature Name, there is nothing else I could do. For example, by selecting handlers, I cannot add a new definition because the drop-down menu remain grayed out and empty. How can I solve this?

Thanks!

tomsontom commented 4 years ago

I am having trouble extending the sample maven application. I have efxclipse tooling version 3.7.0.202004170922 installed. I would like to create a new module that will contribute elements to the UI via a fragment.e4xmi. In the new project wizard, the closest thing that I found was maven module. That gave me the basic directory structure and I could easily edit the pom.xml to declare the module parent, and the new module to the feature and to the parent pom.

My questions are:

1 - Do I need to create a bnd.bnd file manually and add content based on the other bnd.bnd files in the project?

yes

2 - How do I set which packages are exported? I looked at the bnd.bnd file in sample.mvn.lib and there the exported lib is mentioned by -exportcontents: sample.mvn.lib (which seems not to work properly) but if I edit the file with the bnd editor, in its 'Contents' tab there is a section for 'Export Packages' that is empty. I can click there the plus sign and select sample.mvn.lib, and the file gets modify by adding Export-Package: sample.mvn.lib. Which one is the valid one?

https://bnd.bndtools.org/releases/4.0.0/chapters/850-macros.html

so that is perfectly valid (i don't have the bndtooling installed) but the important thing is that the MANIFEST.MF is correct and if you look into your target-folder you'll notice it is correct

3 - I created a new fragment.e4xmi file inside of the src > main > resources folder, following the structure of sample.mvn.app. When I edit the file to add a 'Model Fragment', I am unable to select the right 'Extended Element-ID'. After clicking the 'Find...' button, I can't see anything relevant to the current project. No matter which Container-Type I select, the wizard detects only my e4 spy tool. If I select 'Application' as the Container-Type the wizard gives me only 2 choices: Application (xpath:/) and Application (org.eclipse.e4.legacy.ide.application). If I remember correctly, I should have an 'org.eclipse.e4.application' here. Even if I type that and click and find a Feature Name, there is nothing else I could do. For example, by selecting handlers, I cannot add a new definition because the drop-down menu remain grayed out and empty. How can I solve this?

Unfortunately the current model-tooling can only deal with PDE setups - it is since a long time on our work list to create a new and less biased tool who uses JavaFX as its UI and hence would work in IJ and Netbeans as well.

MarceloRuiz commented 4 years ago

Unfortunately the current model-tooling can only deal with PDE setups - it is since a long time on our work list to create a new and less biased tool who uses JavaFX as its UI and hence would work in IJ and Netbeans as well.

So how do you overcome the limitation in practice? You do everything programmatically? Is there a workaround like creating symlinks?

MarceloRuiz commented 4 years ago

I forgot to ask: Do you want me to file a ticket for decoupling the e4 model editor from PDE so it can work with Maven?

MarceloRuiz commented 4 years ago

The only way I found to make it work is kind of weird, and I would like to know if this is the only way to do things now. What I did was to add the needed elements editing the Aplication.e4xmi file. Once they were in place, I extracted the elements into a fragment.e4xmi and I located it into the src/main/resources folder of the desired module. This process shows errors in the UI and creates a new META-INF folder in the module's root folder, that needs to be deleted. Is this the way we should work until the tools get updated to deal with maven-based projects? If this is the 'recommended' way for now, we should document it somewhere. I guess I could do that in the README.md file.