Loading a non-properties files from a fragment into and editor [message #326093] |
Fri, 07 March 2008 04:58  |
Eclipse User |
|
|
|
I have a html file that is translated and its translated copies reside in
my plugin fragment. I need to open it in an editor. The English version of
the file is at the root of my plugin. Currently I am using this code to
locat the file url, where relativePath is the file name:
public URL getURLFromFragment(relativePath){
Bundle bundle = Platform.getBundle(MY_PLUGIN_ID);
try{
IPath path = new Path("$nl$/"+relativePath);
URL url = FileLocator.find(bundle, path, null);
return url;
}
catch (Exception exc) {
exc.printStackTrace();
return null;
}
}
Then I instantiate my editor input class, a subclass of IPathEditorInput,
with a Path object built from the url returned my method above like:
myEditorInput editor = new myEditorInput(new
Path(getURLFromFragment("myFileName")));
This currently only opens the English version of the file! Anyone has any
idea why? Do I need to read in the file as an inputStream and then somehow
display it. I am thinking something must be wrong with how I am
instantiating my editor input class.
Any help is truly appreciated...
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02936 seconds