Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[wtp-dev] Using extension point to plug in to servlet wizard

I'd like some help with an extension point/data model problem I'm facing:

I'm trying to use the org.eclipse.wst.common.frameworks.DataModelProviderExtension extension point in order to provide a subclass of org.eclipse.jst.j2ee.internal.web.operations.NewServletClassDataModelProvider

In the class comment of that class it says that you are able to subclass it and provide specific attributes for new servlet generation. Specifically, I am trying to tell it to use annotations (instead of deployment descriptors) for the case of my server as the target.

I tried this code in plugin.xml:
<extension point="org.eclipse.wst.common.frameworks.DataModelProviderExtension">

And, in mypackage.AnnotationServletClassDataModelProvider:
1) I provide a default constructor which only calls super, but allows me to set a breakpoint 2) I override public Object getDefaultProperty(String propertyName) to test for IAnnotationsDataModel.USE_ANNOTATIONS and, if it is the property, to check the target property for a facet with my server's facet.

When debugging, neither the constructor nor the override at stopped at.

I debugged a bit more and find that NewWebWizard's init calls getDataModel(), which calls DataModelFactory.createDataModel(getDefaultProvider()) which calls NewServletClassDataModelProvider's getDefaultProvider(), which returns new NewServletClassDataModelProvider();

So, how am I to plug in to this?


Back to the top