Multiple plugins contributing wizard pages for same facet action ID [message #1719901] |
Wed, 13 January 2016 00:50 |
|
Hello community.
Not sure if this is the right forum or not.
We found out what it appears to be a limitation (or I'd like think of it in that way) in the facets framework. Apparently you can contribute pages to an action for a facet only once and from a particular plugin. Let me explain my scenario.
- In Plugin A, declare the facet definition with an action delegate (let's say my.facet.install).
- In Plugin B, declare wizard pages associated to the facet and action defined in Plugin A.
- In Plugin C, declare another wizard page associated to facet and action defined in Plugin A.
As you can see, two plugins are contributing to the same facet and action. This is where things get weird, If declaring Plugins A and B you get the wizard pages properly, but if you declare A, B and C then pages declared in B are overwritten and instead only pages in C are shown.
Now, to circumvent this problem I can think of two ways:
- Programmatically add wizard pages for the action ID. In this way I could add all pages that I require without overwriting the previous pages. I'm not sure this is even possible and as a matter of fact I haven't found API for doing that.
- Using a generic plugin that will serve as page contributor, merging the two plugins into one. This alternative is the last of our options as it breaks our modularity
Could you confirm our findings and advise on a potential implementation?
Thanks in advance.
|
|
|
Re: Multiple plugins contributing wizard pages for same facet action ID [message #1720148 is a reply to message #1719901] |
Thu, 14 January 2016 18:21 |
|
The problem can be narrowed down to the fact that you cannot have multiple declarations of org.eclipse.wst.common.project.facet.ui.wizardPages for the same action ID even in the same plugin. Only the last definition will be added to the facet wizard for that action ID.
For instance, this will work, adding the two pages to the facet wizard.
<extension
point="org.eclipse.wst.common.project.facet.ui.wizardPages">
<wizard-pages
action="my.facet.install">
<page
class="MyWizardPage1">
</page>
<page
class="MyWizardPage2">
</page>
</wizard-pages>
</extension>
But this won't work. Will use the last page as the UI in the facet wizard.
<extension
point="org.eclipse.wst.common.project.facet.ui.wizardPages">
<wizard-pages
action="my.facet.install">
<page
class="MyWizardPage1">
</page>
</wizard-pages>
</extension>
<extension
point="org.eclipse.wst.common.project.facet.ui.wizardPages">
<wizard-pages
action="my.facet.install">
<page
class="MyWizardPage2">
</page>
</wizard-pages>
</extension>
Looking into the Facets code, particularly org.eclipse.wst.common.project.facet.ui.internal.ProjectFacetsUiManagerImpl, I can see in readWizardPagesExtensions that the list of pages associated to the action Id is always overwritten.
Being said this, I don't think there is a way to split the code in the way I want to, nor there is a way to programmatically contribute wizard pages. The only solution I see is merging the wizard pages contributions into one single plugin and one single org.eclipse.wst.common.project.facet.ui.wizardPages contribution.
Anyway... if you happen to have a better solution, please let me know.
|
|
|
Powered by
FUDForum. Page generated in 0.03656 seconds