||Mon, 29 December 2008 15:41
Originally posted by: eclipse.ehrnhoefer.net|
In a previous thread I wondered about how to programmatically open the
JSDT in my own RCP application (without the whole webtools).
I finally managed that, adding a whole bunch of plugins (especially
org.eclipse.core.filebuffers, .variables, and io.views.properties.tabbed
were hard to find, cause the PDE did not tell me I need them).
So the snippet I came up with is:
IWorkspace ws = ResourcesPlugin.getWorkspace();
IWorkspaceRoot root= ws.getRoot();
IPath tmp = new Path(sourcefile.getAbsolutePath());
IFile file = root.getFile(tmp );
if (file != null)
catch (PartInitException e)
Problem here is, that the IFile contains something like
"L/myPath/myFile.js". No idea what the L means, but trying to open it
results in an IllegalArgumentException.
In the newsgroups I found somebody with a similar problem, regarding the
Java editor. The solution that worked for him in the end was rewriting the
IEditorInput for his own needs, which should be easy.
Although in the JS editor's case: there is no (public) EditorInput, there
file needs to be in the workspace? Problem is, in our current design, we
do not use the concept of workspaces at all, so the root is "\" and no
projects are in the workspace.
Does anybody have an idea how to solve this (without big redesigning),
even a quick&dirty fix would be good for now?
Thanks a lot
Powered by FUDForum
. Page generated in 0.01907 seconds