How to display the libraries node in ScriptExplorer? [message #540172] |
Tue, 15 June 2010 09:12 |
Jan F. Messages: 6 Registered: June 2010 |
Junior Member |
|
|
It seems that the display of library node is disabled in the ScriptExplorerPart - the line that pushes the flag to the content provider is commented out:
ScriptExplorerPart.java:724
// fContentProvider.setShowLibrariesNode(fShowLibrariesNode);
is there a reason for this (and thus I should create my own view for the project), or is there a way to make this work without hacking it?
[Updated on: Tue, 15 June 2010 09:47] Report message to a moderator
|
|
|
Re: How to display the libraries node in ScriptExplorer? [message #540330 is a reply to message #540172] |
Tue, 15 June 2010 17:07 |
Jan F. Messages: 6 Registered: June 2010 |
Junior Member |
|
|
After experimenting with build paths and using different new*Entry methods in DLTKCore, I noticed, by accident, that when I use the DLTKCore.newContainerEntry, the library pops up in the ScriptExplorer, cool.
However, I am realising that I do not really understand the ideas behind handling of the different build path entry types, I somehow assumed that the newLibEntry would have this effect, but it is not the case - if anyone could quickly shed some light here, I would really appreciate it.
Also, even though the library node now appears in the Script Explorer, it is empty and its name is the "<path> unknown", so I have not yet got it to work - posting as an update anyway, as this might be interesting info for people who come across this thread.
Will post more when I get farther.
|
|
|
|
Re: How to display the libraries node in ScriptExplorer? [message #540470 is a reply to message #540394] |
Wed, 16 June 2010 09:43 |
Jan F. Messages: 6 Registered: June 2010 |
Junior Member |
|
|
Hi Alex,
yeah, I should have bean clearer in my original post - I was already started with the assumption that the commented out code does what I need, which is why I focused on that part.
I am trying to do a fairly standard thing here - in the Script Explorer, display the Libraries node, which would contain standard SDK code - similarly to JDT the user should be able to browse the classes, Goto Definition would open classes from here, etc.
I also need the SDK classes to be indexed and part of the model.
What I figured out so far is:
- in the code that creates new projects I setup the buildpath of the new project via IScriptProject.setRawBuildpath - include DLTKCore.newSourceEntry and DLTKCore.newContainerEntry (with a symbolic name), so that both the project sources and the SDK are included on the build path (this results in the .buildpath file to be created inside the project root)
- use buildpathContainerInitializer extension point to map the symbolic name from above to a instance of the IBuildpathContainer, and set it via DLTKCore.setBuildpathContainer
- in my instance of the IBuildpathContainer in the method getBuildpathEntries I create a new library using DLTKCore.newLibraryEntry
Let me know if this feels right.
For now I am trying to figure out how to construct the IPath for the library to pass to the newLibraryEntry method - it is an external folder (i.e. not in workspace) - I am passing it a simple new Path ("/Users/.../../...") - and it ends up ignored down in EnvironmentPathUtils, which checks that the device in the Path is not null and contains "/" (I am on Mac, so the device is null for absolute paths). Here's the assert:
java.lang.IllegalArgumentException:
at org.eclipse.core.runtime.Assert.isLegal(Assert.java:63)
at org.eclipse.core.runtime.Assert.isLegal(Assert.java:47)
at org.eclipse.dltk.internal.core.BuildpathEntry.<init>(BuildpathEntry.java:187)
at org.eclipse.dltk.core.DLTKCore.newLibraryEntry(DLTKCore.java :2375)
at org.eclipse.dltk.core.DLTKCore.newExtLibraryEntry(DLTKCore.j ava:2251)
[Updated on: Wed, 16 June 2010 09:51] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03243 seconds