The amazing vanishing facet.
October 24th, 2007
In lieu of introduction
I have recently started working in Eclipse, helping build an IDE on top of the standard runtime. This involves me learning an awful lot about the eclipse architecture (though I am far from an expert), and as I've worked on things, I've discovered that the otherwise excellent Eclipse documentation sometimes fails to mention small but vital things that lead me to waste, say, an entire afternoon on solving a trivial problem.I am therefore going to start a series of posts relating to the WTP project (and whatever else I work on next), and other aspects of eclipse as things move along.
The amazing vanishing facet
Facets are a way to specify some default behavior in a Web Tools Platform (WTP) project that can be added and removed at will by the user. Because of their modular nature, you can use them to create finely grained wizards, either by letting the user select the facets they want through the standard facet selection wizard, or by defining the facets in the background and using them to abastract the design of the wizard you present to your client. The tutorial linked to above is quite good, but if, like me, you like to start playing in your own project rather than follow along in the provided tutorial project, some things might trip you up.
Here's the problem. In Section 2, the tutorial shows you how to define a facet using the org.eclipse.wtp.common.project.facet.core.facets extension point. This works fine in the example plugin; notice, however, that when you fire up the "New Project" wizard in the running instance of the FormGen plugin and select the Dynamic Web Tools project as indicated, the "Target Runtime" field specifies "
If your facet is not showing up where you expect it to, make sure that either a. your facet is configured to run on the specified runtime or b. the project you're trying to set up does not have an associated runtime.
Of course, since facets are associated with WTP projects, they almost always will need to support at least one runtime. However, it helps to know about the runtime dependency ahead of time as a sanity check: if the facet is not showing up, try not specifying a runtime in the project wizard and see if the facet then appears---you can worry about adding the runtime dependencies later. Defining runtime support is covered in Section 9 of the turorial, where the dependency of facets on runtimes is explained in detail as well. But if you got lazy and came here first instead, I hope this helped.
Sorry, comments are closed for this article.