Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How can i open the editor on a file from a jar
How can i open the editor on a file from a jar [message #1864681] Wed, 03 April 2024 08:57
Loredana Hozan is currently offline Loredana HozanFriend
Messages: 34
Registered: January 2019
Member
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

Previous Topic:RCP Integrated CDT
Next Topic:Eclipse RCP & Hibernate
Goto Forum:
  


Current Time: Sun May 19 05:28:21 GMT 2024

Powered by FUDForum. Page generated in 0.02523 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top