|
Re: Is it possible to define built-in EObjects [message #857741 is a reply to message #846677] |
Thu, 26 April 2012 20:32 |
|
You can define built-in objects in your DSL language - place them in a file in your plug-in and make sure you include those files in build.properties. Then bind your own IGlobalScopeProvider:
public class DSLRuntimeModule extends AbstractDSLRuntimeModule {
...
@Override
public Class<? extends IGlobalScopeProvider> bindIGlobalScopeProvider() {
return DSLImportUriGlobalScopeProvider.class;
}
...
}
And make it look something like this:
public class DSLImportUriGlobalScopeProvider extends
ImportUriGlobalScopeProvider {
@Override
protected LinkedHashSet<URI> getImportedUris(final Resource resource) {
LinkedHashSet<URI> temp = super.getImportedUris(resource);
temp.add(URI.createURI("platform:/plugin/<plugin id>/resources/builtin_functions.inc"));
temp.add(URI.createURI("platform:/plugin/<plugin id>/resources/builtin_variables.inc"));
return temp;
}
}
This worked wonderfully for us, but now we're using Namespaces scoping (which I believe is the default) and I'm trying to find out how to do it without this URI approach...
|
|
|
Powered by
FUDForum. Page generated in 0.02830 seconds