|
Re: How to extend Xtext DSL to use a validation class packaged with a library model ? [message #899091 is a reply to message #899075] |
Mon, 30 July 2012 14:22 |
Henrik Lindberg Messages: 2509 Registered: July 2009 |
Senior Member |
|
|
Hi,
IIRC, the validation uses all registered validators for a model.
Explore the source how your DSL's JavaValidator gets registered and called.
So, basically, the optional library extensions would register their
accompanying validators the same way.
Sorry, but I don't remember the details, but hope that helps you somewhat.
Regards
- henrik
On 2012-30-07 15:38, Cristiano Gaviao wrote:
> Hi,
> I'm working with one DSL and some library models that are packaged in
> its own bundles and could be installed separated.
>
> I would like to deliver one validation class together to its own library
> (to deal with elements delivered by its library) but I don't want to add
> any dependency from the DSL to the libraries.
>
> Could someone point me how could I do this ?
>
> thanks,
>
> Cristiano
|
|
|
|
|
|
|
Re: How to extend Xtext DSL to use a validation class packaged with a library model ? [message #899198 is a reply to message #899155] |
Tue, 31 July 2012 03:00 |
Cristiano Gavião Messages: 279 Registered: July 2009 |
Senior Member |
|
|
Christian Dietrich wrote on Mon, 30 July 2012 20:04Hi,
its done by MyDslExecutableExtensionFactory
~Christian
Ok Christian,
I think I'm understanding how things starts... but I'm still with doubts.
I've create a new MyDataLibraryExecutableExtensionFactory and use it in the plugin.xml with some extension point.
I've created my MyDataLibraryModule and added this to it:
@org.eclipse.xtext.service.SingletonBinding(eager=true) public Class<? extends AbstractDeclarativeValidator> bindMyDataLibraryJavaValidator() {
return MyDataLibraryTemplateJavaValidator.class;
}
@Override
public void configure(Binder binder) {
super.configure(binder);
binder.bind(AbstractUIPlugin.class).toInstance(plugin);
}
But how should I use it ?
should I create a new child Injector using as parent the Injector from the MyDslActivator.getInstance().getInjector()?
regards,
Cristiano
[Updated on: Tue, 31 July 2012 03:15] Report message to a moderator
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04910 seconds