||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
||Tue, 06 January 2009 22:21
| Nitin Dahyabhai
Registered: July 2009
Thomas Ehrnhoefer wrote:|
> In a previous thread I wondered about how to programmatically open the
> JSDT in my own RCP application (without the whole webtools).
is largely built around use of the workspace. You can still open
external files in the editor, but you'll probably want to use
IFileStore), with a filestore from
Eclipse WTP Source Editing
Eclipse WTP, IBM
Powered by FUDForum
. Page generated in 0.02191 seconds