Problems invoking a custom validator [message #202484] |
Wed, 17 October 2007 07:57 |
Eclipse User |
|
|
|
Originally posted by: uh5d.rz.uni-karlsruhe.de
I created a plugin which registers a new content type, modelhandler and
adapter factory.
Basically what I intended is to let a mdl2e file be treatened like a xml
file:
<extension point="org.eclipse.core.runtime.contentTypes">
<content-type
file-extensions="mdl2e"
priority="low"
name="MDL2e Content Type"
id="mdl2esource"
base-type="org.eclipse.core.runtime.xml"
default-charset="UTF-8">
<describer
class=" org.eclipse.core.runtime.content.XMLRootElementContentDescri ber ">
<parameter
name="element"
value="mdl2esheet"
/>
</describer>
</content-type>
</extension>
<extension point="org.eclipse.wst.sse.core.modelHandler">
<modelHandler
default="false"
class="iswarmide.ModelHandlerForMDL2E"
associatedContentTypeId="iswarmide.mdl2esource"
id="mdl2esourcehandler">
</modelHandler>
</extension>
<extension point="org.eclipse.wst.sse.ui.adapterFactoryDescription">
<adapterFactoryDescription
class="iswarmide.AdapterFactoryProviderForMDL2E"/>
</extension>
Until here everything worked out fine... a *.mdl2e file gets marked as an
xml file in the project explorer just like I wished and
it also gets (syntax)highlighted like a normal xml file.
I then added a custom validator:
<extension
id="mdl2eValidator"
name="MDL2EValidator"
point="org.eclipse.wst.validation.validator">
<validator>
<filter
objectClass="org.eclipse.core.resources.IFile"
caseSensitive="false"
nameFilter="*.mdl2e">
</filter>
<contentTypeBinding contentTypeId="iswarmide.mdl2esource"/>
<helper
class="org.eclipse.wst.xml.core.internal.validation.core.Helper "/>
<run
async="true"
class="iswarmide.MDL2EValidator"
enabled="true"
fullBuild="true"
incremental="true"
/>
</validator>
</extension>
Now, when i open a mdl2e file the xml-editors pops up. However, instead of
my MDL2EValidator the standart
org.eclipse.wst.xml.core.internal.validation.eclipse.Validat or gets invoked.
Strangely the MDL2EValidator gets invoked when i manually go on the file in
the project explorer and click on "validate".
How can I achieve, that my MDL2EValidator gets automatically invoked when i
change something in the editor and not just by manually clicking
"validate"???
Regards
A.Gallus
|
|
|
|
Powered by
FUDForum. Page generated in 0.03145 seconds