내가 원하는 해결책은 아니지만 해결 방법으로 직접 소스 번들 JAR 파일로 이동할 수 있습니다. 나는 Oomph와 같은 미래의 증거라고 확신하지 못하기 때문에 더 나은 해결책이 있기를 희망합니다.
String bloc = Platform.getBundle(bundlename).getLocation();
String location = bloc.replace(bundlename, bundlename+".source");
String path = new URL(location.replace("reference:", "")).getPath();
// Depending on installation type it may to prefix with Eclipse's installation path
if(!new File(path).exists())
path=Platform.getInstallLocation().getURL().getFile()+path;
File srcbundle = new File(path);
if(!srcbundle.exists()){
Logger.IDE.severe("Source bundle '"+path+"' not found!");
// When in runtime workbench we will get the source files from the bundle
for (URL url : Collections.list(bundle.findEntries("/", "*.*", true))) {
try(InputStream input = url.openStream()){
outputFile(input, url.getFile());
}
}
} else {
// When plugin installation we will unzip the source bundle JAR.
try(JarFile jar=new JarFile(srcbundle)){
for (JarEntry ze : Collections.list(jar.entries())) {
try(InputStream input = jar.getInputStream(ze)){
outputFile(input, ze.getName());
}
}
}
}