|
|
|
|
|
|
|
|
|
|
|
|
Re: Upgrade from 2.4.3 to 2.6.2 Problem [message #1398022 is a reply to message #1396690] |
Thu, 10 July 2014 13:45 |
Frank Baier Messages: 7 Registered: July 2014 |
Junior Member |
|
|
we found the originator of the problem:
in the DSLModule declaration we override like the following:
public class ServiceDSLRuntimeModule extends ch.basler.service.dsl.AbstractServiceDSLRuntimeModule {
public Class<? extends EclipseResourceFileSystemAccess2> bindEclipseFSA() {
return UTF8EclipseFilesSystemAccess.class;
}
we need this as otherwise the generated sourcecode does not understand german umlauts.
UTF8EclipseFilesSystemAccess:
public class UTF8EclipseFilesSystemAccess extends EclipseResourceFileSystemAccess2 {
private IProject project;
private File projectFolder;
@Override
protected StringInputStream getInputStream(String contentsAsString, String encoding) {
return super.getInputStream(contentsAsString, "UTF-8");
}
@Override
public void setProject(IProject project) {
this.project = project;
IFile dotProject = project.getFile(".project");
URI dotProjectURI = dotProject.getRawLocationURI();
File dotProjectFile = new File(dotProjectURI);
projectFolder = dotProjectFile.getParentFile();
super.setProject(project);
}
public IProject getProject() {
return project;
}
public File getProjectFolder() {
return projectFolder;
}
public File getJavaIOFile(String path) {
return getJavaIOFile(path, DEFAULT_OUTPUT);
}
private File getJavaIOFile(String path, String outputConfiguration) {
org.eclipse.emf.common.util.URI uri = getURI(path, outputConfiguration);
List<String> segmentsList = uri.segmentsList();
List<String> subList = segmentsList.subList(2, segmentsList.size());
File ret = getProjectFolder();
for (String segment : subList) {
ret = new File(ret, segment);
}
return ret;
}
}
if I remove the binding, the generation works fine - but the umlauts don't work.
Any ideas, what's wrong with the implementation?
Cheers
Frank
|
|
|
|
Powered by
FUDForum. Page generated in 0.04920 seconds