Hello, i am trying to open the editor read only mode for a file from a jar.
I have a custom view similar to project explorer, and i am trying to open a file from a jar, similar to the way you would open the editor if you would go in Project Explorer > Maven Dependencies > expand the jar and double click on the file. I looked at the available code on github for eclipse.platform.ui and m2e-core but i can not find the code which does this specific operation.
So far i have tried :
//IFileStore fileStore = EFS.getLocalFileSystem().getStore(IPath.fromOSString(path));
//IFileStore fileStore = EFS.getStore(URI.create(path));
//FileStoreEditorInput fsei = new FileStoreEditorInput(fileStore);
//IDE.openEditor(page, fsei, "myDsl.editor.id", linkingActive);
IFileStore fileStore = EFS.getStore(URI.create(path));
IDE.openEditorOnFileStore(page, fileStore);
and
IDE.openEditor(page, URI.create(path), "myDsl.editor.id", true);
but i get : The system can not find the path specified.
Currently i am passing the path in the following format :
file:/C:/Users/user.name/pathToJar/myDsl.jar!/myDslFile.myDsl
adding "jar:" at the begging does not help, nor removing the ! after the .jar
I know there would be an option to unzip the jar and open it like this, but i would rather use a similar method to the way you can open files from maven dependencies from project explorer. Any ideas?
[Updated on: Wed, 03 April 2024 09:08]
Report message to a moderator