Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Registering the EValidator Implementation
Registering the EValidator Implementation [message #422164] Sat, 23 August 2008 19:24 Go to next message
Ben is currently offline BenFriend
Messages: 46
Registered: July 2009
Member
Hi,

Has anyone register the EValidator implementation using a different
approach than the one showed in the EMF Validation Adapter Tutoria; which
uses the org.eclipse.ui.startup extension to register the validator, as
shown below.

<extension point="org.eclipse.ui.startup">
<startup class="org.eclipse.emf.validation.examples.adapter.Startup"/ >
</extension>

public class Startup implements IStartup {

public void earlyStartup() {
EValidator.Registry.INSTANCE.put(LibraryPackage.eINSTANCE,
new EValidatorAdapter());
}
}
Re: Registering the EValidator Implementation [message #422165 is a reply to message #422164] Sat, 23 August 2008 19:45 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Ben,

Early startup is kind of nasty...

The value in the EValidator.Registry.INSTANCE can be an
EValidator.Descriptor rather than an actual EValidator instance.
Generated packages register their generated validator like this.

// Register package validator
EValidator.Registry.INSTANCE.put
(theTreePackage,
new EValidator.Descriptor()
{
public EValidator getEValidator()
{
return TreeValidator.INSTANCE;
}
});

So I suppose a model wishing for clients to plugin in validation
extensions could provide an extension point for that...


Ben wrote:
> Hi,
>
> Has anyone register the EValidator implementation using a different
> approach than the one showed in the EMF Validation Adapter Tutoria;
> which uses the org.eclipse.ui.startup extension to register the
> validator, as shown below.
>
> <extension point="org.eclipse.ui.startup">
> <startup class="org.eclipse.emf.validation.examples.adapter.Startup"/ >
> </extension>
>
> public class Startup implements IStartup {
>
> public void earlyStartup() {
> EValidator.Registry.INSTANCE.put(LibraryPackage.eINSTANCE,
> new EValidatorAdapter());
> }
> }
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Registering the EValidator Implementation [message #422172 is a reply to message #422165] Sat, 23 August 2008 22:34 Go to previous messageGo to next message
Ben is currently offline BenFriend
Messages: 46
Registered: July 2009
Member
Hi Ed,

Thanks for your prompt reply. Do you have any example of a model
providing such extension point so clients can plugin in that validation
extensions?
Re: Registering the EValidator Implementation [message #422177 is a reply to message #422172] Sun, 24 August 2008 10:08 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Ben,

We have examples of quite a few extensions points we provide in EMF.
EcorePlugin kicks of their processing so you could have a look at how
it does that.


Ben wrote:
> Hi Ed,
>
> Thanks for your prompt reply. Do you have any example of a model
> providing such extension point so clients can plugin in that
> validation extensions?
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Re: [Teneo] Error running Teneo (1.x) Dynamic.java example [ with attachments]
Next Topic:XMLResource.setID
Goto Forum:
  


Current Time: Wed Apr 24 23:05:13 GMT 2024

Powered by FUDForum. Page generated in 0.02435 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top