[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [pdt-dev] Using ModelQueryExtension

Hi,

The extension must be declared as follows in your plugin.xml:

<extension point="org.eclipse.wst.xml.core.modelQueryExtensions">
      <modelQueryExtension
            class="org.fhtml.eclipse.editors.FhtmlModelQueryExtension"
            contentType="org.eclipse.wst.html.core.htmlsource">
      </modelQueryExtension>
 </extension>

BTW, do you see extended elements in regular HTML editor?


On Wed, Nov 26, 2008 at 8:02 AM, Jim Kremens <kremens@xxxxxxxxx> wrote:
> Hi all,
>
> I'm trying to extend PDT to support custom html tags and attributes.
> After some confusion,  I've implemented the
> org.eclipse.wst.xml.core.modelQueryExtensions extension point and
> built a class that extends ModelQueryExtension (thanks for the tip
> Roy!):
>
>
> package org.fhtml.eclipse.editors;
>
> import java.util.ArrayList;
> import java.util.List;
>
> import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.extension.ModelQueryExtension;
> import org.w3c.dom.Element;
> import org.w3c.dom.Node;
>
> public class FhtmlModelQueryExtension extends ModelQueryExtension {
>
>       public FhtmlModelQueryExtension() {
>               System.out.print("NEVER CALLED\n");
>       }
>
>       public String[] getAttributeValues(Element e, String namespace,
> String name) {
>               //See XSDModelQueryExtension for an example
> implementation of this...
>       }
>
> }
>
>
> But my class is never invoked.  I've looked at other implementations
> of ModelQuery, like in the XSD and JSP packages, and unfortunately, I
> can't discern when these extensions are actually called.
>
> Has anyone had success with this extension point?  Also, if anyone
> knows of any real documentation on the topic, that would be great as
> well.  As far as I can tell, there's almost nothing, as this is meant,
> for now, to be an internal extension point.
>
> Thanks,
>
> Jim Kremens
> _______________________________________________
> pdt-dev mailing list
> pdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/pdt-dev
>



-- 
Michael