[AM3] [ATL] [TCS] "atl" language absent in LanguageRegistry [message #563791] |
Tue, 10 March 2009 14:13 |
Skander TURKI Messages: 130 Registered: July 2009 |
Senior Member |
|
|
Hi,
It is about the InjectAction class of the package
org.eclipse.gmt.tcs.actions
I tried to execute the code of the run method independently from the
plugin to inject an atl file into an atl model programmatically :
public void inject(){
//public void run(IAction action) {
IFile file = getSelectedElement();
Language language = LanguageRegistry.getDefault().getLanguage("atl"); //
only "tcs" or "KM3" can be selected, putting "atl" returns null!!
AtlModelHandler amh = AtlModelHandler.getDefault(AtlModelHandler.AMH_EMF);
Map params = new HashMap();
ASMModel model = (ASMModel)language.inject(ASMModelFactory.getDefault(),
null, new IFileTextSource(file), params);
amh.saveModel(model, file.getProjectRelativePath().toString() + ".xmi",
file.getProject());
// }
}
The problem is that LaunguageRegistry.getDefault() returns two langages
"KM3" or "tcs", i tried with "tcs" but this generates erros and generates
an ampty tcs model, so normally i should find a third language in the
result of LanguageRegistry.getDefault() that must be (atl) to do the
injection with this code.
Do anybody have an idea?
thanks
|
|
|
Powered by
FUDForum. Page generated in 0.02562 seconds