I want to be able to listen to selection events on InstallLibraryPanel's "Include libraries with this application" option as well as have the ability to disable the action associated with this option.
I am looking to integrate a WTP 3.0 based facet to Library Provider Framework in WTP 3.2 (similar to what was done for JPA & JSF facet- e.g. https://bugs.eclipse.org/bugs/show_bug.cgi?id=250208). One of the requirements of the WTP 3.2 facet is to provide shared library support- if the user selects "User Library" as the facets Implementation library, user is able to define options to both "Include libraries with this application", as well as a related option provided by our facet to add the library as a "Shared Library" (if the projects targeted EAR/server supports shared libraries). So, our facet needs to detect if option "Include libraries with this application" has been selected/deselected and enable the "User Library" option appropriately. Idealy the new option would appear as part of the InstallLibraryPanel right below (and indented) "Include libraries with this application" option, but we may be able to live with the new option just below the InstallLibraryPanel if we can listen for selection/deselection events. Further, we would like to disable the actions of "Include libraries with this application" option when "Shared Library" is also selected (the alternative would be to remove the classpath entries added by the action which is not as nice).
Can I get this working in WTP 3.2? Can you please point me to API I can use?
I looked at API's and classes below and did not see anything useful (I was looking at WTP 3.1 but WTP 3.2 would be fine). -org.eclipse.jst.common.project.facet.ui.libprov.LibraryProv iderFrameworkUi.createInstallLibraryPanel(Composite, LibraryInstallDelegate, String)
Thanks for re-posting to this forum. Glad to see outside interest in using the Library Provider Framework. Unfortunately, good documentation that brings all of the API together is still on the todo list. All that we have currently is Java API and extension point docs.
There are two important things to understand about the library provider framework:
1. Providers are enabled typically on per-facet basis. There are no providers (at least that ship out of the box) that are enabled globally. This can be annoying at times, when you have to re-declare say the user library provider for you facet, but gives you (the facet author) a lot more control. You can choose to not include some providers or more to the point about your usecase, you can choose to substitute a provider that behaves similar to a generic one but has been customized for whatever extra behavior that you require.
2. It is easy to create new providers by extending existing ones and just changing the aspects that need to be changed.
The Library Provider Framework includes the user libraries provider (id = user-library-provider). The base user library provider is usable as is in basic Java projects, but it does not have "Include libraries with this application" functionality as that's WTP specific. This functionality is added somewhere else in WTP by extending the base user library provider to create a WTP-specific version (id = wtp-user-library-provider).
Here is the definition of the base user library provider:
Based on my understanding of the scenario that you described, I think you will want to extend wtp-user-library-provider to add support for your shared library option. Poke around the classes referenced in the above extension points. Worst case scenario is that wtp-user-library-provider doesn't give you enough control over the "Include libraries with this application" option, in which case you can just derive from user-library-provider directly and re-build this functionality (should be pretty trivial to do).
> 1. Providers are enabled typically on per-facet basis. There are no
> providers (at least that ship out of the box) that are enabled globally.
except runtime-library-provider that will appear for every facet if there is a classpath entry in Target Runtime.
I am creating Maven Library provider for the JBoss Portlet feature and would like to exclude this provider when the Runtime doesn't
have any portlet component. As far as I could see, that is impossible.
I was trying to get a define complex enablement expression like below with 2 facet requirements , but seemed only the first requirement was being recognized. It is entirely possible my enablement expression is not correctly formed.
What we actually want though is support for e.g. a Project PropertyTester and associated class in our enablement expression , so the class would get called with a handle to the project to glean information like what runtime is it targeting, does that runtime support our library (having some logic in the class to determine that.
So, can you tell me if the extension point supports more or less an arbitrarily complex enablement expression with property testers etc like we are looking for?