| Summary: | User should be able to disable library configuration for a facet | ||
|---|---|---|---|
| Product: | [WebTools] WTP Common Tools | Reporter: | Konstantin Komissarchik <konstantin> |
| Component: | Faceted Project Framework | Assignee: | Konstantin Komissarchik <konstantin> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | gerry.kessler, paul.fullbright |
| Version: | 3.1 | Keywords: | plan |
| Target Milestone: | 3.1 M4 | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
|
Description
Konstantin Komissarchik
After thinking about this scenario some more, I ended up backing off from the dedicated checkbox idea and instead going with making a no-op library provider available for facets to register. The main reason for my change of opinion regarding the checkbox is that disabling library configuration should be a very infrequent scenario, but having a prominent checkbox would place this option in plain sight of users who will very likely not care about this option. This doesn't fit well with the goal of making this possible, but not emphasizing this option.
The no-op library provider has "Disable Library Configuration" as the default label and is configured by default with priority of -1000 (placing it fairly reliably at the bottom of the library providers list). The declaration of the "no-op-library-provider" in the framework is marked abstract. In order to use this for a particular facet, a derived library provider declaration needs to be added. The derived declaration should constrain enablement based on a facet. Besides the constraint, the derived declaration needs to provide a "message" parameter and optionally a "warning" parameter. The message parameter should include text that will appear directly beneath the library type combo when the no-op provider is selected. The warning parameter should be self-explanatory. The text will typically appear in the banner area of the panel's container.
Here is an example of the derived declaration for the JPA facet:
<extension point="org.eclipse.jst.common.project.facet.core.libraryProviders">
<provider id="jpa-no-op-library-provider" extends="no-op-library-provider">
<param name="message" value="%noOpLibraryProviderMessage"/>
<param name="warning" value="%noOpLibraryProviderWarning"/>
<enablement>
<with variable="requestingProjectFacet">
<test
property="org.eclipse.wst.common.project.facet.core.projectFacet"
value="jpt.jpa" forcePluginActivation="true"/>
</with>
</enablement>
</provider>
</extension>
noOpLibraryProviderWarning = Library configuration is disabled. Further classpath changes may be required later.
noOpLibraryProviderMessage = This facet requires JPA implementation library to be present on project classpath. By disabling library configuration, user takes on responsibility of configuring classpath appropriately via alternate means.
Released framework changes to the 3.1 M4 build stream.
I like this better as well. |